5
test_mongo_sync_gridfs_stream_find (void)
7
mongo_sync_connection *conn;
8
mongo_sync_gridfs *gfs;
11
query = bson_build (BSON_TYPE_STRING, "filename", "bogus-fn", -1,
15
ok (mongo_sync_gridfs_stream_find (NULL, query) == NULL,
16
"mongo_sync_gridfs_stream_find() should fail with a NULL connection");
18
begin_network_tests (2);
20
conn = mongo_sync_connect (config.primary_host, config.primary_port, FALSE);
21
gfs = mongo_sync_gridfs_new (conn, config.gfs_prefix);
23
ok (mongo_sync_gridfs_stream_find (gfs, NULL) == NULL,
24
"mongo_sync_gridfs_stream_find() fails with a NULL query");
26
ok (mongo_sync_gridfs_stream_find (gfs, query) == NULL,
27
"mongo_sync_gridfs_stream_find() fails if the file is not found");
29
mongo_sync_gridfs_free (gfs, TRUE);
36
RUN_TEST (3, mongo_sync_gridfs_stream_find);