|
|
|
@ -3553,14 +3553,14 @@ TEST(CredentialsTest, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(CredentialsTest, TestInsecureCredentialsCompareSuccess) { |
|
|
|
|
auto* insecure_creds_1 = grpc_insecure_credentials_create(); |
|
|
|
|
auto* insecure_creds_2 = grpc_insecure_credentials_create(); |
|
|
|
|
GPR_ASSERT(insecure_creds_1->cmp(insecure_creds_2) == 0); |
|
|
|
|
auto insecure_creds_1 = grpc_insecure_credentials_create(); |
|
|
|
|
auto insecure_creds_2 = grpc_insecure_credentials_create(); |
|
|
|
|
ASSERT_EQ(insecure_creds_1->cmp(insecure_creds_2), 0); |
|
|
|
|
grpc_arg arg_1 = grpc_channel_credentials_to_arg(insecure_creds_1); |
|
|
|
|
grpc_channel_args args_1 = {1, &arg_1}; |
|
|
|
|
grpc_arg arg_2 = grpc_channel_credentials_to_arg(insecure_creds_2); |
|
|
|
|
grpc_channel_args args_2 = {1, &arg_2}; |
|
|
|
|
GPR_ASSERT(grpc_channel_args_compare(&args_1, &args_2) == 0); |
|
|
|
|
EXPECT_EQ(grpc_channel_args_compare(&args_1, &args_2), 0); |
|
|
|
|
grpc_channel_credentials_release(insecure_creds_1); |
|
|
|
|
grpc_channel_credentials_release(insecure_creds_2); |
|
|
|
|
} |
|
|
|
@ -3568,15 +3568,21 @@ TEST(CredentialsTest, TestInsecureCredentialsCompareSuccess) { |
|
|
|
|
TEST(CredentialsTest, TestInsecureCredentialsCompareFailure) { |
|
|
|
|
auto* insecure_creds = grpc_insecure_credentials_create(); |
|
|
|
|
auto* fake_creds = grpc_fake_transport_security_credentials_create(); |
|
|
|
|
GPR_ASSERT(insecure_creds->cmp(fake_creds) != 0); |
|
|
|
|
GPR_ASSERT(fake_creds->cmp(insecure_creds) != 0); |
|
|
|
|
ASSERT_NE(insecure_creds->cmp(fake_creds), 0); |
|
|
|
|
ASSERT_NE(fake_creds->cmp(insecure_creds), 0); |
|
|
|
|
grpc_arg arg_1 = grpc_channel_credentials_to_arg(insecure_creds); |
|
|
|
|
grpc_channel_args args_1 = {1, &arg_1}; |
|
|
|
|
grpc_arg arg_2 = grpc_channel_credentials_to_arg(fake_creds); |
|
|
|
|
grpc_channel_args args_2 = {1, &arg_2}; |
|
|
|
|
GPR_ASSERT(grpc_channel_args_compare(&args_1, &args_2) != 0); |
|
|
|
|
grpc_channel_credentials_release(insecure_creds); |
|
|
|
|
EXPECT_NE(grpc_channel_args_compare(&args_1, &args_2), 0); |
|
|
|
|
grpc_channel_credentials_release(fake_creds); |
|
|
|
|
grpc_channel_credentials_release(insecure_creds); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(CredentialsTest, TestInsecureCredentialsSingletonCreate) { |
|
|
|
|
auto* insecure_creds_1 = grpc_insecure_credentials_create(); |
|
|
|
|
auto* insecure_creds_2 = grpc_insecure_credentials_create(); |
|
|
|
|
EXPECT_EQ(insecure_creds_1, insecure_creds_2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(CredentialsTest, TestFakeCallCredentialsCompareSuccess) { |
|
|
|
|