|
|
|
@ -423,6 +423,24 @@ TEST(CredentialsTest, TlsChannelCredentialsWithCrlProviderAndDirectory) { |
|
|
|
|
GPR_ASSERT(channel_credentials.get() != nullptr); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(CredentialsTest, TlsCredentialsOptionsCopyConstructor) { |
|
|
|
|
// define a class that grants access to the internal
|
|
|
|
|
// grpc_tls_credentials_options pointer
|
|
|
|
|
class TlsTestCredentialsOptions |
|
|
|
|
: public grpc::experimental::TlsCredentialsOptions { |
|
|
|
|
public: |
|
|
|
|
grpc_tls_credentials_options* internal_cred_opts() { |
|
|
|
|
return mutable_c_credentials_options(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
TlsTestCredentialsOptions options; |
|
|
|
|
TlsTestCredentialsOptions copied_options = options; |
|
|
|
|
|
|
|
|
|
// Make sure the copy constructor cloned the internal pointer
|
|
|
|
|
GPR_ASSERT(options.internal_cred_opts() != |
|
|
|
|
copied_options.internal_cred_opts()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(CredentialsTest, TlsCredentialsOptionsDoesNotLeak) { |
|
|
|
|
TlsCredentialsOptions options; |
|
|
|
|
(void)options; |
|
|
|
|