summaryrefslogtreecommitdiff
path: root/src/mongo/rpc/protocol_test.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/rpc/protocol_test.cpp
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/rpc/protocol_test.cpp')
-rw-r--r--src/mongo/rpc/protocol_test.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/mongo/rpc/protocol_test.cpp b/src/mongo/rpc/protocol_test.cpp
index 86211717eb7..71ff1559fda 100644
--- a/src/mongo/rpc/protocol_test.cpp
+++ b/src/mongo/rpc/protocol_test.cpp
@@ -34,33 +34,33 @@
namespace {
- using namespace mongo::rpc;
+using namespace mongo::rpc;
- // Checks if negotiation of the first to protocol sets results in the 'proto'
- const auto assert_negotiated = [](ProtocolSet fst, ProtocolSet snd, Protocol proto) {
- auto negotiated = negotiate(fst, snd);
- ASSERT_TRUE(negotiated.isOK());
- ASSERT_TRUE(negotiated.getValue() == proto);
- };
+// Checks if negotiation of the first to protocol sets results in the 'proto'
+const auto assert_negotiated = [](ProtocolSet fst, ProtocolSet snd, Protocol proto) {
+ auto negotiated = negotiate(fst, snd);
+ ASSERT_TRUE(negotiated.isOK());
+ ASSERT_TRUE(negotiated.getValue() == proto);
+};
- TEST(Protocol, SuccessfulNegotiation) {
- assert_negotiated(supports::kAll, supports::kAll, Protocol::kOpCommandV1);
- assert_negotiated(supports::kAll, supports::kOpCommandOnly, Protocol::kOpCommandV1);
- assert_negotiated(supports::kAll, supports::kOpQueryOnly, Protocol::kOpQuery);
- }
+TEST(Protocol, SuccessfulNegotiation) {
+ assert_negotiated(supports::kAll, supports::kAll, Protocol::kOpCommandV1);
+ assert_negotiated(supports::kAll, supports::kOpCommandOnly, Protocol::kOpCommandV1);
+ assert_negotiated(supports::kAll, supports::kOpQueryOnly, Protocol::kOpQuery);
+}
- // Checks that negotiation fails
- const auto assert_not_negotiated = [](ProtocolSet fst, ProtocolSet snd) {
- auto proto = negotiate(fst, snd);
- ASSERT_TRUE(!proto.isOK());
- ASSERT_TRUE(proto.getStatus().code() == mongo::ErrorCodes::RPCProtocolNegotiationFailed);
- };
+// Checks that negotiation fails
+const auto assert_not_negotiated = [](ProtocolSet fst, ProtocolSet snd) {
+ auto proto = negotiate(fst, snd);
+ ASSERT_TRUE(!proto.isOK());
+ ASSERT_TRUE(proto.getStatus().code() == mongo::ErrorCodes::RPCProtocolNegotiationFailed);
+};
- TEST(Protocol, FailedNegotiation) {
- assert_not_negotiated(supports::kOpQueryOnly, supports::kOpCommandOnly);
- assert_not_negotiated(supports::kAll, supports::kNone);
- assert_not_negotiated(supports::kOpQueryOnly, supports::kNone);
- assert_not_negotiated(supports::kOpCommandOnly, supports::kNone);
- }
+TEST(Protocol, FailedNegotiation) {
+ assert_not_negotiated(supports::kOpQueryOnly, supports::kOpCommandOnly);
+ assert_not_negotiated(supports::kAll, supports::kNone);
+ assert_not_negotiated(supports::kOpQueryOnly, supports::kNone);
+ assert_not_negotiated(supports::kOpCommandOnly, supports::kNone);
+}
} // namespace