diff options
Diffstat (limited to 'test/cpp/util')
-rw-r--r-- | test/cpp/util/grpc_tool.cc | 10 | ||||
-rw-r--r-- | test/cpp/util/grpc_tool_test.cc | 32 |
2 files changed, 21 insertions, 21 deletions
diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc index cd6084ac6d..a6d08cd83c 100644 --- a/test/cpp/util/grpc_tool.cc +++ b/test/cpp/util/grpc_tool.cc @@ -230,7 +230,7 @@ const Command* FindCommand(const grpc::string& name) { return &ops[i]; } } - return NULL; + return nullptr; } } // namespace @@ -245,13 +245,13 @@ int GrpcToolMainLib(int argc, const char** argv, const CliCredentials& cred, argv += 2; const Command* cmd = FindCommand(command); - if (cmd != NULL) { + if (cmd != nullptr) { GrpcTool grpc_tool; if (argc < cmd->min_args || argc > cmd->max_args) { // Force the command to print its usage message fprintf(stderr, "\nWrong number of arguments for %s\n", command.c_str()); grpc_tool.SetPrintCommandMode(1); - return cmd->function(&grpc_tool, -1, NULL, cred, callback); + return cmd->function(&grpc_tool, -1, nullptr, cred, callback); } const bool ok = cmd->function(&grpc_tool, argc, argv, cred, callback); return ok ? 0 : 1; @@ -281,11 +281,11 @@ bool GrpcTool::Help(int argc, const char** argv, const CliCredentials& cred, Usage(""); } else { const Command* cmd = FindCommand(argv[0]); - if (cmd == NULL) { + if (cmd == nullptr) { Usage("Unknown command '" + grpc::string(argv[0]) + "'"); } SetPrintCommandMode(0); - cmd->function(this, -1, NULL, cred, callback); + cmd->function(this, -1, nullptr, cred, callback); } return true; } diff --git a/test/cpp/util/grpc_tool_test.cc b/test/cpp/util/grpc_tool_test.cc index d0b3d7b81b..1c07b2a8ef 100644 --- a/test/cpp/util/grpc_tool_test.cc +++ b/test/cpp/util/grpc_tool_test.cc @@ -395,7 +395,7 @@ TEST_F(GrpcToolTest, CallCommand) { std::bind(PrintStream, &output_stream, std::placeholders::_1))); // Expected output: "message: \"Hello\"" - EXPECT_TRUE(NULL != + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), "message: \"Hello\"")); ShutdownServer(); } @@ -421,9 +421,9 @@ TEST_F(GrpcToolTest, CallCommandBatch) { // Expected output: "message: "Hello0"\nmessage: "Hello1"\nmessage: // "Hello2"\n" - EXPECT_TRUE(NULL != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: " - "\"Hello1\"\nmessage: \"Hello2\"\n")); + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), + "message: \"Hello0\"\nmessage: " + "\"Hello1\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -448,8 +448,8 @@ TEST_F(GrpcToolTest, CallCommandBatchWithBadRequest) { FLAGS_batch = false; // Expected output: "message: "Hello0"\nmessage: "Hello2"\n" - EXPECT_TRUE(NULL != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: \"Hello2\"\n")); + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), + "message: \"Hello0\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -473,8 +473,8 @@ TEST_F(GrpcToolTest, CallCommandRequestStream) { std::placeholders::_1))); // Expected output: "message: \"Hello0Hello1Hello2\"" - EXPECT_TRUE(NULL != strstr(output_stream.str().c_str(), - "message: \"Hello0Hello1Hello2\"")); + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), + "message: \"Hello0Hello1Hello2\"")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -498,7 +498,7 @@ TEST_F(GrpcToolTest, CallCommandRequestStreamWithBadRequest) { std::placeholders::_1))); // Expected output: "message: \"Hello0Hello2\"" - EXPECT_TRUE(NULL != + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), "message: \"Hello0Hello2\"")); std::cin.rdbuf(orig); ShutdownServer(); @@ -521,8 +521,8 @@ TEST_F(GrpcToolTest, CallCommandResponseStream) { for (int i = 0; i < kServerDefaultResponseStreamsToSend; i++) { grpc::string expected_response_text = "message: \"Hello" + grpc::to_string(i) + "\"\n"; - EXPECT_TRUE(NULL != strstr(output_stream.str().c_str(), - expected_response_text.c_str())); + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), + expected_response_text.c_str())); } ShutdownServer(); @@ -547,9 +547,9 @@ TEST_F(GrpcToolTest, CallCommandBidiStream) { // Expected output: "message: \"Hello0\"\nmessage: \"Hello1\"\nmessage: // \"Hello2\"\n\n" - EXPECT_TRUE(NULL != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: " - "\"Hello1\"\nmessage: \"Hello2\"\n")); + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), + "message: \"Hello0\"\nmessage: " + "\"Hello1\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -573,8 +573,8 @@ TEST_F(GrpcToolTest, CallCommandBidiStreamWithBadRequest) { // Expected output: "message: \"Hello0\"\nmessage: \"Hello1\"\nmessage: // \"Hello2\"\n\n" - EXPECT_TRUE(NULL != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: \"Hello2\"\n")); + EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), + "message: \"Hello0\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); |