@@ -36,6 +36,7 @@ TEST_CASE("a bulk_write will setup a mongoc bulk operation", "[bulk_write]") {
36
36
instance::current ();
37
37
mongocxx::client client{mongocxx::uri{}};
38
38
mongocxx::collection coll = client[" db" ][" coll" ];
39
+ CHECK_NOTHROW (coll.drop ());
39
40
auto construct = libmongoc::collection_create_bulk_operation_with_opts.create_instance ();
40
41
bool construct_called = false ;
41
42
bool ordered_value = false ;
@@ -75,6 +76,7 @@ TEST_CASE("destruction of a bulk_write will destroy mongoc operation", "[bulk_wr
75
76
instance::current ();
76
77
mongocxx::client client{mongocxx::uri{}};
77
78
mongocxx::collection coll = client[" db" ][" coll" ];
79
+ CHECK_NOTHROW (coll.drop ());
78
80
auto destruct = libmongoc::bulk_operation_destroy.create_instance ();
79
81
bool destruct_called = false ;
80
82
@@ -184,7 +186,9 @@ class delete_functor {
184
186
TEST_CASE (" passing write operations to append calls corresponding C function" , " [bulk_write]" ) {
185
187
instance::current ();
186
188
mongocxx::client client{mongocxx::uri{}};
187
- auto bw = client[" db" ][" coll" ].create_bulk_write ();
189
+ mongocxx::collection coll = client[" db" ][" coll" ];
190
+ CHECK_NOTHROW (coll.drop ());
191
+ auto bw = coll.create_bulk_write ();
188
192
bsoncxx::builder::basic::document filter_builder, doc_builder, update_doc_builder, collation_builder;
189
193
filter_builder.append (kvp (" _id" , 1 ));
190
194
doc_builder.append (kvp (" _id" , 2 ));
@@ -358,7 +362,9 @@ TEST_CASE("passing write operations to append calls corresponding C function", "
358
362
TEST_CASE (" calling empty on a bulk write before and after appending" , " [bulk_write]" ) {
359
363
instance::current ();
360
364
mongocxx::client client{mongocxx::uri{}, test_util::add_test_server_api ()};
361
- auto bw = client[" db" ][" coll" ].create_bulk_write ();
365
+ mongocxx::collection coll = client[" db" ][" coll" ];
366
+ CHECK_NOTHROW (coll.drop ());
367
+ auto bw = coll.create_bulk_write ();
362
368
363
369
REQUIRE (bw.empty ());
364
370
bw.append (model::insert_one (make_document (kvp (" _id" , 1 ))));
0 commit comments