Skip to content

Commit df88fb2

Browse files
committed
test appeared to be checking for the wrong index before. now it checks for the index as specified in the arguments
1 parent a5169c4 commit df88fb2

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/mongocxx/test/spec/client_side_encryption.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ void add_auto_encryption_opts(document::view test, options::client* client_opts)
5252
using std::string;
5353

5454
if (test["clientOptions"]["autoEncryptOpts"]) {
55-
std::cout << "AUTO ENCRYPT OPTS: " << bsoncxx::to_json(test["clientOptions"]["autoEncryptOpts"].get_document().value) << std::endl;
5655
auto test_encrypt_opts = test["clientOptions"]["autoEncryptOpts"].get_document().value;
5756

5857
options::auto_encryption auto_encrypt_opts{};

src/mongocxx/test/spec/operation.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,21 +1281,14 @@ document::value operation_runner::_run_create_collection(document::view operatio
12811281

12821282
auto arguments = operation["arguments"].get_document().value;
12831283
auto collection_name = arguments["collection"].get_string().value;
1284-
std::cerr << "CREATING COLLECTION NAME: " << collection_name << std::endl;
1285-
std::cerr << "GOT encrypted_fields" << std::endl;
12861284
auto session = _lookup_session(arguments);
1287-
std::cerr << "GOT session" << std::endl;
12881285
if (session) {
1289-
std::cerr << "HERE 1" << std::endl;
12901286
_db->create_collection(*session, collection_name);
12911287
} else if (arguments.find("encryptedFields") != arguments.end()) {
1292-
std::cerr << "HERE 2" << std::endl;
12931288
auto encrypted_fields = arguments["encryptedFields"].get_document().value;
12941289
auto encrypted_fields_map = make_document(kvp("encryptedFields", encrypted_fields));
12951290
_db->create_collection(collection_name, std::move(encrypted_fields_map));
12961291
} else {
1297-
std::cerr << "HERE 3" << std::endl;
1298-
//_db->create_collection(collection_name, arguments);
12991292
_db->create_collection(collection_name);
13001293
}
13011294
return empty_document;
@@ -1310,14 +1303,10 @@ operation_runner::operation_runner(database* db,
13101303
: _coll(coll), _db(db), _session0(session0), _session1(session1), _client(client) {}
13111304

13121305
document::value operation_runner::run(document::view operation) {
1313-
static int i = 0;
1314-
std::cout << "\n\ni = " << i++ << "\n\n" << std::endl;
13151306
using namespace bsoncxx::builder::basic;
13161307

13171308
bsoncxx::document::value empty_document({});
13181309

1319-
std::cerr << "OPERATION: " << bsoncxx::to_json(operation) << std::endl;
1320-
13211310
stdx::string_view key = operation["name"].get_string().value;
13221311
stdx::string_view object;
13231312
if (operation["object"]) {
@@ -1437,7 +1426,6 @@ document::value operation_runner::run(document::view operation) {
14371426
REQUIRE(client[_db->name()].has_collection(collection_name));
14381427
return empty_document;
14391428
} else if (key.compare("createIndex") == 0) {
1440-
std::cerr << "CREATING INDEX: " << bsoncxx::to_json(operation) << std::endl;
14411429
return _create_index(operation);
14421430
} else if (key.compare("assertIndexNotExists") == 0) {
14431431
client client{uri{}};
@@ -1454,9 +1442,10 @@ document::value operation_runner::run(document::view operation) {
14541442
return empty_document;
14551443
} else if (key.compare("assertIndexExists") == 0) {
14561444
client client{uri{}};
1457-
auto cursor = client[_db->name()][_coll->name()].list_indexes();
1445+
auto db = operation["arguments"]["database"].get_string().value;
1446+
auto collection = operation["arguments"]["collection"].get_string().value;
1447+
auto cursor = client[db][collection].list_indexes();
14581448

1459-
std::cerr << "REQUIRING INDEX ON: " << "'" << _db->name() << "." << _coll->name() << "'" << std::endl;
14601449
REQUIRE(cursor.end() !=
14611450
std::find_if(cursor.begin(),
14621451
cursor.end(),

0 commit comments

Comments
 (0)