libmongocrypt-helper 1.7.4.0.1001 → 1.8.0.0.1001
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/ext/libmongocrypt/extconf.rb +2 -2
- data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +9 -7
- data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +17 -23
- data/ext/libmongocrypt/libmongocrypt/Earthfile +374 -0
- data/ext/libmongocrypt/libmongocrypt/README.md +7 -7
- data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +25 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +25 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +3 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/cs.sln +79 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +6 -4
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +24 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +134 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +3 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +203 -77
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +165 -43
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +12 -14
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/errors.js +75 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +34 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/aws.js +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/azure.js +178 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/gcp.js +24 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/index.js +54 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/utils.js +39 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +9 -4
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +4440 -5189
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +27 -8
- data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +65 -38
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +4 -7
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +434 -42
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/common.test.js +94 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +1 -45
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/index.test.js +45 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/providers/credentialsProvider.test.js +551 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +10 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +23 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/chai-addons.js +8 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/types/index.test-d.ts +63 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +128 -238
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +0 -27
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +5 -21
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +5 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +14 -9
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +1 -10
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +5 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test-requirements.txt +4 -12
- data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +8 -6
- data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +2 -1
- data/ext/libmongocrypt/libmongocrypt/cmake/Platform.cmake +50 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/mongocrypt-config.cmake +21 -0
- data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +2 -2
- data/ext/libmongocrypt/libmongocrypt/etc/c6-vault.repo +39 -0
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_aead_generate_tests.py +15 -24
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto.py +66 -54
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_generate_tests.py +14 -23
- data/ext/libmongocrypt/libmongocrypt/etc/fle2v2_aead_generate_tests.py +32 -0
- data/ext/libmongocrypt/libmongocrypt/etc/format-all.sh +12 -0
- data/ext/libmongocrypt/libmongocrypt/etc/format.sh +16 -0
- data/ext/libmongocrypt/libmongocrypt/etc/install-package.sh +48 -0
- data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-libmongocrypt-pr-625.patch +13 -0
- data/ext/libmongocrypt/libmongocrypt/src/crypto/cng.c +381 -436
- data/ext/libmongocrypt/libmongocrypt/src/crypto/commoncrypto.c +162 -227
- data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +180 -248
- data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +33 -55
- data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +175 -205
- data/ext/libmongocrypt/libmongocrypt/src/mc-array-private.h +10 -21
- data/ext/libmongocrypt/libmongocrypt/src/mc-array.c +44 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-check-conversions-private.h +4 -8
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +351 -463
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +59 -66
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +7 -11
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +80 -92
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +18 -10
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +59 -70
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +384 -439
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private-v2.h +41 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +11 -18
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +135 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +109 -126
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +88 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +24 -27
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +137 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +106 -125
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +117 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +28 -36
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +294 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +237 -278
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private-v2.h +133 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private.h +67 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +437 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +476 -325
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common-private.h +69 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common.c +182 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-private.h +23 -31
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2-private.h +85 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2.c +142 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev.c +104 -231
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-range-operator-private.h +8 -7
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +55 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +517 -580
- data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +36 -66
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +57 -76
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +158 -189
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +36 -42
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +515 -558
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +155 -191
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +43 -53
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +170 -240
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +29 -34
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +289 -338
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +36 -71
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +111 -164
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +55 -49
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +109 -125
- data/ext/libmongocrypt/libmongocrypt/src/mc-writer-private.h +66 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-writer.c +141 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/check.hpp +37 -55
- data/ext/libmongocrypt/libmongocrypt/src/mlib/endian.h +11 -11
- data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +27 -32
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +444 -499
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +251 -334
- data/ext/libmongocrypt/libmongocrypt/src/mlib/macros.h +4 -5
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +196 -231
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +56 -79
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +411 -530
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +116 -131
- data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +17 -26
- data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +3 -6
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary.c +31 -48
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +55 -131
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +444 -565
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +1 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +28 -45
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key-private.h +11 -17
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +103 -132
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +8 -14
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +78 -90
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +26 -45
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +220 -273
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +13 -25
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +147 -166
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-compat.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +110 -204
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +1137 -1565
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +425 -472
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +817 -694
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +2394 -2697
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +166 -186
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +308 -351
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +921 -1138
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +16 -24
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endian-private.h +44 -58
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint-private.h +21 -25
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint.c +167 -181
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +37 -43
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +215 -253
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +73 -108
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +889 -1034
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +27 -44
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +349 -402
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +92 -120
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +1397 -1612
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log-private.h +35 -67
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +49 -83
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +30 -36
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +1821 -1470
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-mutex-private.h +7 -12
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +80 -108
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +354 -424
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +101 -117
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status-private.h +3 -8
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status.c +92 -119
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util-private.h +19 -29
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +136 -176
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util-private.h +11 -21
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +96 -135
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +1092 -1320
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +130 -295
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +66 -78
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +20 -28
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +60 -73
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +8 -16
- data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +57 -87
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload-v2.json +60 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload-v2.json +67 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-field-map.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/mongocryptd-reply.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/cmd.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-payload.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/mongocryptd-reply.json +58 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload-v2.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/cmd.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/RNG_DATA.h +65 -65
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/cmd.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/RNG_DATA.h +132 -132
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/RNG_DATA.h +71 -71
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-payload.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/mongocryptd-reply.json +61 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/RNG_DATA.h +68 -68
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/RNG_DATA.h +19 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-payload.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/mongocryptd-reply.json +55 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/RNG_DATA.h +25 -25
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/RNG_DATA.h +65 -65
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/RNG_DATA.h +68 -68
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/RNG_DATA.h +19 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/RNG_DATA.h +25 -25
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/RNG_DATA.h +15 -15
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-field-map.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-payload.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/mongocryptd-reply.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-field-map.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-payload.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneRangeV2.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneV2.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/README.md +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/aes-ctr.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-fixed.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-generated.json +38 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-decrypt.json +35 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-fixed.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-generated.json +122 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-fixed.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-generated.json +122 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/mcgrew.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/nist.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/README.md +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/example-no-bson.c +4 -4
- data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +278 -323
- data/ext/libmongocrypt/libmongocrypt/test/fuzz_kms.c +8 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +6 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +221 -283
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +58 -73
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +78 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +89 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev-v2.c +248 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +467 -414
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +172 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +141 -159
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev-v2.c +338 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +238 -176
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +373 -474
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +346 -388
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +708 -825
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +417 -481
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +110 -144
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +124 -207
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +223 -213
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-writer.c +176 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +634 -807
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +168 -189
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +187 -211
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +34 -36
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +210 -233
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +185 -220
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +331 -445
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +670 -814
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +102 -135
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +54 -71
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +394 -846
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +159 -183
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +867 -1045
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +4349 -4713
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +750 -964
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +991 -1178
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +342 -419
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +23 -30
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +98 -111
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +49 -52
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-broker.c +770 -920
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +354 -407
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key.c +197 -245
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +286 -370
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +147 -166
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +50 -61
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +85 -100
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +656 -692
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +46 -58
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +377 -451
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +48 -67
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +4 -10
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +827 -918
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +111 -172
- data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +508 -559
- data/ext/libmongocrypt/libmongocrypt/test/util/util.c +735 -881
- data/ext/libmongocrypt/libmongocrypt/test/util/util.h +33 -55
- data/lib/libmongocrypt_helper/version.rb +2 -2
- data/lib/libmongocrypt_helper.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +154 -26
- metadata.gz.sig +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-document.json +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/credentialsProvider.js +0 -33
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/credentialsProvider.test.js +0 -163
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/aes-ctr.cstructs +0 -359
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-aead.cstructs +0 -109
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/rangeopts.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/value-to-encrypt.json +0 -20
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/RNG_DATA.h +0 -70
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/rangeopts.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/value-to-encrypt.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2.cstructs +0 -33
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/key-filter.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/rangeopts.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/rangeopts.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
@@ -20,719 +20,683 @@
|
|
20
20
|
#include "mongocrypt-marking-private.h"
|
21
21
|
#include "test-mongocrypt.h"
|
22
22
|
|
23
|
-
|
24
23
|
/* Create a basis marking buffer with valid values for the given fields. */
|
25
|
-
static void
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
buf->owned = true;
|
34
|
-
memcpy (buf->data + 1, bson_get_data (bson), bson->len);
|
24
|
+
static void _make_marking(bson_t *bson, _mongocrypt_buffer_t *buf) {
|
25
|
+
buf->len = bson->len + 1;
|
26
|
+
buf->data = bson_malloc(buf->len);
|
27
|
+
BSON_ASSERT(buf->data);
|
28
|
+
|
29
|
+
buf->data[0] = 0;
|
30
|
+
buf->owned = true;
|
31
|
+
memcpy(buf->data + 1, bson_get_data(bson), bson->len);
|
35
32
|
}
|
36
33
|
|
34
|
+
static void _parse_ok(_mongocrypt_buffer_t *marking_buf, _mongocrypt_marking_t *out) {
|
35
|
+
mongocrypt_status_t *status;
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
mongocrypt_status_t *status;
|
42
|
-
|
43
|
-
status = mongocrypt_status_new ();
|
44
|
-
memset (out, 0, sizeof (*out));
|
45
|
-
ASSERT_OK_STATUS (
|
46
|
-
_mongocrypt_marking_parse_unowned (marking_buf, out, status), status);
|
37
|
+
status = mongocrypt_status_new();
|
38
|
+
memset(out, 0, sizeof(*out));
|
39
|
+
ASSERT_OK_STATUS(_mongocrypt_marking_parse_unowned(marking_buf, out, status), status);
|
47
40
|
|
48
|
-
|
41
|
+
mongocrypt_status_destroy(status);
|
49
42
|
}
|
50
43
|
|
44
|
+
static void _parse_fails(_mongocrypt_buffer_t *marking_buf, const char *msg, _mongocrypt_marking_t *out) {
|
45
|
+
mongocrypt_status_t *status;
|
51
46
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
_mongocrypt_marking_t *out)
|
56
|
-
{
|
57
|
-
mongocrypt_status_t *status;
|
58
|
-
|
59
|
-
status = mongocrypt_status_new ();
|
60
|
-
memset (out, 0, sizeof (*out));
|
61
|
-
ASSERT_FAILS_STATUS (
|
62
|
-
_mongocrypt_marking_parse_unowned (marking_buf, out, status),
|
63
|
-
status,
|
64
|
-
msg);
|
47
|
+
status = mongocrypt_status_new();
|
48
|
+
memset(out, 0, sizeof(*out));
|
49
|
+
ASSERT_FAILS_STATUS(_mongocrypt_marking_parse_unowned(marking_buf, out, status), status, msg);
|
65
50
|
|
66
|
-
|
51
|
+
mongocrypt_status_destroy(status);
|
67
52
|
}
|
68
53
|
|
69
|
-
static void
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
marking_bson = TMP_BSON ("{'v': 'abc', 'ka': 1}");
|
179
|
-
_make_marking (marking_bson, &marking_buf);
|
180
|
-
_parse_fails (&marking_buf, "key alt name must be a UTF8", &marking);
|
181
|
-
_mongocrypt_buffer_cleanup (&marking_buf);
|
182
|
-
_mongocrypt_marking_cleanup (&marking);
|
54
|
+
static void test_mongocrypt_marking_parse(_mongocrypt_tester_t *tester) {
|
55
|
+
bson_t *marking_bson;
|
56
|
+
_mongocrypt_buffer_t marking_buf;
|
57
|
+
_mongocrypt_marking_t marking;
|
58
|
+
|
59
|
+
/* successful case. */
|
60
|
+
marking_bson = TMP_BSON("{'a': 2, 'v': 'abc', 'ka': 'alt'}");
|
61
|
+
_make_marking(marking_bson, &marking_buf);
|
62
|
+
_parse_ok(&marking_buf, &marking);
|
63
|
+
BSON_ASSERT(marking.algorithm == MONGOCRYPT_ENCRYPTION_ALGORITHM_RANDOM);
|
64
|
+
BSON_ASSERT(0 == strcmp("abc", bson_iter_utf8(&marking.v_iter, NULL)));
|
65
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
66
|
+
_mongocrypt_marking_cleanup(&marking);
|
67
|
+
|
68
|
+
/* buffer < 6 bytes */
|
69
|
+
marking_buf.data = (uint8_t *)"abc";
|
70
|
+
marking_buf.len = 3;
|
71
|
+
marking_buf.owned = false;
|
72
|
+
_parse_fails(&marking_buf, "invalid marking, length < 6", &marking);
|
73
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
74
|
+
_mongocrypt_marking_cleanup(&marking);
|
75
|
+
|
76
|
+
/* bad first byte */
|
77
|
+
marking_bson = TMP_BSON("{'a': 2, 'v': 'abc', 'ka': 'alt'}");
|
78
|
+
_make_marking(marking_bson, &marking_buf);
|
79
|
+
_mongocrypt_marking_cleanup(&marking);
|
80
|
+
marking_buf.data[0] = 1;
|
81
|
+
_parse_fails(&marking_buf, "invalid marking", &marking);
|
82
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
83
|
+
_mongocrypt_marking_cleanup(&marking);
|
84
|
+
|
85
|
+
/* unrecognized fields. */
|
86
|
+
marking_bson = TMP_BSON("{'a': 2, 'v': 'abc', 'ka': 'alt', 'extra': 1}");
|
87
|
+
_make_marking(marking_bson, &marking_buf);
|
88
|
+
_parse_fails(&marking_buf, "unrecognized field 'extra'", &marking);
|
89
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
90
|
+
_mongocrypt_marking_cleanup(&marking);
|
91
|
+
|
92
|
+
/* malformed BSON. */
|
93
|
+
marking_bson = TMP_BSON("{}");
|
94
|
+
((uint8_t *)bson_get_data(marking_bson))[4] = 0xFF;
|
95
|
+
_make_marking(marking_bson, &marking_buf);
|
96
|
+
_parse_fails(&marking_buf, "invalid BSON", &marking);
|
97
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
98
|
+
_mongocrypt_marking_cleanup(&marking);
|
99
|
+
|
100
|
+
/* a: missing */
|
101
|
+
marking_bson = TMP_BSON("{'v': 'abc', 'ka': 'alt'}");
|
102
|
+
_make_marking(marking_bson, &marking_buf);
|
103
|
+
_parse_fails(&marking_buf, "no 'a' specified", &marking);
|
104
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
105
|
+
_mongocrypt_marking_cleanup(&marking);
|
106
|
+
/* a: wrong type */
|
107
|
+
marking_bson = TMP_BSON("{'a': 'abc', 'v': 'abc', 'ka': 'alt'}");
|
108
|
+
_make_marking(marking_bson, &marking_buf);
|
109
|
+
_parse_fails(&marking_buf, "invalid marking, 'a' must be an int32", &marking);
|
110
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
111
|
+
_mongocrypt_marking_cleanup(&marking);
|
112
|
+
/* a: wrong integer */
|
113
|
+
marking_bson = TMP_BSON("{'a': -1, 'v': 'abc', 'ka': 'alt'}");
|
114
|
+
_make_marking(marking_bson, &marking_buf);
|
115
|
+
_parse_fails(&marking_buf, "invalid algorithm value: -1", &marking);
|
116
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
117
|
+
_mongocrypt_marking_cleanup(&marking);
|
118
|
+
|
119
|
+
/* v: missing */
|
120
|
+
marking_bson = TMP_BSON("{'a': 2, 'ka': 'alt'}");
|
121
|
+
_make_marking(marking_bson, &marking_buf);
|
122
|
+
_parse_fails(&marking_buf, "no 'v' specified", &marking);
|
123
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
124
|
+
_mongocrypt_marking_cleanup(&marking);
|
125
|
+
|
126
|
+
/* Not testing IV per CDRIVER-3127. TODO: remove this comment. */
|
127
|
+
|
128
|
+
/* ki+ka: missing */
|
129
|
+
marking_bson = TMP_BSON("{'a': 2, 'v': 'abc'}");
|
130
|
+
_make_marking(marking_bson, &marking_buf);
|
131
|
+
_parse_fails(&marking_buf, "neither 'ki' nor 'ka' specified", &marking);
|
132
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
133
|
+
_mongocrypt_marking_cleanup(&marking);
|
134
|
+
/* ki+ka: both present */
|
135
|
+
marking_bson = TMP_BSON("{'a': 2, 'v': 'abc', 'ka': 'alt' }");
|
136
|
+
BSON_APPEND_BINARY(marking_bson, "ki", BSON_SUBTYPE_UUID, (TEST_BIN(16))->data, 16);
|
137
|
+
_make_marking(marking_bson, &marking_buf);
|
138
|
+
_parse_fails(&marking_buf, "both 'ki' and 'ka' specified", &marking);
|
139
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
140
|
+
_mongocrypt_marking_cleanup(&marking);
|
141
|
+
|
142
|
+
/* ki: wrong type */
|
143
|
+
marking_bson = TMP_BSON("{'a': 2, 'v': 'abc', 'ki': 'abc' }");
|
144
|
+
_make_marking(marking_bson, &marking_buf);
|
145
|
+
_parse_fails(&marking_buf, "key id must be a UUID", &marking);
|
146
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
147
|
+
_mongocrypt_marking_cleanup(&marking);
|
148
|
+
|
149
|
+
/* ki: wrong subtype */
|
150
|
+
marking_bson = TMP_BSON("{'a': 2, 'v': 'abc' }");
|
151
|
+
BSON_APPEND_BINARY(marking_bson, "ki", BSON_SUBTYPE_BINARY, (TEST_BIN(16))->data, 16);
|
152
|
+
_make_marking(marking_bson, &marking_buf);
|
153
|
+
_parse_fails(&marking_buf, "key id must be a UUID", &marking);
|
154
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
155
|
+
_mongocrypt_marking_cleanup(&marking);
|
156
|
+
|
157
|
+
/* ka: wrong type */
|
158
|
+
marking_bson = TMP_BSON("{'v': 'abc', 'ka': 1}");
|
159
|
+
_make_marking(marking_bson, &marking_buf);
|
160
|
+
_parse_fails(&marking_buf, "key alt name must be a UTF8", &marking);
|
161
|
+
_mongocrypt_buffer_cleanup(&marking_buf);
|
162
|
+
_mongocrypt_marking_cleanup(&marking);
|
183
163
|
}
|
184
164
|
|
185
|
-
|
186
165
|
#define RAW_STRING(...) #__VA_ARGS__
|
187
166
|
|
188
|
-
#define ASSERT_MINCOVER_EQ(got, expectString)
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
167
|
+
#define ASSERT_MINCOVER_EQ(got, expectString) \
|
168
|
+
if (1) { \
|
169
|
+
bson_string_t *gotStr = bson_string_new(""); \
|
170
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) { \
|
171
|
+
bson_string_append_printf(gotStr, "%s\n", mc_mincover_get(got, i)); \
|
172
|
+
} \
|
173
|
+
ASSERT_STREQUAL(gotStr->str, expectString); \
|
174
|
+
bson_string_free(gotStr, true); \
|
175
|
+
} else \
|
176
|
+
((void)0)
|
198
177
|
|
199
178
|
/* test_mc_get_mincover_from_FLE2RangeFindSpec tests processing an
|
200
179
|
* FLE2RangeFindSpec into a mincover. It is is analogous to the
|
201
180
|
* MinCoverInterfaceTest in the server code:
|
202
181
|
* https://github.com/mongodb/mongo/blob/a4a3eba2a0e0a839ca6213491361269b42e12761/src/mongo/crypto/fle_crypto_test.cpp#L2585
|
203
182
|
*/
|
204
|
-
static void
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
ASSERT (NULL == mc);
|
719
|
-
ASSERT_STATUS_CONTAINS (status, test->expectedError);
|
720
|
-
} else {
|
721
|
-
ASSERT_OK_STATUS (mc, status);
|
722
|
-
ASSERT_MINCOVER_EQ (mc, test->expectedMinCover);
|
723
|
-
}
|
724
|
-
mc_mincover_destroy (mc);
|
725
|
-
|
726
|
-
bson_destroy (findSpecDoc);
|
727
|
-
bson_destroy (findSpecVal);
|
728
|
-
mongocrypt_status_destroy (status);
|
729
|
-
}
|
183
|
+
static void test_mc_get_mincover_from_FLE2RangeFindSpec(_mongocrypt_tester_t *tester) {
|
184
|
+
typedef struct {
|
185
|
+
const char *description; // May be NULL.
|
186
|
+
const char *findSpecJSON;
|
187
|
+
const char *expectedMinCover;
|
188
|
+
mc_optional_int64_t sparsity;
|
189
|
+
const char *expectedError;
|
190
|
+
} testcase_t;
|
191
|
+
|
192
|
+
testcase_t tests[] = {
|
193
|
+
{.description = "Int32 Bounds included",
|
194
|
+
.findSpecJSON = RAW_STRING({
|
195
|
+
"lowerBound" : {"$numberInt" : "7"},
|
196
|
+
"lbIncluded" : true,
|
197
|
+
"upperBound" : {"$numberInt" : "32"},
|
198
|
+
"ubIncluded" : true,
|
199
|
+
"indexMin" : {"$numberInt" : "0"},
|
200
|
+
"indexMax" : {"$numberInt" : "32"}
|
201
|
+
}),
|
202
|
+
.expectedMinCover = "000111\n"
|
203
|
+
"001\n"
|
204
|
+
"01\n"
|
205
|
+
"100000\n"},
|
206
|
+
|
207
|
+
{.description = "Int32 Bounds excluded",
|
208
|
+
.findSpecJSON = RAW_STRING({
|
209
|
+
"lowerBound" : {"$numberInt" : "7"},
|
210
|
+
"lbIncluded" : false,
|
211
|
+
"upperBound" : {"$numberInt" : "32"},
|
212
|
+
"ubIncluded" : false,
|
213
|
+
"indexMin" : {"$numberInt" : "0"},
|
214
|
+
"indexMax" : {"$numberInt" : "32"}
|
215
|
+
}),
|
216
|
+
.expectedMinCover = "001\n"
|
217
|
+
"01\n"},
|
218
|
+
{.description = "Int32 Upper bound excluded",
|
219
|
+
.findSpecJSON = RAW_STRING({
|
220
|
+
"lowerBound" : {"$numberInt" : "7"},
|
221
|
+
"lbIncluded" : true,
|
222
|
+
"upperBound" : {"$numberInt" : "32"},
|
223
|
+
"ubIncluded" : false,
|
224
|
+
"indexMin" : {"$numberInt" : "0"},
|
225
|
+
"indexMax" : {"$numberInt" : "32"}
|
226
|
+
}),
|
227
|
+
.expectedMinCover = "000111\n"
|
228
|
+
"001\n"
|
229
|
+
"01\n"},
|
230
|
+
{.description = "Int32 Lower bound excluded",
|
231
|
+
.findSpecJSON = RAW_STRING({
|
232
|
+
"lowerBound" : {"$numberInt" : "7"},
|
233
|
+
"lbIncluded" : false,
|
234
|
+
"upperBound" : {"$numberInt" : "32"},
|
235
|
+
"ubIncluded" : true,
|
236
|
+
"indexMin" : {"$numberInt" : "0"},
|
237
|
+
"indexMax" : {"$numberInt" : "32"}
|
238
|
+
}),
|
239
|
+
.expectedMinCover = "001\n"
|
240
|
+
"01\n"
|
241
|
+
"100000\n"},
|
242
|
+
{.description = "Int32 Infinite upper bound",
|
243
|
+
.findSpecJSON = RAW_STRING({
|
244
|
+
"lowerBound" : {"$numberInt" : "7"},
|
245
|
+
"lbIncluded" : true,
|
246
|
+
"upperBound" : {"$numberDouble" : "Infinity"},
|
247
|
+
"ubIncluded" : true,
|
248
|
+
"indexMin" : {"$numberInt" : "0"},
|
249
|
+
"indexMax" : {"$numberInt" : "32"}
|
250
|
+
}),
|
251
|
+
.expectedMinCover = "000111\n"
|
252
|
+
"001\n"
|
253
|
+
"01\n"
|
254
|
+
"100000\n"},
|
255
|
+
{.description = "Int32 Infinite lower bound",
|
256
|
+
.findSpecJSON = RAW_STRING({
|
257
|
+
"lowerBound" : {"$numberDouble" : "-Infinity"},
|
258
|
+
"lbIncluded" : true,
|
259
|
+
"upperBound" : {"$numberInt" : "8"},
|
260
|
+
"ubIncluded" : true,
|
261
|
+
"indexMin" : {"$numberInt" : "0"},
|
262
|
+
"indexMax" : {"$numberInt" : "32"}
|
263
|
+
}),
|
264
|
+
.expectedMinCover = "000\n"
|
265
|
+
"001000\n"},
|
266
|
+
{.description = "Int32 Infinite both bounds",
|
267
|
+
.findSpecJSON = RAW_STRING({
|
268
|
+
"lowerBound" : {"$numberDouble" : "-Infinity"},
|
269
|
+
"lbIncluded" : true,
|
270
|
+
"upperBound" : {"$numberDouble" : "Infinity"},
|
271
|
+
"ubIncluded" : true,
|
272
|
+
"indexMin" : {"$numberInt" : "0"},
|
273
|
+
"indexMax" : {"$numberInt" : "32"}
|
274
|
+
}),
|
275
|
+
.expectedMinCover = "0\n"
|
276
|
+
"100000\n"},
|
277
|
+
{.description = "Int64 Bounds included",
|
278
|
+
.findSpecJSON = RAW_STRING({
|
279
|
+
"lowerBound" : {"$numberLong" : "0"},
|
280
|
+
"lbIncluded" : true,
|
281
|
+
"upperBound" : {"$numberLong" : "823"},
|
282
|
+
"ubIncluded" : true,
|
283
|
+
"indexMin" : {"$numberLong" : "-1000000000000000"},
|
284
|
+
"indexMax" : {"$numberLong" : "8070450532247928832"}
|
285
|
+
}),
|
286
|
+
.expectedMinCover = "000000000000011100011010111111010100100110001101000000\n"
|
287
|
+
"00000000000001110001101011111101010010011000110100000100\n"
|
288
|
+
"00000000000001110001101011111101010010011000110100000101\n"
|
289
|
+
"0000000000000111000110101111110101001001100011010000011000\n"
|
290
|
+
"000000000000011100011010111111010100100110001101000001100100\n"
|
291
|
+
"000000000000011100011010111111010100100110001101000001100101\n"
|
292
|
+
"000000000000011100011010111111010100100110001101000001100110\n",
|
293
|
+
.sparsity = OPT_I64(2)},
|
294
|
+
|
295
|
+
{.description = "Int64 Bounds excluded",
|
296
|
+
.findSpecJSON = RAW_STRING({
|
297
|
+
"lowerBound" : {"$numberLong" : "0"},
|
298
|
+
"lbIncluded" : false,
|
299
|
+
"upperBound" : {"$numberLong" : "823"},
|
300
|
+
"ubIncluded" : false,
|
301
|
+
"indexMin" : {"$numberLong" : "-1000000000000000"},
|
302
|
+
"indexMax" : {"$numberLong" : "8070450532247928832"}
|
303
|
+
}),
|
304
|
+
.expectedMinCover = "000000000000011100011010111111010100100110001101000000000000001\n"
|
305
|
+
"00000000000001110001101011111101010010011000110100000000000001\n"
|
306
|
+
"00000000000001110001101011111101010010011000110100000000000010\n"
|
307
|
+
"00000000000001110001101011111101010010011000110100000000000011\n"
|
308
|
+
"000000000000011100011010111111010100100110001101000000000001\n"
|
309
|
+
"000000000000011100011010111111010100100110001101000000000010\n"
|
310
|
+
"000000000000011100011010111111010100100110001101000000000011\n"
|
311
|
+
"0000000000000111000110101111110101001001100011010000000001\n"
|
312
|
+
"0000000000000111000110101111110101001001100011010000000010\n"
|
313
|
+
"0000000000000111000110101111110101001001100011010000000011\n"
|
314
|
+
"00000000000001110001101011111101010010011000110100000001\n"
|
315
|
+
"00000000000001110001101011111101010010011000110100000010\n"
|
316
|
+
"00000000000001110001101011111101010010011000110100000011\n"
|
317
|
+
"00000000000001110001101011111101010010011000110100000100\n"
|
318
|
+
"00000000000001110001101011111101010010011000110100000101\n"
|
319
|
+
"0000000000000111000110101111110101001001100011010000011000\n"
|
320
|
+
"000000000000011100011010111111010100100110001101000001100100\n"
|
321
|
+
"000000000000011100011010111111010100100110001101000001100101\n"
|
322
|
+
"00000000000001110001101011111101010010011000110100000110011000\n"
|
323
|
+
"00000000000001110001101011111101010010011000110100000110011001\n"
|
324
|
+
"00000000000001110001101011111101010010011000110100000110011010\n"
|
325
|
+
"000000000000011100011010111111010100100110001101000001100110110\n",
|
326
|
+
.sparsity = OPT_I64(2)},
|
327
|
+
|
328
|
+
{.description = "Int64 Upper bound excluded",
|
329
|
+
.findSpecJSON = RAW_STRING({
|
330
|
+
"lowerBound" : {"$numberLong" : "0"},
|
331
|
+
"lbIncluded" : true,
|
332
|
+
"upperBound" : {"$numberLong" : "823"},
|
333
|
+
"ubIncluded" : false,
|
334
|
+
"indexMin" : {"$numberLong" : "-1000000000000000"},
|
335
|
+
"indexMax" : {"$numberLong" : "8070450532247928832"}
|
336
|
+
}),
|
337
|
+
.expectedMinCover = "000000000000011100011010111111010100100110001101000000\n"
|
338
|
+
"00000000000001110001101011111101010010011000110100000100\n"
|
339
|
+
"00000000000001110001101011111101010010011000110100000101\n"
|
340
|
+
"0000000000000111000110101111110101001001100011010000011000\n"
|
341
|
+
"000000000000011100011010111111010100100110001101000001100100\n"
|
342
|
+
"000000000000011100011010111111010100100110001101000001100101\n"
|
343
|
+
"00000000000001110001101011111101010010011000110100000110011000\n"
|
344
|
+
"00000000000001110001101011111101010010011000110100000110011001\n"
|
345
|
+
"00000000000001110001101011111101010010011000110100000110011010\n"
|
346
|
+
"000000000000011100011010111111010100100110001101000001100110110\n",
|
347
|
+
.sparsity = OPT_I64(2)},
|
348
|
+
|
349
|
+
{.description = "Int64 Lower bound excluded",
|
350
|
+
.findSpecJSON = RAW_STRING({
|
351
|
+
"lowerBound" : {"$numberLong" : "0"},
|
352
|
+
"lbIncluded" : false,
|
353
|
+
"upperBound" : {"$numberLong" : "823"},
|
354
|
+
"ubIncluded" : true,
|
355
|
+
"indexMin" : {"$numberLong" : "-1000000000000000"},
|
356
|
+
"indexMax" : {"$numberLong" : "8070450532247928832"}
|
357
|
+
}),
|
358
|
+
.expectedMinCover = "000000000000011100011010111111010100100110001101000000000000001\n"
|
359
|
+
"00000000000001110001101011111101010010011000110100000000000001\n"
|
360
|
+
"00000000000001110001101011111101010010011000110100000000000010\n"
|
361
|
+
"00000000000001110001101011111101010010011000110100000000000011\n"
|
362
|
+
"000000000000011100011010111111010100100110001101000000000001\n"
|
363
|
+
"000000000000011100011010111111010100100110001101000000000010\n"
|
364
|
+
"000000000000011100011010111111010100100110001101000000000011\n"
|
365
|
+
"0000000000000111000110101111110101001001100011010000000001\n"
|
366
|
+
"0000000000000111000110101111110101001001100011010000000010\n"
|
367
|
+
"0000000000000111000110101111110101001001100011010000000011\n"
|
368
|
+
"00000000000001110001101011111101010010011000110100000001\n"
|
369
|
+
"00000000000001110001101011111101010010011000110100000010\n"
|
370
|
+
"00000000000001110001101011111101010010011000110100000011\n"
|
371
|
+
"00000000000001110001101011111101010010011000110100000100\n"
|
372
|
+
"00000000000001110001101011111101010010011000110100000101\n"
|
373
|
+
"0000000000000111000110101111110101001001100011010000011000\n"
|
374
|
+
"000000000000011100011010111111010100100110001101000001100100\n"
|
375
|
+
"000000000000011100011010111111010100100110001101000001100101\n"
|
376
|
+
"000000000000011100011010111111010100100110001101000001100110\n",
|
377
|
+
.sparsity = OPT_I64(2)},
|
378
|
+
{.description = "Int64 Infinite upper bound",
|
379
|
+
.findSpecJSON = RAW_STRING({
|
380
|
+
"lowerBound" : {"$numberLong" : "1"},
|
381
|
+
"lbIncluded" : true,
|
382
|
+
"upperBound" : {"$numberDouble" : "Infinity"},
|
383
|
+
"ubIncluded" : true,
|
384
|
+
"indexMin" : {"$numberLong" : "0"},
|
385
|
+
"indexMax" : {"$numberLong" : "7"}
|
386
|
+
}),
|
387
|
+
.expectedMinCover = "001\n"
|
388
|
+
"01\n"
|
389
|
+
"1\n"},
|
390
|
+
{.description = "Int64 Infinite lower bound",
|
391
|
+
.findSpecJSON = RAW_STRING({
|
392
|
+
"lowerBound" : {"$numberDouble" : "-Infinity"},
|
393
|
+
"lbIncluded" : true,
|
394
|
+
"upperBound" : {"$numberLong" : "5"},
|
395
|
+
"ubIncluded" : true,
|
396
|
+
"indexMin" : {"$numberLong" : "0"},
|
397
|
+
"indexMax" : {"$numberLong" : "7"}
|
398
|
+
}),
|
399
|
+
.expectedMinCover = "0\n"
|
400
|
+
"10\n"},
|
401
|
+
{.description = "Int64 Infinite both bounds",
|
402
|
+
.findSpecJSON = RAW_STRING({
|
403
|
+
"lowerBound" : {"$numberDouble" : "-Infinity"},
|
404
|
+
"lbIncluded" : true,
|
405
|
+
"upperBound" : {"$numberDouble" : "Infinity"},
|
406
|
+
"ubIncluded" : true,
|
407
|
+
"indexMin" : {"$numberLong" : "0"},
|
408
|
+
"indexMax" : {"$numberLong" : "7"}
|
409
|
+
}),
|
410
|
+
.expectedMinCover = "root\n"},
|
411
|
+
{.description = "Mismatched types",
|
412
|
+
.findSpecJSON = RAW_STRING({
|
413
|
+
"lowerBound" : {"$numberInt" : "1"},
|
414
|
+
"lbIncluded" : true,
|
415
|
+
"upperBound" : {"$numberLong" : "2"},
|
416
|
+
"ubIncluded" : true,
|
417
|
+
"indexMin" : {"$numberLong" : "0"},
|
418
|
+
"indexMax" : {"$numberLong" : "7"}
|
419
|
+
}),
|
420
|
+
.expectedError = "expected lowerBound to match index type"},
|
421
|
+
{.description = "Int32 exclusive lower bound > upper bound",
|
422
|
+
.findSpecJSON = RAW_STRING({
|
423
|
+
"lowerBound" : {"$numberInt" : "7"},
|
424
|
+
"lbIncluded" : false,
|
425
|
+
"upperBound" : {"$numberInt" : "7"},
|
426
|
+
"ubIncluded" : true,
|
427
|
+
"indexMin" : {"$numberInt" : "0"},
|
428
|
+
"indexMax" : {"$numberInt" : "32"}
|
429
|
+
}),
|
430
|
+
.expectedError = "must be less than or equal to range max"},
|
431
|
+
{.description = "Int64 exclusive lower bound > upper bound",
|
432
|
+
.findSpecJSON = RAW_STRING({
|
433
|
+
"lowerBound" : {"$numberLong" : "7"},
|
434
|
+
"lbIncluded" : false,
|
435
|
+
"upperBound" : {"$numberLong" : "7"},
|
436
|
+
"ubIncluded" : true,
|
437
|
+
"indexMin" : {"$numberLong" : "0"},
|
438
|
+
"indexMax" : {"$numberLong" : "32"}
|
439
|
+
}),
|
440
|
+
.expectedError = "must be less than or equal to range max"},
|
441
|
+
{.description = "Int32 exclusive upper bound < lower bound",
|
442
|
+
.findSpecJSON = RAW_STRING({
|
443
|
+
"lowerBound" : {"$numberInt" : "7"},
|
444
|
+
"lbIncluded" : true,
|
445
|
+
"upperBound" : {"$numberInt" : "7"},
|
446
|
+
"ubIncluded" : false,
|
447
|
+
"indexMin" : {"$numberInt" : "0"},
|
448
|
+
"indexMax" : {"$numberInt" : "32"}
|
449
|
+
}),
|
450
|
+
.expectedError = "must be less than or equal to range max"},
|
451
|
+
{.description = "Int64 exclusive upper bound < lower bound",
|
452
|
+
.findSpecJSON = RAW_STRING({
|
453
|
+
"lowerBound" : {"$numberLong" : "7"},
|
454
|
+
"lbIncluded" : true,
|
455
|
+
"upperBound" : {"$numberLong" : "7"},
|
456
|
+
"ubIncluded" : false,
|
457
|
+
"indexMin" : {"$numberLong" : "0"},
|
458
|
+
"indexMax" : {"$numberLong" : "32"}
|
459
|
+
}),
|
460
|
+
.expectedError = "must be less than or equal to range max"},
|
461
|
+
{.description = "Int32 exclusive bounds cross",
|
462
|
+
.findSpecJSON = RAW_STRING({
|
463
|
+
"lowerBound" : {"$numberInt" : "7"},
|
464
|
+
"lbIncluded" : false,
|
465
|
+
"upperBound" : {"$numberInt" : "7"},
|
466
|
+
"ubIncluded" : false,
|
467
|
+
"indexMin" : {"$numberInt" : "0"},
|
468
|
+
"indexMax" : {"$numberInt" : "32"}
|
469
|
+
}),
|
470
|
+
.expectedError = "must be less than or equal to range max"},
|
471
|
+
{.description = "Int64 exclusive bounds cross",
|
472
|
+
.findSpecJSON = RAW_STRING({
|
473
|
+
"lowerBound" : {"$numberLong" : "7"},
|
474
|
+
"lbIncluded" : false,
|
475
|
+
"upperBound" : {"$numberLong" : "7"},
|
476
|
+
"ubIncluded" : false,
|
477
|
+
"indexMin" : {"$numberLong" : "0"},
|
478
|
+
"indexMax" : {"$numberLong" : "32"}
|
479
|
+
}),
|
480
|
+
.expectedError = "must be less than or equal to range max"},
|
481
|
+
{.description = "Int32 exclusive upper bound is 0",
|
482
|
+
.findSpecJSON = RAW_STRING({
|
483
|
+
"lowerBound" : {"$numberInt" : "0"},
|
484
|
+
"lbIncluded" : true,
|
485
|
+
"upperBound" : {"$numberInt" : "0"},
|
486
|
+
"ubIncluded" : false,
|
487
|
+
"indexMin" : {"$numberInt" : "0"},
|
488
|
+
"indexMax" : {"$numberInt" : "32"}
|
489
|
+
}),
|
490
|
+
.expectedError = "must be greater than the range minimum"},
|
491
|
+
{.description = "Double inclusive bounds",
|
492
|
+
.findSpecJSON = RAW_STRING({
|
493
|
+
"lowerBound" : {"$numberDouble" : "23.5"},
|
494
|
+
"lbIncluded" : true,
|
495
|
+
"upperBound" : {"$numberDouble" : "35.25"},
|
496
|
+
"ubIncluded" : true,
|
497
|
+
"indexMin" : {"$numberDouble" : "0"},
|
498
|
+
"indexMax" : {"$numberDouble" : "1000"}
|
499
|
+
}),
|
500
|
+
.expectedMinCover = "11000000001101111\n"
|
501
|
+
"1100000000111\n"
|
502
|
+
"1100000001000000\n"
|
503
|
+
"11000000010000010\n"
|
504
|
+
"1100000001000001100\n"
|
505
|
+
"110000000100000110100000000000000000000000000000000"
|
506
|
+
"0000000000000\n"},
|
507
|
+
{.description = "Double exclusive bounds",
|
508
|
+
.findSpecJSON = RAW_STRING({
|
509
|
+
"lowerBound" : {"$numberDouble" : "23.5"},
|
510
|
+
"lbIncluded" : false,
|
511
|
+
"upperBound" : {"$numberDouble" : "35.25"},
|
512
|
+
"ubIncluded" : false,
|
513
|
+
"indexMin" : {"$numberDouble" : "0"},
|
514
|
+
"indexMax" : {"$numberDouble" : "1000"}
|
515
|
+
}),
|
516
|
+
.expectedMinCover = "1100000000110111100000000000000000000000000000000000000000000001\n"
|
517
|
+
"110000000011011110000000000000000000000000000000000000000000001\n"
|
518
|
+
"11000000001101111000000000000000000000000000000000000000000001\n"
|
519
|
+
"1100000000110111100000000000000000000000000000000000000000001\n"
|
520
|
+
"110000000011011110000000000000000000000000000000000000000001\n"
|
521
|
+
"11000000001101111000000000000000000000000000000000000000001\n"
|
522
|
+
"1100000000110111100000000000000000000000000000000000000001\n"
|
523
|
+
"110000000011011110000000000000000000000000000000000000001\n"
|
524
|
+
"11000000001101111000000000000000000000000000000000000001\n"
|
525
|
+
"1100000000110111100000000000000000000000000000000000001\n"
|
526
|
+
"110000000011011110000000000000000000000000000000000001\n"
|
527
|
+
"11000000001101111000000000000000000000000000000000001\n"
|
528
|
+
"1100000000110111100000000000000000000000000000000001\n"
|
529
|
+
"110000000011011110000000000000000000000000000000001\n"
|
530
|
+
"11000000001101111000000000000000000000000000000001\n"
|
531
|
+
"1100000000110111100000000000000000000000000000001\n"
|
532
|
+
"110000000011011110000000000000000000000000000001\n"
|
533
|
+
"11000000001101111000000000000000000000000000001\n"
|
534
|
+
"1100000000110111100000000000000000000000000001\n"
|
535
|
+
"110000000011011110000000000000000000000000001\n"
|
536
|
+
"11000000001101111000000000000000000000000001\n"
|
537
|
+
"1100000000110111100000000000000000000000001\n"
|
538
|
+
"110000000011011110000000000000000000000001\n"
|
539
|
+
"11000000001101111000000000000000000000001\n"
|
540
|
+
"1100000000110111100000000000000000000001\n"
|
541
|
+
"110000000011011110000000000000000000001\n"
|
542
|
+
"11000000001101111000000000000000000001\n"
|
543
|
+
"1100000000110111100000000000000000001\n"
|
544
|
+
"110000000011011110000000000000000001\n"
|
545
|
+
"11000000001101111000000000000000001\n"
|
546
|
+
"1100000000110111100000000000000001\n"
|
547
|
+
"110000000011011110000000000000001\n"
|
548
|
+
"11000000001101111000000000000001\n"
|
549
|
+
"1100000000110111100000000000001\n"
|
550
|
+
"110000000011011110000000000001\n"
|
551
|
+
"11000000001101111000000000001\n"
|
552
|
+
"1100000000110111100000000001\n"
|
553
|
+
"110000000011011110000000001\n"
|
554
|
+
"11000000001101111000000001\n"
|
555
|
+
"1100000000110111100000001\n"
|
556
|
+
"110000000011011110000001\n"
|
557
|
+
"11000000001101111000001\n"
|
558
|
+
"1100000000110111100001\n"
|
559
|
+
"110000000011011110001\n"
|
560
|
+
"11000000001101111001\n"
|
561
|
+
"1100000000110111101\n"
|
562
|
+
"110000000011011111\n"
|
563
|
+
"1100000000111\n"
|
564
|
+
"1100000001000000\n"
|
565
|
+
"11000000010000010\n"
|
566
|
+
"1100000001000001100\n"},
|
567
|
+
{.description = "Double exclusive upper bound",
|
568
|
+
.findSpecJSON = RAW_STRING({
|
569
|
+
"lowerBound" : {"$numberDouble" : "23.5"},
|
570
|
+
"lbIncluded" : true,
|
571
|
+
"upperBound" : {"$numberDouble" : "35.25"},
|
572
|
+
"ubIncluded" : false,
|
573
|
+
"indexMin" : {"$numberDouble" : "0"},
|
574
|
+
"indexMax" : {"$numberDouble" : "1000"}
|
575
|
+
}),
|
576
|
+
.expectedMinCover = "11000000001101111\n"
|
577
|
+
"1100000000111\n"
|
578
|
+
"1100000001000000\n"
|
579
|
+
"11000000010000010\n"
|
580
|
+
"1100000001000001100\n"},
|
581
|
+
{.description = "Double exclusive lower bound",
|
582
|
+
.findSpecJSON = RAW_STRING({
|
583
|
+
"lowerBound" : {"$numberDouble" : "23.5"},
|
584
|
+
"lbIncluded" : false,
|
585
|
+
"upperBound" : {"$numberDouble" : "35.25"},
|
586
|
+
"ubIncluded" : true,
|
587
|
+
"indexMin" : {"$numberDouble" : "0"},
|
588
|
+
"indexMax" : {"$numberDouble" : "1000"}
|
589
|
+
}),
|
590
|
+
.expectedMinCover = "1100000000110111100000000000000000000000000000000000000000000001\n"
|
591
|
+
"110000000011011110000000000000000000000000000000000000000000001\n"
|
592
|
+
"11000000001101111000000000000000000000000000000000000000000001\n"
|
593
|
+
"1100000000110111100000000000000000000000000000000000000000001\n"
|
594
|
+
"110000000011011110000000000000000000000000000000000000000001\n"
|
595
|
+
"11000000001101111000000000000000000000000000000000000000001\n"
|
596
|
+
"1100000000110111100000000000000000000000000000000000000001\n"
|
597
|
+
"110000000011011110000000000000000000000000000000000000001\n"
|
598
|
+
"11000000001101111000000000000000000000000000000000000001\n"
|
599
|
+
"1100000000110111100000000000000000000000000000000000001\n"
|
600
|
+
"110000000011011110000000000000000000000000000000000001\n"
|
601
|
+
"11000000001101111000000000000000000000000000000000001\n"
|
602
|
+
"1100000000110111100000000000000000000000000000000001\n"
|
603
|
+
"110000000011011110000000000000000000000000000000001\n"
|
604
|
+
"11000000001101111000000000000000000000000000000001\n"
|
605
|
+
"1100000000110111100000000000000000000000000000001\n"
|
606
|
+
"110000000011011110000000000000000000000000000001\n"
|
607
|
+
"11000000001101111000000000000000000000000000001\n"
|
608
|
+
"1100000000110111100000000000000000000000000001\n"
|
609
|
+
"110000000011011110000000000000000000000000001\n"
|
610
|
+
"11000000001101111000000000000000000000000001\n"
|
611
|
+
"1100000000110111100000000000000000000000001\n"
|
612
|
+
"110000000011011110000000000000000000000001\n"
|
613
|
+
"11000000001101111000000000000000000000001\n"
|
614
|
+
"1100000000110111100000000000000000000001\n"
|
615
|
+
"110000000011011110000000000000000000001\n"
|
616
|
+
"11000000001101111000000000000000000001\n"
|
617
|
+
"1100000000110111100000000000000000001\n"
|
618
|
+
"110000000011011110000000000000000001\n"
|
619
|
+
"11000000001101111000000000000000001\n"
|
620
|
+
"1100000000110111100000000000000001\n"
|
621
|
+
"110000000011011110000000000000001\n"
|
622
|
+
"11000000001101111000000000000001\n"
|
623
|
+
"1100000000110111100000000000001\n"
|
624
|
+
"110000000011011110000000000001\n"
|
625
|
+
"11000000001101111000000000001\n"
|
626
|
+
"1100000000110111100000000001\n"
|
627
|
+
"110000000011011110000000001\n"
|
628
|
+
"11000000001101111000000001\n"
|
629
|
+
"1100000000110111100000001\n"
|
630
|
+
"110000000011011110000001\n"
|
631
|
+
"11000000001101111000001\n"
|
632
|
+
"1100000000110111100001\n"
|
633
|
+
"110000000011011110001\n"
|
634
|
+
"11000000001101111001\n"
|
635
|
+
"1100000000110111101\n"
|
636
|
+
"110000000011011111\n"
|
637
|
+
"1100000000111\n"
|
638
|
+
"1100000001000000\n"
|
639
|
+
"11000000010000010\n"
|
640
|
+
"1100000001000001100\n"
|
641
|
+
"1100000001000001101000000000000000000000000000000000000000000000\n"},
|
642
|
+
};
|
643
|
+
|
644
|
+
for (size_t i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
|
645
|
+
bson_error_t error = {0};
|
646
|
+
testcase_t *test = tests + i;
|
647
|
+
mongocrypt_status_t *status = mongocrypt_status_new();
|
648
|
+
|
649
|
+
if (test->description) {
|
650
|
+
printf(" %zu: %s\n", i, test->description);
|
651
|
+
} else {
|
652
|
+
printf(" %zu\n", i);
|
653
|
+
}
|
654
|
+
|
655
|
+
bson_t *findSpecVal = bson_new_from_json((const uint8_t *)test->findSpecJSON, -1, &error);
|
656
|
+
if (!findSpecVal) {
|
657
|
+
TEST_ERROR("failed to parse JSON: %s", error.message);
|
658
|
+
}
|
659
|
+
|
660
|
+
bson_t *findSpecDoc = BCON_NEW("findSpec",
|
661
|
+
"{",
|
662
|
+
"edgesInfo",
|
663
|
+
BCON_DOCUMENT(findSpecVal),
|
664
|
+
"firstOperator", // Use a dummy firstOperator. It is not used for
|
665
|
+
// minCover.
|
666
|
+
BCON_INT32(1),
|
667
|
+
"payloadId", // Use a dummy payloadId. It is not used for minCover.
|
668
|
+
BCON_INT32(1234),
|
669
|
+
"}");
|
670
|
+
|
671
|
+
bson_iter_t findSpecIter;
|
672
|
+
ASSERT(bson_iter_init_find(&findSpecIter, findSpecDoc, "findSpec"));
|
673
|
+
|
674
|
+
mc_FLE2RangeFindSpec_t findSpec;
|
675
|
+
ASSERT_OK_STATUS(mc_FLE2RangeFindSpec_parse(&findSpec, &findSpecIter, status), status);
|
676
|
+
|
677
|
+
size_t sparsity = 1;
|
678
|
+
if (test->sparsity.set) {
|
679
|
+
sparsity = (size_t)test->sparsity.value;
|
680
|
+
}
|
681
|
+
|
682
|
+
mc_mincover_t *mc = mc_get_mincover_from_FLE2RangeFindSpec(&findSpec, sparsity, status);
|
683
|
+
|
684
|
+
if (test->expectedError) {
|
685
|
+
ASSERT(NULL == mc);
|
686
|
+
ASSERT_STATUS_CONTAINS(status, test->expectedError);
|
687
|
+
} else {
|
688
|
+
ASSERT_OK_STATUS(mc, status);
|
689
|
+
ASSERT_MINCOVER_EQ(mc, test->expectedMinCover);
|
690
|
+
}
|
691
|
+
mc_mincover_destroy(mc);
|
692
|
+
|
693
|
+
bson_destroy(findSpecDoc);
|
694
|
+
bson_destroy(findSpecVal);
|
695
|
+
mongocrypt_status_destroy(status);
|
696
|
+
}
|
730
697
|
}
|
731
698
|
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
{
|
736
|
-
INSTALL_TEST (test_mongocrypt_marking_parse);
|
737
|
-
INSTALL_TEST (test_mc_get_mincover_from_FLE2RangeFindSpec);
|
699
|
+
void _mongocrypt_tester_install_marking(_mongocrypt_tester_t *tester) {
|
700
|
+
INSTALL_TEST(test_mongocrypt_marking_parse);
|
701
|
+
INSTALL_TEST(test_mc_get_mincover_from_FLE2RangeFindSpec);
|
738
702
|
}
|