summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2012-11-12 23:41:59 -0500
committerRandolph Tan <randolph@10gen.com>2012-11-13 13:45:27 -0500
commitef576759d86050a6098d201cdb193112f1062c94 (patch)
tree57ffc048aef64335b45d3b045eaeefd3729e018e
parent3d3f7e28b06d42b3f7432d834ac7056e53c41c88 (diff)
downloadmongo-ef576759d86050a6098d201cdb193112f1062c94.tar.gz
SERVER-7612 explicit primary read pref does not work well with shard versioning
Fixed tests for newly added out parameter.
-rw-r--r--src/mongo/dbtests/replica_set_monitor_test.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/dbtests/replica_set_monitor_test.cpp b/src/mongo/dbtests/replica_set_monitor_test.cpp
index e7965e35cda..d3525574061 100644
--- a/src/mongo/dbtests/replica_set_monitor_test.cpp
+++ b/src/mongo/dbtests/replica_set_monitor_test.cpp
@@ -373,8 +373,8 @@ namespace {
HostAndPort host = ReplicaSetMonitor::selectNode(nodes,
mongo::ReadPreference_PrimaryOnly, &tags, 3, &lastHost,
&isPrimarySelected);
- ASSERT(isPrimarySelected);
+ ASSERT(isPrimarySelected);
ASSERT_EQUALS("b", host.host());
}
@@ -391,7 +391,6 @@ namespace {
mongo::ReadPreference_PrimaryOnly, &tags, 3, &lastHost,
&isPrimarySelected);
- ASSERT(!isPrimarySelected);
ASSERT(host.empty());
}
@@ -602,6 +601,7 @@ namespace {
mongo::ReadPreference_PrimaryPreferred, &tags, 3, &lastHost,
&isPrimarySelected);
+ ASSERT(!isPrimarySelected);
ASSERT_EQUALS("c", host.host());
ASSERT_EQUALS("c", lastHost.host());
}
@@ -617,6 +617,7 @@ namespace {
mongo::ReadPreference_PrimaryPreferred, &tags, 3, &lastHost,
&isPrimarySelected);
+ ASSERT(isPrimarySelected);
ASSERT_EQUALS("b", host.host());
}
@@ -680,6 +681,7 @@ namespace {
mongo::ReadPreference_SecondaryPreferred, &tags, 3, &lastHost,
&isPrimarySelected);
+ ASSERT(!isPrimarySelected);
ASSERT_EQUALS("c", host.host());
ASSERT_EQUALS("c", lastHost.host());
}
@@ -1089,7 +1091,7 @@ namespace {
mongo::ReadPreference_SecondaryOnly, getMatchesSecondTagSet(),
3, &lastHost, &isPrimarySelected);
- ASSERT(isPrimarySelected);
+ ASSERT(!isPrimarySelected);
ASSERT_EQUALS("a", host.host());
ASSERT_EQUALS("a", lastHost.host());
}
@@ -1160,7 +1162,7 @@ namespace {
mongo::ReadPreference_SecondaryPreferred, getMatchesFirstTagSet(),
3, &lastHost, &isPrimarySelected);
- ASSERT(isPrimarySelected);
+ ASSERT(!isPrimarySelected);
ASSERT_EQUALS("a", host.host());
ASSERT_EQUALS("a", lastHost.host());
}
@@ -1176,7 +1178,7 @@ namespace {
mongo::ReadPreference_SecondaryPreferred, getMatchesFirstTagSet(),
3, &lastHost, &isPrimarySelected);
- ASSERT(isPrimarySelected);
+ ASSERT(!isPrimarySelected);
ASSERT_EQUALS("c", host.host());
ASSERT_EQUALS("c", lastHost.host());
}