Skip to content

Commit b5eaa47

Browse files
author
Christian Hergert
committed
tests: fix leak on aggregate test.
1 parent 2423776 commit b5eaa47

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/test-mongoc-collection.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,6 @@ test_aggregate (void)
590590
bson_iter_t iter;
591591
int i;
592592

593-
pipeline = BCON_NEW ("pipeline", "[", "{", "$match", "{", "hello", BCON_UTF8 ("world"), "}", "}", "]");
594-
595-
again:
596-
597593
client = mongoc_client_new(gTestUri);
598594
ASSERT (client);
599595

@@ -603,10 +599,12 @@ test_aggregate (void)
603599
collection = get_test_collection (client, "test_aggregate");
604600
ASSERT (collection);
605601

606-
mongoc_collection_drop(collection, &error);
607-
602+
pipeline = BCON_NEW ("pipeline", "[", "{", "$match", "{", "hello", BCON_UTF8 ("world"), "}", "}", "]");
608603
b = BCON_NEW ("hello", BCON_UTF8 ("world"));
609604

605+
again:
606+
mongoc_collection_drop(collection, &error);
607+
610608
for (i = 0; i < 2; i++) {
611609
r = mongoc_collection_insert(collection, MONGOC_INSERT_NONE, b, NULL, &error);
612610
ASSERT (r);

0 commit comments

Comments
 (0)