-
Notifications
You must be signed in to change notification settings - Fork 455
[CDRIVER-4540] Define a success test for CreateEncryptedCollection #1176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CDRIVER-4540] Define a success test for CreateEncryptedCollection #1176
Conversation
Creates an encrypted collection using the CEC API, then uses the generated key to encrypt a value, and then inserts that value into the new encrypted collection. Expects success.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor feedback; otherwise, LGTM.
mongoc_collection_drop (coll, &error); | ||
bool okay = | ||
error.code == 0 || strstr (error.message, "ns not found") != NULL; | ||
ASSERT_OR_PRINT (okay, error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this just be (void)mongoc_collection_drop(...);
as done in some other tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially, but any error other than "ns not found" will indicate that the remainder of the test will likely also fail.
bson_value_t plain; | ||
plain.value_type = BSON_TYPE_UTF8; | ||
plain.value.v_utf8.str = "123-45-6789"; | ||
plain.value.v_utf8.len = strlen (plain.value.v_utf8.str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plain.value.v_utf8.len = strlen (plain.value.v_utf8.str); | |
plain.value.v_utf8.len = (uint32_t) strlen (plain.value.v_utf8.str); |
Address -Wshorten-64-to-32
warnings.
visitEach (require (type (doc)), | ||
parse (require (key ("keyId"), | ||
require (type (binary)), | ||
do({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do({ | |
do ({ |
ClangFormat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a behavior change in Clang 16 :(
Co-authored-by: Kevin Albertson <[email protected]>
Co-authored-by: Kevin Albertson <[email protected]>
Creates an encrypted collection using the CEC API, then uses the generated key to encrypt a value, and then inserts that value into the new encrypted collection. Expects success.