@@ -886,8 +886,12 @@ test_upsert_large ()
886
886
bson_t * sel = tmp_bson ("{'_id': 1}" );
887
887
bson_t doc = BSON_INITIALIZER ;
888
888
bson_t child = BSON_INITIALIZER ;
889
+ bson_t query = BSON_INITIALIZER ;
890
+ const bson_t * retdoc ;
889
891
bson_error_t error ;
890
892
bson_t reply ;
893
+ mongoc_cursor_t * cursor ;
894
+ int ok = 0 ;
891
895
892
896
client = test_framework_client_new ();
893
897
assert (client );
@@ -919,8 +923,28 @@ test_upsert_large ()
919
923
check_n_modified (has_write_cmds , & reply , 0 );
920
924
ASSERT_COUNT (1 , collection );
921
925
926
+ cursor = mongoc_collection_find (collection ,
927
+ MONGOC_QUERY_NONE ,
928
+ 0 ,
929
+ 0 ,
930
+ 0 ,
931
+ & query ,
932
+ NULL ,
933
+ NULL );
934
+ while (mongoc_cursor_next (cursor , & retdoc )) {
935
+ ok ++ ;
936
+ }
937
+ ASSERT_CMPINT (ok , = = , 1 );
938
+
939
+ if (mongoc_cursor_error (cursor , & error )) {
940
+ fprintf (stderr , "ERROR: %s\n" , error .message );
941
+ ASSERT (false);
942
+ }
943
+
944
+ bson_destroy (& query );
922
945
bson_destroy (& reply );
923
946
bson_destroy (& doc );
947
+ mongoc_cursor_destroy (cursor );
924
948
mongoc_bulk_operation_destroy (bulk );
925
949
mongoc_collection_destroy (collection );
926
950
mongoc_client_destroy (client );
@@ -1965,6 +1989,10 @@ test_large_inserts_ordered (void)
1965
1989
bson_t * big_doc ;
1966
1990
bson_iter_t iter ;
1967
1991
int i ;
1992
+ const bson_t * retdoc ;
1993
+ bson_t query = BSON_INITIALIZER ;
1994
+ mongoc_cursor_t * cursor ;
1995
+ int ok = 0 ;
1968
1996
1969
1997
client = test_framework_client_new ();
1970
1998
assert (client );
@@ -2008,6 +2036,26 @@ test_large_inserts_ordered (void)
2008
2036
check_n_modified (has_write_cmds , & reply , 0 );
2009
2037
ASSERT_COUNT (1 , collection );
2010
2038
2039
+ cursor = mongoc_collection_find (collection ,
2040
+ MONGOC_QUERY_NONE ,
2041
+ 0 ,
2042
+ 0 ,
2043
+ 0 ,
2044
+ & query ,
2045
+ NULL ,
2046
+ NULL );
2047
+ while (mongoc_cursor_next (cursor , & retdoc )) {
2048
+ ok ++ ;
2049
+ }
2050
+
2051
+ ASSERT_CMPINT (ok , = = , 1 );
2052
+
2053
+ if (mongoc_cursor_error (cursor , & error )) {
2054
+ fprintf (stderr , "ERROR: %s\n" , error .message );
2055
+ ASSERT (false);
2056
+ }
2057
+
2058
+ bson_destroy (& query );
2011
2059
mongoc_collection_remove (collection , MONGOC_REMOVE_NONE , tmp_bson ("{}" ),
2012
2060
NULL , NULL );
2013
2061
@@ -2051,6 +2099,10 @@ test_large_inserts_unordered ()
2051
2099
bson_t * big_doc ;
2052
2100
bson_iter_t iter ;
2053
2101
int i ;
2102
+ const bson_t * retdoc ;
2103
+ bson_t query = BSON_INITIALIZER ;
2104
+ mongoc_cursor_t * cursor ;
2105
+ int ok = 0 ;
2054
2106
2055
2107
client = test_framework_client_new ();
2056
2108
assert (client );
@@ -2089,6 +2141,26 @@ test_large_inserts_unordered ()
2089
2141
2090
2142
ASSERT_COUNT (2 , collection );
2091
2143
2144
+ cursor = mongoc_collection_find (collection ,
2145
+ MONGOC_QUERY_NONE ,
2146
+ 0 ,
2147
+ 0 ,
2148
+ 0 ,
2149
+ & query ,
2150
+ NULL ,
2151
+ NULL );
2152
+ while (mongoc_cursor_next (cursor , & retdoc )) {
2153
+ ok ++ ;
2154
+ }
2155
+
2156
+ ASSERT_CMPINT (ok , = = , 2 );
2157
+
2158
+ if (mongoc_cursor_error (cursor , & error )) {
2159
+ fprintf (stderr , "ERROR: %s\n" , error .message );
2160
+ ASSERT (false);
2161
+ }
2162
+
2163
+ bson_destroy (& query );
2092
2164
mongoc_collection_remove (collection , MONGOC_REMOVE_NONE , tmp_bson ("{}" ),
2093
2165
NULL , NULL );
2094
2166
0 commit comments