Skip to content

Commit

Permalink
CXX-698 make DBClientTest.Comment work on 3.1+ servers
Browse files Browse the repository at this point in the history
  • Loading branch information
amidvidy committed Oct 8, 2015
1 parent f98f3ea commit 724e215
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/mongo/integration/standalone/dbclient_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,11 +1129,20 @@ TEST_F(DBClientTest, Comment) {
c.setDbProfilingLevel(TEST_DB, c.ProfileAll);
c.findOne(TEST_NS, Query("{$query: {a: 'z'}, $comment: 'wow'})"));
c.setDbProfilingLevel(TEST_DB, c.ProfileOff);
BSONObj result = c.findOne(profile_coll,
BSON("ns" << TEST_NS << "op"
<< "query"
<< "query.$comment"
<< "wow"));
BSONObj result;
if (serverGTE(&c, 3, 1)) {
result = c.findOne(profile_coll,
BSON("ns" << TEST_NS << "op"
<< "query"
<< "query.comment"
<< "wow"));
} else {
result = c.findOne(profile_coll,
BSON("ns" << TEST_NS << "op"
<< "query"
<< "query.$comment"
<< "wow"));
}
ASSERT_FALSE(result.isEmpty());
}

Expand Down

0 comments on commit 724e215

Please sign in to comment.