File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,22 @@ test_bulk (void)
367
367
}
368
368
369
369
370
+ static void
371
+ test_bulk_error (void )
372
+ {
373
+ bson_t reply = { 0 };
374
+ bson_error_t error ;
375
+ mongoc_bulk_operation_t * bulk ;
376
+
377
+ bulk = mongoc_bulk_operation_new (true);
378
+ assert (!mongoc_bulk_operation_execute (bulk , & reply , & error ));
379
+ ASSERT_CMPINT (error .domain , = = , MONGOC_ERROR_COMMAND );
380
+ ASSERT_CMPINT (error .code , = = , MONGOC_ERROR_COMMAND_INVALID_ARG );
381
+
382
+ /* reply was initialized */
383
+ ASSERT_CMPUINT32 (reply .len , = = , (uint32_t ) 5 );
384
+ }
385
+
370
386
static void
371
387
test_insert (bool ordered )
372
388
{
@@ -3082,6 +3098,8 @@ test_bulk_install (TestSuite *suite)
3082
3098
3083
3099
TestSuite_AddLive (suite , "/BulkOperation/basic" ,
3084
3100
test_bulk );
3101
+ TestSuite_Add (suite , "/BulkOperation/error" ,
3102
+ test_bulk_error );
3085
3103
TestSuite_AddLive (suite , "/BulkOperation/insert_ordered" ,
3086
3104
test_insert_ordered );
3087
3105
TestSuite_AddLive (suite , "/BulkOperation/insert_unordered" ,
You can’t perform that action at this time.
0 commit comments