Skip to content

Commit 68b747e

Browse files
committed
CDRIVER-952 better output from large-inserts test
1 parent 66066b7 commit 68b747e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test-bulk.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,10 +1970,18 @@ test_large_inserts_ordered ()
19701970
r = (bool)mongoc_bulk_operation_execute (bulk, &reply, &error);
19711971
assert (!r);
19721972
/* TODO: CDRIVER-662, should always be MONGOC_ERROR_BSON */
1973-
assert (
1973+
if (!(
19741974
(error.domain == MONGOC_ERROR_COMMAND) ||
19751975
(error.domain == MONGOC_ERROR_BSON &&
1976-
error.code == MONGOC_ERROR_BSON_INVALID));
1976+
error.code == MONGOC_ERROR_BSON_INVALID))) {
1977+
fprintf (stderr, "Expected error domain %d, or domain %d with code %d.\n"
1978+
"Got domain %d, code %d, message: \"%s\"\n",
1979+
MONGOC_ERROR_COMMAND, MONGOC_ERROR_BSON,
1980+
MONGOC_ERROR_BSON_INVALID,
1981+
error.domain, error.code, error.message);
1982+
fflush (stderr);
1983+
abort ();
1984+
}
19771985

19781986
ASSERT_MATCH (&reply, "{'nInserted': 1,"
19791987
" 'nMatched': 0,"

0 commit comments

Comments
 (0)