aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/common/secure_auth_context_test.cc
diff options
context:
space:
mode:
authorGravatar Julien Boeuf <jboeuf@google.com>2015-08-27 16:07:46 -0700
committerGravatar Julien Boeuf <jboeuf@google.com>2015-08-27 16:07:46 -0700
commit459faf3821b74329f5f1debdba21abe03e3a6e74 (patch)
tree2046a5d7f4f119f0770154393c4308394f26f19b /test/cpp/common/secure_auth_context_test.cc
parent35b559f6f7e4e6410613632bbfe3f2ab84073feb (diff)
parent1029e7049cea55a8880b8fe9167bd3f0e483b037 (diff)
Merge branch 'master' of github.com:grpc/grpc into cpp_auth_md_processor
Diffstat (limited to 'test/cpp/common/secure_auth_context_test.cc')
-rw-r--r--test/cpp/common/secure_auth_context_test.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/cpp/common/secure_auth_context_test.cc b/test/cpp/common/secure_auth_context_test.cc
index e1f6bf05ce..4ab7fcacdf 100644
--- a/test/cpp/common/secure_auth_context_test.cc
+++ b/test/cpp/common/secure_auth_context_test.cc
@@ -35,11 +35,14 @@
#include <grpc++/support/auth_context.h>
#include <gtest/gtest.h>
#include "src/cpp/common/secure_auth_context.h"
+#include "test/cpp/util/string_ref_helper.h"
extern "C" {
#include "src/core/security/security_context.h"
}
+using grpc::testing::ToString;
+
namespace grpc {
namespace {
@@ -63,14 +66,14 @@ TEST_F(SecureAuthContextTest, Properties) {
context.AddProperty("foo", "bar");
EXPECT_TRUE(context.SetPeerIdentityPropertyName("name"));
- std::vector<grpc::string> peer_identity = context.GetPeerIdentity();
+ std::vector<grpc::string_ref> peer_identity = context.GetPeerIdentity();
EXPECT_EQ(2u, peer_identity.size());
- EXPECT_EQ("chapi", peer_identity[0]);
- EXPECT_EQ("chapo", peer_identity[1]);
+ EXPECT_EQ("chapi", ToString(peer_identity[0]));
+ EXPECT_EQ("chapo", ToString(peer_identity[1]));
EXPECT_EQ("name", context.GetPeerIdentityPropertyName());
- std::vector<grpc::string> bar = context.FindPropertyValues("foo");
+ std::vector<grpc::string_ref> bar = context.FindPropertyValues("foo");
EXPECT_EQ(1u, bar.size());
- EXPECT_EQ("bar", bar[0]);
+ EXPECT_EQ("bar", ToString(bar[0]));
}
TEST_F(SecureAuthContextTest, Iterators) {
@@ -88,12 +91,12 @@ TEST_F(SecureAuthContextTest, Iterators) {
AuthProperty p1 = *iter;
iter++;
AuthProperty p2 = *iter;
- EXPECT_EQ("name", p0.first);
- EXPECT_EQ("chapi", p0.second);
- EXPECT_EQ("name", p1.first);
- EXPECT_EQ("chapo", p1.second);
- EXPECT_EQ("foo", p2.first);
- EXPECT_EQ("bar", p2.second);
+ EXPECT_EQ("name", ToString(p0.first));
+ EXPECT_EQ("chapi", ToString(p0.second));
+ EXPECT_EQ("name", ToString(p1.first));
+ EXPECT_EQ("chapo", ToString(p1.second));
+ EXPECT_EQ("foo", ToString(p2.first));
+ EXPECT_EQ("bar", ToString(p2.second));
++iter;
EXPECT_EQ(context.end(), iter);
}