libmongocrypt-helper 1.7.4.0.1002 → 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/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.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
@@ -16,594 +16,530 @@
|
|
16
16
|
|
17
17
|
#include "test-mongocrypt.h"
|
18
18
|
|
19
|
+
#include "mc-array-private.h"
|
19
20
|
#include "mc-check-conversions-private.h"
|
20
21
|
#include "mc-optional-private.h"
|
21
22
|
#include "mc-range-mincover-private.h"
|
22
|
-
#include "mc-array-private.h"
|
23
|
-
|
24
23
|
|
25
24
|
enum {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
/// Why this number? The Decimal128 tests generate thousands of test strings,
|
26
|
+
/// but we can't set this arbitrarily high, since we'll bump up on stack
|
27
|
+
/// overflow on MSVC. This is large enough to capture all strings in all
|
28
|
+
/// Decimal128 tests without overflowing the stack.
|
29
|
+
MAX_MINCOVER_STRINGS = 4500
|
31
30
|
};
|
32
31
|
|
33
32
|
typedef struct {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
33
|
+
int32_t lowerBound;
|
34
|
+
bool includeLowerBound;
|
35
|
+
int32_t upperBound;
|
36
|
+
bool includeUpperBound;
|
37
|
+
mc_optional_int32_t min;
|
38
|
+
mc_optional_int32_t max;
|
39
|
+
size_t sparsity;
|
40
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
41
|
+
const char *expectError;
|
43
42
|
} Int32Test;
|
44
43
|
|
45
44
|
typedef struct {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
45
|
+
int64_t lowerBound;
|
46
|
+
bool includeLowerBound;
|
47
|
+
int64_t upperBound;
|
48
|
+
bool includeUpperBound;
|
49
|
+
mc_optional_int64_t min;
|
50
|
+
mc_optional_int64_t max;
|
51
|
+
size_t sparsity;
|
52
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
53
|
+
const char *expectError;
|
55
54
|
} Int64Test;
|
56
55
|
|
57
56
|
typedef struct {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
double lowerBound;
|
58
|
+
bool includeLowerBound;
|
59
|
+
double upperBound;
|
60
|
+
bool includeUpperBound;
|
61
|
+
size_t sparsity;
|
62
|
+
mc_optional_double_t min;
|
63
|
+
mc_optional_double_t max;
|
64
|
+
mc_optional_uint32_t precision;
|
65
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
66
|
+
const char *expectError;
|
68
67
|
} DoubleTest;
|
69
68
|
|
70
69
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
71
70
|
typedef struct {
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
71
|
+
mc_dec128 lowerBound;
|
72
|
+
bool includeLowerBound;
|
73
|
+
mc_dec128 upperBound;
|
74
|
+
bool includeUpperBound;
|
75
|
+
size_t sparsity;
|
76
|
+
mc_optional_dec128_t min;
|
77
|
+
mc_optional_dec128_t max;
|
78
|
+
mc_optional_uint32_t precision;
|
79
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
80
|
+
const char *expectError;
|
82
81
|
} Decimal128Test;
|
83
82
|
#endif
|
84
83
|
|
85
84
|
typedef struct _test_getMincover_args {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
const char *const *(*expectMincoverStrings) (void *tests, size_t idx);
|
91
|
-
void (*dump) (void *tests, size_t idx, mc_mincover_t *got);
|
85
|
+
mc_mincover_t *(*getMincover)(void *tests, size_t idx, mongocrypt_status_t *status);
|
86
|
+
const char *(*expectError)(void *tests, size_t idx);
|
87
|
+
const char *const *(*expectMincoverStrings)(void *tests, size_t idx);
|
88
|
+
void (*dump)(void *tests, size_t idx, mc_mincover_t *got);
|
92
89
|
} _test_getMincover_args;
|
93
90
|
|
94
|
-
static mc_mincover_t *
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
.max = test->max,
|
108
|
-
.sparsity = test->sparsity},
|
109
|
-
status);
|
91
|
+
static mc_mincover_t *_test_getMincover32(void *tests, size_t idx, mongocrypt_status_t *status) {
|
92
|
+
BSON_ASSERT_PARAM(tests);
|
93
|
+
|
94
|
+
Int32Test *test = (Int32Test *)tests + idx;
|
95
|
+
|
96
|
+
return mc_getMincoverInt32((mc_getMincoverInt32_args_t){.lowerBound = test->lowerBound,
|
97
|
+
.includeLowerBound = test->includeLowerBound,
|
98
|
+
.upperBound = test->upperBound,
|
99
|
+
.includeUpperBound = test->includeUpperBound,
|
100
|
+
.min = test->min,
|
101
|
+
.max = test->max,
|
102
|
+
.sparsity = test->sparsity},
|
103
|
+
status);
|
110
104
|
}
|
111
105
|
|
112
|
-
static mc_mincover_t *
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
.max = test->max,
|
126
|
-
.sparsity = test->sparsity},
|
127
|
-
status);
|
106
|
+
static mc_mincover_t *_test_getMincover64(void *tests, size_t idx, mongocrypt_status_t *status) {
|
107
|
+
BSON_ASSERT_PARAM(tests);
|
108
|
+
|
109
|
+
Int64Test *const test = (Int64Test *)tests + idx;
|
110
|
+
|
111
|
+
return mc_getMincoverInt64((mc_getMincoverInt64_args_t){.lowerBound = test->lowerBound,
|
112
|
+
.includeLowerBound = test->includeLowerBound,
|
113
|
+
.upperBound = test->upperBound,
|
114
|
+
.includeUpperBound = test->includeUpperBound,
|
115
|
+
.min = test->min,
|
116
|
+
.max = test->max,
|
117
|
+
.sparsity = test->sparsity},
|
118
|
+
status);
|
128
119
|
}
|
129
120
|
|
130
|
-
static mc_mincover_t *
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
.sparsity = test->sparsity,
|
146
|
-
.min = test->precision.set ? test->min : (mc_optional_double_t){0},
|
147
|
-
.max = test->precision.set ? test->max : (mc_optional_double_t){0},
|
148
|
-
.precision = test->precision},
|
149
|
-
status);
|
121
|
+
static mc_mincover_t *_test_getMincoverDouble_helper(void *tests, size_t idx, mongocrypt_status_t *status) {
|
122
|
+
BSON_ASSERT_PARAM(tests);
|
123
|
+
|
124
|
+
DoubleTest *const test = (DoubleTest *)tests + idx;
|
125
|
+
|
126
|
+
return mc_getMincoverDouble(
|
127
|
+
(mc_getMincoverDouble_args_t){.lowerBound = test->lowerBound,
|
128
|
+
.includeLowerBound = test->includeLowerBound,
|
129
|
+
.upperBound = test->upperBound,
|
130
|
+
.includeUpperBound = test->includeUpperBound,
|
131
|
+
.sparsity = test->sparsity,
|
132
|
+
.min = test->precision.set ? test->min : (mc_optional_double_t){0},
|
133
|
+
.max = test->precision.set ? test->max : (mc_optional_double_t){0},
|
134
|
+
.precision = test->precision},
|
135
|
+
status);
|
150
136
|
}
|
151
137
|
|
152
138
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
153
|
-
static mc_mincover_t *
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
.sparsity = test->sparsity,
|
169
|
-
.min = test->precision.set ? test->min : (mc_optional_dec128_t){0},
|
170
|
-
.max = test->precision.set ? test->max : (mc_optional_dec128_t){0},
|
171
|
-
.precision = test->precision},
|
172
|
-
status);
|
139
|
+
static mc_mincover_t *_test_getMincoverDecimal128_helper(void *tests, size_t idx, mongocrypt_status_t *status) {
|
140
|
+
BSON_ASSERT_PARAM(tests);
|
141
|
+
|
142
|
+
Decimal128Test *const test = (Decimal128Test *)tests + idx;
|
143
|
+
|
144
|
+
return mc_getMincoverDecimal128(
|
145
|
+
(mc_getMincoverDecimal128_args_t){.lowerBound = test->lowerBound,
|
146
|
+
.includeLowerBound = test->includeLowerBound,
|
147
|
+
.upperBound = test->upperBound,
|
148
|
+
.includeUpperBound = test->includeUpperBound,
|
149
|
+
.sparsity = test->sparsity,
|
150
|
+
.min = test->precision.set ? test->min : (mc_optional_dec128_t){0},
|
151
|
+
.max = test->precision.set ? test->max : (mc_optional_dec128_t){0},
|
152
|
+
.precision = test->precision},
|
153
|
+
status);
|
173
154
|
}
|
174
155
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
175
156
|
|
176
|
-
static const char *
|
177
|
-
|
178
|
-
|
179
|
-
BSON_ASSERT_PARAM (tests);
|
180
|
-
return ((Int32Test *) tests + idx)->expectError;
|
157
|
+
static const char *_test_expectError32(void *tests, size_t idx) {
|
158
|
+
BSON_ASSERT_PARAM(tests);
|
159
|
+
return ((Int32Test *)tests + idx)->expectError;
|
181
160
|
}
|
182
161
|
|
183
|
-
static const char *
|
184
|
-
|
185
|
-
|
186
|
-
BSON_ASSERT_PARAM (tests);
|
187
|
-
return ((Int64Test *) tests + idx)->expectError;
|
162
|
+
static const char *_test_expectError64(void *tests, size_t idx) {
|
163
|
+
BSON_ASSERT_PARAM(tests);
|
164
|
+
return ((Int64Test *)tests + idx)->expectError;
|
188
165
|
}
|
189
166
|
|
190
|
-
static const char *
|
191
|
-
|
192
|
-
|
193
|
-
BSON_ASSERT_PARAM (tests);
|
194
|
-
return ((DoubleTest *) tests + idx)->expectError;
|
167
|
+
static const char *_test_expectErrorDouble(void *tests, size_t idx) {
|
168
|
+
BSON_ASSERT_PARAM(tests);
|
169
|
+
return ((DoubleTest *)tests + idx)->expectError;
|
195
170
|
}
|
196
171
|
|
197
172
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
198
|
-
static const char *
|
199
|
-
|
200
|
-
|
201
|
-
BSON_ASSERT_PARAM (tests);
|
202
|
-
return ((Decimal128Test *) tests + idx)->expectError;
|
173
|
+
static const char *_test_expectErrorDecimal128(void *tests, size_t idx) {
|
174
|
+
BSON_ASSERT_PARAM(tests);
|
175
|
+
return ((Decimal128Test *)tests + idx)->expectError;
|
203
176
|
}
|
204
177
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
205
178
|
|
206
|
-
static const char *const *
|
207
|
-
|
208
|
-
|
209
|
-
BSON_ASSERT_PARAM (tests);
|
210
|
-
return ((Int32Test *) tests + idx)->expectMincoverStrings;
|
179
|
+
static const char *const *_test_expectMincover32(void *tests, size_t idx) {
|
180
|
+
BSON_ASSERT_PARAM(tests);
|
181
|
+
return ((Int32Test *)tests + idx)->expectMincoverStrings;
|
211
182
|
}
|
212
183
|
|
213
|
-
static const char *const *
|
214
|
-
|
215
|
-
|
216
|
-
BSON_ASSERT_PARAM (tests);
|
217
|
-
return ((Int64Test *) tests + idx)->expectMincoverStrings;
|
184
|
+
static const char *const *_test_expectMincover64(void *tests, size_t idx) {
|
185
|
+
BSON_ASSERT_PARAM(tests);
|
186
|
+
return ((Int64Test *)tests + idx)->expectMincoverStrings;
|
218
187
|
}
|
219
188
|
|
220
|
-
static const char *const *
|
221
|
-
|
222
|
-
|
223
|
-
BSON_ASSERT_PARAM (tests);
|
224
|
-
return ((DoubleTest *) tests + idx)->expectMincoverStrings;
|
189
|
+
static const char *const *_test_expectMincoverDouble(void *tests, size_t idx) {
|
190
|
+
BSON_ASSERT_PARAM(tests);
|
191
|
+
return ((DoubleTest *)tests + idx)->expectMincoverStrings;
|
225
192
|
}
|
226
193
|
|
227
194
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
228
|
-
static const char *const *
|
229
|
-
|
230
|
-
|
231
|
-
BSON_ASSERT_PARAM (tests);
|
232
|
-
return ((Decimal128Test *) tests + idx)->expectMincoverStrings;
|
195
|
+
static const char *const *_test_expectMincoverDecimal128(void *tests, size_t idx) {
|
196
|
+
BSON_ASSERT_PARAM(tests);
|
197
|
+
return ((Decimal128Test *)tests + idx)->expectMincoverStrings;
|
233
198
|
}
|
234
199
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
235
200
|
|
236
|
-
static void
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
242
|
-
fprintf (stderr,
|
201
|
+
static void _test_dump_32(void *tests, size_t idx, mc_mincover_t *got) {
|
202
|
+
BSON_ASSERT_PARAM(tests);
|
203
|
+
Int32Test *const test = (Int32Test *)tests + idx;
|
204
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
205
|
+
fprintf(stderr,
|
243
206
|
"testcase: lowerBound=%" PRId32 " (%s) upperBound=%" PRId32 " (%s)",
|
244
207
|
test->lowerBound,
|
245
208
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
246
209
|
test->upperBound,
|
247
210
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
211
|
+
if (test->min.set) {
|
212
|
+
fprintf(stderr, " min=%" PRId32, test->min.value);
|
213
|
+
}
|
214
|
+
if (test->max.set) {
|
215
|
+
fprintf(stderr, " max=%" PRId32, test->max.value);
|
216
|
+
}
|
217
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
218
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
219
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
220
|
+
fprintf(stderr, " %s\n", *p);
|
221
|
+
}
|
222
|
+
fprintf(stderr, "mincover expected ... end\n");
|
223
|
+
fprintf(stderr, "mincover got ... begin\n");
|
224
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
225
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
226
|
+
}
|
227
|
+
fprintf(stderr, "mincover got ... end\n");
|
265
228
|
}
|
266
229
|
|
267
|
-
static void
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
273
|
-
fprintf (stderr,
|
230
|
+
static void _test_dump_64(void *tests, size_t idx, mc_mincover_t *got) {
|
231
|
+
BSON_ASSERT_PARAM(tests);
|
232
|
+
Int64Test *const test = (Int64Test *)tests + idx;
|
233
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
234
|
+
fprintf(stderr,
|
274
235
|
"testcase: lowerBound=%" PRId64 " (%s) upperBound=%" PRId64 " (%s)",
|
275
236
|
test->lowerBound,
|
276
237
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
277
238
|
test->upperBound,
|
278
239
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
240
|
+
if (test->min.set) {
|
241
|
+
fprintf(stderr, " min=%" PRId64, test->min.value);
|
242
|
+
}
|
243
|
+
if (test->max.set) {
|
244
|
+
fprintf(stderr, " max=%" PRId64, test->max.value);
|
245
|
+
}
|
246
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
247
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
248
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
249
|
+
fprintf(stderr, " %s\n", *p);
|
250
|
+
}
|
251
|
+
fprintf(stderr, "mincover expected ... end\n");
|
252
|
+
fprintf(stderr, "mincover got ... begin\n");
|
253
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
254
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
255
|
+
}
|
256
|
+
fprintf(stderr, "mincover got ... end\n");
|
296
257
|
}
|
297
258
|
|
298
|
-
static void
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
304
|
-
fprintf (stderr,
|
259
|
+
static void _test_dump_Double(void *tests, size_t idx, mc_mincover_t *got) {
|
260
|
+
BSON_ASSERT_PARAM(tests);
|
261
|
+
DoubleTest *const test = (DoubleTest *)tests + idx;
|
262
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
263
|
+
fprintf(stderr,
|
305
264
|
"testcase: lowerBound=%f (%s) upperBound=%f (%s)",
|
306
265
|
test->lowerBound,
|
307
266
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
308
267
|
test->upperBound,
|
309
268
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
269
|
+
if (test->min.set) {
|
270
|
+
fprintf(stderr, " min=%f", test->min.value);
|
271
|
+
}
|
272
|
+
if (test->max.set) {
|
273
|
+
fprintf(stderr, " max=%f", test->max.value);
|
274
|
+
}
|
275
|
+
if (test->precision.set) {
|
276
|
+
fprintf(stderr, " precision=%" PRIu32, test->precision.value);
|
277
|
+
}
|
278
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
279
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
280
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
281
|
+
fprintf(stderr, " %s\n", *p);
|
282
|
+
}
|
283
|
+
fprintf(stderr, "mincover expected ... end\n");
|
284
|
+
fprintf(stderr, "mincover got ... begin\n");
|
285
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
286
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
287
|
+
}
|
288
|
+
fprintf(stderr, "mincover got ... end\n");
|
330
289
|
}
|
331
290
|
|
332
291
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
333
|
-
static void
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
339
|
-
fprintf (stderr,
|
292
|
+
static void _test_dump_Decimal128(void *tests, size_t idx, mc_mincover_t *got) {
|
293
|
+
BSON_ASSERT_PARAM(tests);
|
294
|
+
Decimal128Test *const test = (Decimal128Test *)tests + idx;
|
295
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
296
|
+
fprintf(stderr,
|
340
297
|
"testcase: lowerBound=%s (%s) upperBound=%s (%s)",
|
341
|
-
mc_dec128_to_string
|
298
|
+
mc_dec128_to_string(test->lowerBound).str,
|
342
299
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
343
|
-
mc_dec128_to_string
|
300
|
+
mc_dec128_to_string(test->upperBound).str,
|
344
301
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
302
|
+
if (test->min.set) {
|
303
|
+
fprintf(stderr, " min=%s", mc_dec128_to_string(test->min.value).str);
|
304
|
+
}
|
305
|
+
if (test->max.set) {
|
306
|
+
fprintf(stderr, " max=%s", mc_dec128_to_string(test->max.value).str);
|
307
|
+
}
|
308
|
+
if (test->precision.set) {
|
309
|
+
fprintf(stderr, " precision=%" PRIu32, test->precision.value);
|
310
|
+
}
|
311
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
312
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
313
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
314
|
+
fprintf(stderr, " %s\n", *p);
|
315
|
+
}
|
316
|
+
fprintf(stderr, "mincover expected ... end\n");
|
317
|
+
fprintf(stderr, "mincover got ... begin\n");
|
318
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
319
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
320
|
+
}
|
321
|
+
fprintf(stderr, "mincover got ... end\n");
|
365
322
|
}
|
366
323
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
367
324
|
|
368
|
-
static void
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
if (expectError) {
|
380
|
-
ASSERT_OR_PRINT_MSG (NULL == got, "expected error, got success");
|
381
|
-
ASSERT_STATUS_CONTAINS (status, expectError);
|
382
|
-
mongocrypt_status_destroy (status);
|
383
|
-
continue;
|
384
|
-
}
|
385
|
-
ASSERT_OK_STATUS (got != NULL, status);
|
386
|
-
|
387
|
-
size_t numGot = mc_mincover_len (got);
|
388
|
-
const char *const *expectStrings = args.expectMincoverStrings (tests, i);
|
389
|
-
|
390
|
-
const char *const *exp_iter = expectStrings;
|
391
|
-
size_t nthItem = 0;
|
392
|
-
for (; *exp_iter; ++nthItem, ++exp_iter) {
|
393
|
-
if (nthItem > numGot) {
|
394
|
-
// List length mismatch. Keep scanning, though. We'll use the
|
395
|
-
// numbers later
|
396
|
-
continue;
|
397
|
-
}
|
398
|
-
const char *gotItem = mc_mincover_get (got, nthItem);
|
399
|
-
const char *expectItem = *exp_iter;
|
400
|
-
|
401
|
-
if (0 == strcmp (gotItem, expectItem)) {
|
402
|
-
// This one matches, Keep going.
|
325
|
+
static void _test_getMincover_impl(void *tests, size_t num_tests, _test_getMincover_args args) {
|
326
|
+
BSON_ASSERT_PARAM(tests);
|
327
|
+
|
328
|
+
for (size_t i = 0; i < num_tests; i++) {
|
329
|
+
mongocrypt_status_t *const status = mongocrypt_status_new();
|
330
|
+
mc_mincover_t *got = args.getMincover(tests, i, status);
|
331
|
+
const char *expectError = args.expectError(tests, i);
|
332
|
+
if (expectError) {
|
333
|
+
ASSERT_OR_PRINT_MSG(NULL == got, "expected error, got success");
|
334
|
+
ASSERT_STATUS_CONTAINS(status, expectError);
|
335
|
+
mongocrypt_status_destroy(status);
|
403
336
|
continue;
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
337
|
+
}
|
338
|
+
ASSERT_OK_STATUS(got != NULL, status);
|
339
|
+
|
340
|
+
size_t numGot = mc_mincover_len(got);
|
341
|
+
const char *const *expectStrings = args.expectMincoverStrings(tests, i);
|
342
|
+
|
343
|
+
const char *const *exp_iter = expectStrings;
|
344
|
+
size_t nthItem = 0;
|
345
|
+
for (; *exp_iter; ++nthItem, ++exp_iter) {
|
346
|
+
if (nthItem > numGot) {
|
347
|
+
// List length mismatch. Keep scanning, though. We'll use the
|
348
|
+
// numbers later
|
349
|
+
continue;
|
350
|
+
}
|
351
|
+
const char *gotItem = mc_mincover_get(got, nthItem);
|
352
|
+
const char *expectItem = *exp_iter;
|
353
|
+
|
354
|
+
if (0 == strcmp(gotItem, expectItem)) {
|
355
|
+
// This one matches, Keep going.
|
356
|
+
continue;
|
357
|
+
}
|
358
|
+
args.dump(tests, nthItem, got);
|
359
|
+
TEST_ERROR("test %zu: mincover mismatch at index %zu:\n"
|
360
|
+
" Got: %s\n"
|
361
|
+
" Expected: %s\n",
|
362
|
+
i,
|
363
|
+
nthItem,
|
364
|
+
gotItem,
|
365
|
+
expectItem);
|
366
|
+
}
|
367
|
+
|
368
|
+
if (nthItem != numGot) {
|
369
|
+
args.dump(tests, i, got);
|
370
|
+
TEST_ERROR("test %zu: Got the wrong number of mincover items. Expected %zu "
|
371
|
+
"items, but got %zu\n",
|
372
|
+
i,
|
373
|
+
nthItem,
|
374
|
+
numGot);
|
375
|
+
}
|
376
|
+
|
377
|
+
mc_mincover_destroy(got);
|
378
|
+
mongocrypt_status_destroy(status);
|
379
|
+
}
|
428
380
|
}
|
429
381
|
|
430
|
-
static void
|
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
|
-
.sparsity = 1,
|
481
|
-
.expectError = "less than or equal to the maximum value"},
|
382
|
+
static void _test_getMincoverInt32(_mongocrypt_tester_t *tester) {
|
383
|
+
static Int32Test tests[] = {
|
384
|
+
{.lowerBound = 1,
|
385
|
+
.includeLowerBound = false,
|
386
|
+
.upperBound = 3,
|
387
|
+
.includeUpperBound = true,
|
388
|
+
.min = OPT_I32_C(0),
|
389
|
+
.max = OPT_I32_C(7),
|
390
|
+
.sparsity = 1,
|
391
|
+
.expectMincoverStrings = {"01"}},
|
392
|
+
{.lowerBound = 1,
|
393
|
+
.includeLowerBound = true,
|
394
|
+
.upperBound = 3,
|
395
|
+
.includeUpperBound = false,
|
396
|
+
.min = OPT_I32_C(0),
|
397
|
+
.max = OPT_I32_C(7),
|
398
|
+
.sparsity = 1,
|
399
|
+
.expectMincoverStrings = {"001", "010"}},
|
400
|
+
{.lowerBound = 1,
|
401
|
+
.includeLowerBound = true,
|
402
|
+
.upperBound = 3,
|
403
|
+
.includeUpperBound = true,
|
404
|
+
.min = OPT_I32_C(0),
|
405
|
+
.max = OPT_I32_C(7),
|
406
|
+
.sparsity = 1,
|
407
|
+
.expectMincoverStrings = {"001", "01"}},
|
408
|
+
{.lowerBound = 3,
|
409
|
+
.includeLowerBound = true,
|
410
|
+
.upperBound = 3,
|
411
|
+
.includeUpperBound = true,
|
412
|
+
.min = OPT_I32_C(0),
|
413
|
+
.max = OPT_I32_C(7),
|
414
|
+
.sparsity = 1,
|
415
|
+
.expectMincoverStrings = {"011"}},
|
416
|
+
{.lowerBound = 4,
|
417
|
+
.includeLowerBound = true,
|
418
|
+
.upperBound = 3,
|
419
|
+
.includeUpperBound = true,
|
420
|
+
.min = OPT_I32_C(0),
|
421
|
+
.max = OPT_I32_C(7),
|
422
|
+
.sparsity = 1,
|
423
|
+
.expectError = "must be less than or equal to"},
|
424
|
+
{.lowerBound = 1,
|
425
|
+
.includeLowerBound = true,
|
426
|
+
.upperBound = 8,
|
427
|
+
.includeUpperBound = true,
|
428
|
+
.min = OPT_I32_C(0),
|
429
|
+
.max = OPT_I32_C(7),
|
430
|
+
.sparsity = 1,
|
431
|
+
.expectError = "less than or equal to the maximum value"},
|
482
432
|
|
483
433
|
#include "./data/range-min-cover/mincover_int32.cstruct"
|
484
434
|
|
485
|
-
|
435
|
+
};
|
486
436
|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
.dump = _test_dump_32});
|
437
|
+
_test_getMincover_impl(tests,
|
438
|
+
sizeof(tests) / sizeof(tests[0]),
|
439
|
+
(_test_getMincover_args){.getMincover = _test_getMincover32,
|
440
|
+
.expectMincoverStrings = _test_expectMincover32,
|
441
|
+
.expectError = _test_expectError32,
|
442
|
+
.dump = _test_dump_32});
|
494
443
|
}
|
495
444
|
|
496
|
-
static void
|
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
|
-
.sparsity = 1,
|
547
|
-
.expectError = "less than or equal to the maximum value"},
|
445
|
+
static void _test_getMincoverInt64(_mongocrypt_tester_t *tester) {
|
446
|
+
static Int64Test tests[] = {
|
447
|
+
{.lowerBound = 1,
|
448
|
+
.includeLowerBound = false,
|
449
|
+
.upperBound = 3,
|
450
|
+
.includeUpperBound = true,
|
451
|
+
.min = OPT_I64_C(0),
|
452
|
+
.max = OPT_I64_C(7),
|
453
|
+
.sparsity = 1,
|
454
|
+
.expectMincoverStrings = {"01"}},
|
455
|
+
{.lowerBound = 1,
|
456
|
+
.includeLowerBound = true,
|
457
|
+
.upperBound = 3,
|
458
|
+
.includeUpperBound = false,
|
459
|
+
.min = OPT_I64_C(0),
|
460
|
+
.max = OPT_I64_C(7),
|
461
|
+
.sparsity = 1,
|
462
|
+
.expectMincoverStrings = {"001", "010"}},
|
463
|
+
{.lowerBound = 1,
|
464
|
+
.includeLowerBound = true,
|
465
|
+
.upperBound = 3,
|
466
|
+
.includeUpperBound = true,
|
467
|
+
.min = OPT_I64_C(0),
|
468
|
+
.max = OPT_I64_C(7),
|
469
|
+
.sparsity = 1,
|
470
|
+
.expectMincoverStrings = {"001", "01"}},
|
471
|
+
{.lowerBound = 3,
|
472
|
+
.includeLowerBound = true,
|
473
|
+
.upperBound = 3,
|
474
|
+
.includeUpperBound = true,
|
475
|
+
.min = OPT_I64_C(0),
|
476
|
+
.max = OPT_I64_C(7),
|
477
|
+
.sparsity = 1,
|
478
|
+
.expectMincoverStrings = {"011"}},
|
479
|
+
{.lowerBound = 4,
|
480
|
+
.includeLowerBound = true,
|
481
|
+
.upperBound = 3,
|
482
|
+
.includeUpperBound = true,
|
483
|
+
.min = OPT_I64_C(0),
|
484
|
+
.max = OPT_I64_C(7),
|
485
|
+
.sparsity = 1,
|
486
|
+
.expectError = "must be less than or equal to"},
|
487
|
+
{.lowerBound = 1,
|
488
|
+
.includeLowerBound = true,
|
489
|
+
.upperBound = 8,
|
490
|
+
.includeUpperBound = true,
|
491
|
+
.min = OPT_I64_C(0),
|
492
|
+
.max = OPT_I64_C(7),
|
493
|
+
.sparsity = 1,
|
494
|
+
.expectError = "less than or equal to the maximum value"},
|
548
495
|
|
549
496
|
#include "./data/range-min-cover/mincover_int64.cstruct"
|
550
497
|
|
551
|
-
|
498
|
+
};
|
552
499
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
.dump = _test_dump_64});
|
500
|
+
_test_getMincover_impl(tests,
|
501
|
+
sizeof(tests) / sizeof(tests[0]),
|
502
|
+
(_test_getMincover_args){.getMincover = _test_getMincover64,
|
503
|
+
.expectMincoverStrings = _test_expectMincover64,
|
504
|
+
.expectError = _test_expectError64,
|
505
|
+
.dump = _test_dump_64});
|
560
506
|
}
|
561
507
|
|
562
|
-
static void
|
563
|
-
|
564
|
-
{
|
565
|
-
static DoubleTest tests[] = {
|
508
|
+
static void _test_getMincoverDouble(_mongocrypt_tester_t *tester) {
|
509
|
+
static DoubleTest tests[] = {
|
566
510
|
#include "./data/range-min-cover/mincover_double.cstruct"
|
567
511
|
#include "./data/range-min-cover/mincover_double_precision.cstruct"
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
.expectError = _test_expectErrorDouble,
|
577
|
-
.dump = _test_dump_Double});
|
512
|
+
};
|
513
|
+
|
514
|
+
_test_getMincover_impl(tests,
|
515
|
+
sizeof(tests) / sizeof(tests[0]),
|
516
|
+
(_test_getMincover_args){.getMincover = _test_getMincoverDouble_helper,
|
517
|
+
.expectMincoverStrings = _test_expectMincoverDouble,
|
518
|
+
.expectError = _test_expectErrorDouble,
|
519
|
+
.dump = _test_dump_Double});
|
578
520
|
}
|
579
521
|
|
580
522
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
581
|
-
static void
|
582
|
-
|
583
|
-
{
|
584
|
-
Decimal128Test tests[] = {
|
523
|
+
static void _test_getMincoverDecimal128(_mongocrypt_tester_t *tester) {
|
524
|
+
Decimal128Test tests[] = {
|
585
525
|
#include "./data/range-min-cover/mincover_decimal128.cstruct"
|
586
526
|
#include "./data/range-min-cover/mincover_decimal128_precision.cstruct"
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
.expectError = _test_expectErrorDecimal128,
|
596
|
-
.dump = _test_dump_Decimal128});
|
527
|
+
};
|
528
|
+
|
529
|
+
_test_getMincover_impl(tests,
|
530
|
+
sizeof(tests) / sizeof(tests[0]),
|
531
|
+
(_test_getMincover_args){.getMincover = _test_getMincoverDecimal128_helper,
|
532
|
+
.expectMincoverStrings = _test_expectMincoverDecimal128,
|
533
|
+
.expectError = _test_expectErrorDecimal128,
|
534
|
+
.dump = _test_dump_Decimal128});
|
597
535
|
}
|
598
536
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
599
537
|
|
600
|
-
void
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
INSTALL_TEST (_test_getMincoverInt64);
|
605
|
-
INSTALL_TEST (_test_getMincoverDouble);
|
538
|
+
void _mongocrypt_tester_install_range_mincover(_mongocrypt_tester_t *tester) {
|
539
|
+
INSTALL_TEST(_test_getMincoverInt32);
|
540
|
+
INSTALL_TEST(_test_getMincoverInt64);
|
541
|
+
INSTALL_TEST(_test_getMincoverDouble);
|
606
542
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
607
|
-
|
543
|
+
INSTALL_TEST(_test_getMincoverDecimal128);
|
608
544
|
#endif
|
609
545
|
}
|