diff options
author | Yang Gao <yangg@google.com> | 2015-07-22 21:30:00 -0700 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-07-22 21:30:00 -0700 |
commit | 1451f2e919613175d105face69f5853a218e65f2 (patch) | |
tree | c71c1493d771ced67dd9cae5659fd45f87a86607 /test/cpp | |
parent | 8b89bdeee74dbf7bf7f9e1074c392730f0cd6453 (diff) | |
parent | e66165dead7d4b26afa416143b32daad4bef9e36 (diff) |
Merge pull request #2571 from vjpai/cent6-issues
Remove one range-based for and do appropriate static casts on nullptr
Diffstat (limited to 'test/cpp')
-rw-r--r-- | test/cpp/client/credentials_test.cc | 2 | ||||
-rw-r--r-- | test/cpp/common/secure_auth_context_test.cc | 20 | ||||
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 2 |
3 files changed, 2 insertions, 22 deletions
diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index ee94f455a4..bbf7705f0a 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -47,7 +47,7 @@ class CredentialsTest : public ::testing::Test { TEST_F(CredentialsTest, InvalidServiceAccountCreds) { std::shared_ptr<Credentials> bad1 = ServiceAccountCredentials("", "", 1); - EXPECT_EQ(nullptr, bad1.get()); + EXPECT_EQ(static_cast<Credentials *>(nullptr), bad1.get()); } } // namespace testing diff --git a/test/cpp/common/secure_auth_context_test.cc b/test/cpp/common/secure_auth_context_test.cc index f18a04178e..d0243a5432 100644 --- a/test/cpp/common/secure_auth_context_test.cc +++ b/test/cpp/common/secure_auth_context_test.cc @@ -92,26 +92,6 @@ TEST_F(SecureAuthContextTest, Iterators) { EXPECT_EQ("bar", p2.second); ++iter; EXPECT_EQ(context.end(), iter); - // Range-based for loop test. - int i = 0; - for (auto p : context) { - switch (i++) { - case 0: - EXPECT_EQ("name", p.first); - EXPECT_EQ("chapi", p.second); - break; - case 1: - EXPECT_EQ("name", p.first); - EXPECT_EQ("chapo", p.second); - break; - case 2: - EXPECT_EQ("foo", p.first); - EXPECT_EQ("bar", p.second); - break; - default: - EXPECT_TRUE(0); - } - } } } // namespace diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index a865a0e359..20e4c4ed55 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -509,7 +509,7 @@ TEST_F(End2endTest, DiffPackageServices) { // rpc and stream should fail on bad credentials. TEST_F(End2endTest, BadCredentials) { std::shared_ptr<Credentials> bad_creds = ServiceAccountCredentials("", "", 1); - EXPECT_EQ(nullptr, bad_creds.get()); + EXPECT_EQ(static_cast<Credentials *>(nullptr), bad_creds.get()); std::shared_ptr<ChannelInterface> channel = CreateChannel(server_address_.str(), bad_creds, ChannelArguments()); std::unique_ptr<grpc::cpp::test::util::TestService::Stub> stub( |