summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/vote_requester_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/vote_requester_test.cpp')
-rw-r--r--src/mongo/db/repl/vote_requester_test.cpp80
1 files changed, 47 insertions, 33 deletions
diff --git a/src/mongo/db/repl/vote_requester_test.cpp b/src/mongo/db/repl/vote_requester_test.cpp
index c6e1ebe7b61..ba4691019d8 100644
--- a/src/mongo/db/repl/vote_requester_test.cpp
+++ b/src/mongo/db/repl/vote_requester_test.cpp
@@ -32,9 +32,9 @@
#include "mongo/base/status.h"
#include "mongo/db/jsobj.h"
-#include "mongo/db/repl/vote_requester.h"
#include "mongo/db/repl/repl_set_request_votes_args.h"
#include "mongo/db/repl/replication_executor.h"
+#include "mongo/db/repl/vote_requester.h"
#include "mongo/executor/network_interface_mock.h"
#include "mongo/stdx/functional.h"
#include "mongo/unittest/unittest.h"
@@ -58,22 +58,29 @@ class VoteRequesterTest : public mongo::unittest::Test {
public:
virtual void setUp() {
ReplicaSetConfig config;
- ASSERT_OK(
- config.initialize(BSON("_id"
- << "rs0"
- << "version" << 2 << "members"
- << BSON_ARRAY(
- BSON("_id" << 0 << "host"
- << "host0")
- << BSON("_id" << 1 << "host"
- << "host1") << BSON("_id" << 2 << "host"
- << "host2")
- << BSON("_id" << 3 << "host"
- << "host3"
- << "votes" << 0 << "priority" << 0)
- << BSON("_id" << 4 << "host"
- << "host4"
- << "votes" << 0 << "priority" << 0)))));
+ ASSERT_OK(config.initialize(BSON("_id"
+ << "rs0"
+ << "version"
+ << 2
+ << "members"
+ << BSON_ARRAY(BSON("_id" << 0 << "host"
+ << "host0")
+ << BSON("_id" << 1 << "host"
+ << "host1")
+ << BSON("_id" << 2 << "host"
+ << "host2")
+ << BSON("_id" << 3 << "host"
+ << "host3"
+ << "votes"
+ << 0
+ << "priority"
+ << 0)
+ << BSON("_id" << 4 << "host"
+ << "host4"
+ << "votes"
+ << 0
+ << "priority"
+ << 0)))));
ASSERT_OK(config.validate());
long long candidateId = 0;
long long term = 2;
@@ -184,22 +191,29 @@ class VoteRequesterDryRunTest : public VoteRequesterTest {
public:
virtual void setUp() {
ReplicaSetConfig config;
- ASSERT_OK(
- config.initialize(BSON("_id"
- << "rs0"
- << "version" << 2 << "members"
- << BSON_ARRAY(
- BSON("_id" << 0 << "host"
- << "host0")
- << BSON("_id" << 1 << "host"
- << "host1") << BSON("_id" << 2 << "host"
- << "host2")
- << BSON("_id" << 3 << "host"
- << "host3"
- << "votes" << 0 << "priority" << 0)
- << BSON("_id" << 4 << "host"
- << "host4"
- << "votes" << 0 << "priority" << 0)))));
+ ASSERT_OK(config.initialize(BSON("_id"
+ << "rs0"
+ << "version"
+ << 2
+ << "members"
+ << BSON_ARRAY(BSON("_id" << 0 << "host"
+ << "host0")
+ << BSON("_id" << 1 << "host"
+ << "host1")
+ << BSON("_id" << 2 << "host"
+ << "host2")
+ << BSON("_id" << 3 << "host"
+ << "host3"
+ << "votes"
+ << 0
+ << "priority"
+ << 0)
+ << BSON("_id" << 4 << "host"
+ << "host4"
+ << "votes"
+ << 0
+ << "priority"
+ << 0)))));
ASSERT_OK(config.validate());
long long candidateId = 0;
long long term = 2;