Skip to content

Commit 9ddb234

Browse files
committed
Clang format.
1 parent ab8b628 commit 9ddb234

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

test/cpp/util/cli_credentials.cc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ DEFINE_string(
3131
ssl_target, "",
3232
"If not empty, treat the server host name as this for ssl/tls certificate "
3333
"validation.");
34-
DEFINE_string(
35-
channel_creds_type, "",
36-
"The channel creds type: insecure, ssl, or alts.");
34+
DEFINE_string(channel_creds_type, "",
35+
"The channel creds type: insecure, ssl, or alts.");
3736

3837
namespace grpc {
3938
namespace testing {
4039

4140
grpc::string CliCredentials::GetDefaultChannelCredsType() const {
4241
// Compatibility logic for --enable_ssl.
4342
if (FLAGS_enable_ssl) {
44-
fprintf(stderr, "warning: --enable_ssl is deprecated. Use "
43+
fprintf(stderr,
44+
"warning: --enable_ssl is deprecated. Use "
4545
"--channel_creds_type=ssl.\n");
4646
return "ssl";
4747
}
@@ -53,7 +53,7 @@ grpc::string CliCredentials::GetDefaultChannelCredsType() const {
5353
}
5454

5555
std::shared_ptr<grpc::ChannelCredentials>
56-
CliCredentials::GetChannelCredentials() const {
56+
CliCredentials::GetChannelCredentials() const {
5757
if (FLAGS_channel_creds_type.compare("insecure") == 0) {
5858
return grpc::InsecureChannelCredentials();
5959
} else if (FLAGS_channel_creds_type.compare("ssl") == 0) {
@@ -86,7 +86,8 @@ std::shared_ptr<grpc::ChannelCredentials> CliCredentials::GetCredentials()
8686
if (FLAGS_channel_creds_type.empty()) {
8787
FLAGS_channel_creds_type = GetDefaultChannelCredsType();
8888
} else if (FLAGS_enable_ssl && FLAGS_channel_creds_type.compare("ssl") != 0) {
89-
fprintf(stderr, "warning: ignoring --enable_ssl because "
89+
fprintf(stderr,
90+
"warning: ignoring --enable_ssl because "
9091
"--channel_creds_type already set to %s.\n",
9192
FLAGS_channel_creds_type.c_str());
9293
}
@@ -112,8 +113,9 @@ std::shared_ptr<grpc::ChannelCredentials> CliCredentials::GetCredentials()
112113
}
113114
// Composite any call-type credentials on top of the base channel.
114115
std::shared_ptr<grpc::CallCredentials> call_creds = GetCallCredentials();
115-
return (channel_creds == nullptr || call_creds == nullptr) ? channel_creds :
116-
grpc::CompositeChannelCredentials(channel_creds, call_creds);
116+
return (channel_creds == nullptr || call_creds == nullptr)
117+
? channel_creds
118+
: grpc::CompositeChannelCredentials(channel_creds, call_creds);
117119
}
118120

119121
const grpc::string CliCredentials::GetCredentialUsage() const {
@@ -128,7 +130,7 @@ const grpc::string CliCredentials::GetCredentialUsage() const {
128130

129131
const grpc::string CliCredentials::GetSslTargetNameOverride() const {
130132
bool use_ssl = FLAGS_channel_creds_type.compare("ssl") == 0 ||
131-
(FLAGS_access_token.empty() && FLAGS_use_auth);
133+
(FLAGS_access_token.empty() && FLAGS_use_auth);
132134
return use_ssl ? FLAGS_ssl_target : "";
133135
}
134136

test/cpp/util/cli_credentials.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class CliCredentials {
3131
std::shared_ptr<grpc::ChannelCredentials> GetCredentials() const;
3232
virtual const grpc::string GetCredentialUsage() const;
3333
virtual const grpc::string GetSslTargetNameOverride() const;
34+
3435
protected:
3536
// Returns the appropriate channel_creds_type value for the set of legacy
3637
// flag arguments.

test/cpp/util/grpc_tool_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ const int kServerDefaultResponseStreamsToSend = 3;
102102
class TestCliCredentials final : public grpc::testing::CliCredentials {
103103
public:
104104
TestCliCredentials(bool secure = false) : secure_(secure) {}
105-
std::shared_ptr<grpc::ChannelCredentials> GetChannelCredentials() const
106-
override {
105+
std::shared_ptr<grpc::ChannelCredentials> GetChannelCredentials()
106+
const override {
107107
if (!secure_) {
108108
return InsecureChannelCredentials();
109109
}

0 commit comments

Comments
 (0)