Skip to content

CDRIVER-3422 add entity map and BSON parser #712

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

Merged
merged 6 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libmongoc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,10 @@ set (test-libmongoc-sources
${PROJECT_SOURCE_DIR}/tests/test-mongoc-write-commands.c
${PROJECT_SOURCE_DIR}/tests/test-mongoc-write-concern.c
${PROJECT_SOURCE_DIR}/tests/TestSuite.c
${PROJECT_SOURCE_DIR}/tests/unified/bson-parser.c
${PROJECT_SOURCE_DIR}/tests/unified/entity-map.c
${PROJECT_SOURCE_DIR}/tests/unified/runner.c
${PROJECT_SOURCE_DIR}/tests/unified/util.c
)

if (MONGOC_ENABLE_SSL)
Expand Down
16 changes: 9 additions & 7 deletions src/libmongoc/tests/json-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1459,10 +1459,11 @@ set_auto_encryption_opts (mongoc_client_t *client, bson_t *test)
test_framework_getenv ("MONGOC_TEST_AZURE_CLIENT_SECRET");

if (!azure_tenant_id || !azure_client_id || !azure_client_secret) {
fprintf (stderr, "Set MONGOC_TEST_AZURE_TENANT_ID, "
"MONGOC_TEST_AZURE_CLIENT_ID, and "
"MONGOC_TEST_AZURE_CLIENT_SECRET to enable CSFLE "
"tests.");
fprintf (stderr,
"Set MONGOC_TEST_AZURE_TENANT_ID, "
"MONGOC_TEST_AZURE_CLIENT_ID, and "
"MONGOC_TEST_AZURE_CLIENT_SECRET to enable CSFLE "
"tests.");
abort ();
}

Expand All @@ -1486,9 +1487,10 @@ set_auto_encryption_opts (mongoc_client_t *client, bson_t *test)
gcp_privatekey = test_framework_getenv ("MONGOC_TEST_GCP_PRIVATEKEY");

if (!gcp_email || !gcp_privatekey) {
fprintf (stderr, "Set MONGOC_TEST_GCP_EMAIL and "
"MONGOC_TEST_GCP_PRIVATEKEY to enable CSFLE "
"tests.");
fprintf (stderr,
"Set MONGOC_TEST_GCP_EMAIL and "
"MONGOC_TEST_GCP_PRIVATEKEY to enable CSFLE "
"tests.");
abort ();
}

Expand Down
8 changes: 5 additions & 3 deletions src/libmongoc/tests/test-conveniences.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ bson_lookup_value (const bson_t *b, const char *key, bson_value_t *value)
bson_value_copy (bson_iter_value (&iter), value);
}

bson_t*
bson_lookup_bson (const bson_t *b, const char *key) {
bson_t *
bson_lookup_bson (const bson_t *b, const char *key)
{
bson_iter_t iter;
bson_t tmp;

Expand Down Expand Up @@ -1958,7 +1959,8 @@ semver_cmp (semver_t *a, semver_t *b)
}

int
semver_cmp_str (semver_t *a, const char* str) {
semver_cmp_str (semver_t *a, const char *str)
{
semver_t b;

semver_parse (str, &b);
Expand Down
5 changes: 5 additions & 0 deletions src/libmongoc/tests/test-conveniences.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,9 @@ semver_to_string (semver_t *str);
for (bson_iter_init (&(iter_varname), (bson)); \
bson_iter_next (&(iter_varname));)

#define TEST_ERROR_DOMAIN 123456
#define TEST_ERROR_CODE 654321
#define test_set_error(error, ...) \
bson_set_error (error, TEST_ERROR_DOMAIN, TEST_ERROR_CODE, __VA_ARGS__)

#endif /* TEST_CONVENIENCES_H */
Loading