aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util
diff options
context:
space:
mode:
authorGravatar Nathan Herring <nherring@google.com>2018-08-01 13:08:03 +0200
committerGravatar Nathan Herring <nherring@google.com>2018-08-01 13:08:03 +0200
commit9ddb23442b62beeecb1f06921e76a850faa6ba40 (patch)
tree7a844746c9ce99282d08735076e400d14314c6b1 /test/cpp/util
parentab8b628b31c8c4b564c09dacac604025f9870463 (diff)
Clang format.
Diffstat (limited to 'test/cpp/util')
-rw-r--r--test/cpp/util/cli_credentials.cc20
-rw-r--r--test/cpp/util/cli_credentials.h1
-rw-r--r--test/cpp/util/grpc_tool_test.cc4
3 files changed, 14 insertions, 11 deletions
diff --git a/test/cpp/util/cli_credentials.cc b/test/cpp/util/cli_credentials.cc
index a560c31410..d223411121 100644
--- a/test/cpp/util/cli_credentials.cc
+++ b/test/cpp/util/cli_credentials.cc
@@ -31,9 +31,8 @@ DEFINE_string(
ssl_target, "",
"If not empty, treat the server host name as this for ssl/tls certificate "
"validation.");
-DEFINE_string(
- channel_creds_type, "",
- "The channel creds type: insecure, ssl, or alts.");
+DEFINE_string(channel_creds_type, "",
+ "The channel creds type: insecure, ssl, or alts.");
namespace grpc {
namespace testing {
@@ -41,7 +40,8 @@ namespace testing {
grpc::string CliCredentials::GetDefaultChannelCredsType() const {
// Compatibility logic for --enable_ssl.
if (FLAGS_enable_ssl) {
- fprintf(stderr, "warning: --enable_ssl is deprecated. Use "
+ fprintf(stderr,
+ "warning: --enable_ssl is deprecated. Use "
"--channel_creds_type=ssl.\n");
return "ssl";
}
@@ -53,7 +53,7 @@ grpc::string CliCredentials::GetDefaultChannelCredsType() const {
}
std::shared_ptr<grpc::ChannelCredentials>
- CliCredentials::GetChannelCredentials() const {
+CliCredentials::GetChannelCredentials() const {
if (FLAGS_channel_creds_type.compare("insecure") == 0) {
return grpc::InsecureChannelCredentials();
} else if (FLAGS_channel_creds_type.compare("ssl") == 0) {
@@ -86,7 +86,8 @@ std::shared_ptr<grpc::ChannelCredentials> CliCredentials::GetCredentials()
if (FLAGS_channel_creds_type.empty()) {
FLAGS_channel_creds_type = GetDefaultChannelCredsType();
} else if (FLAGS_enable_ssl && FLAGS_channel_creds_type.compare("ssl") != 0) {
- fprintf(stderr, "warning: ignoring --enable_ssl because "
+ fprintf(stderr,
+ "warning: ignoring --enable_ssl because "
"--channel_creds_type already set to %s.\n",
FLAGS_channel_creds_type.c_str());
}
@@ -112,8 +113,9 @@ std::shared_ptr<grpc::ChannelCredentials> CliCredentials::GetCredentials()
}
// Composite any call-type credentials on top of the base channel.
std::shared_ptr<grpc::CallCredentials> call_creds = GetCallCredentials();
- return (channel_creds == nullptr || call_creds == nullptr) ? channel_creds :
- grpc::CompositeChannelCredentials(channel_creds, call_creds);
+ return (channel_creds == nullptr || call_creds == nullptr)
+ ? channel_creds
+ : grpc::CompositeChannelCredentials(channel_creds, call_creds);
}
const grpc::string CliCredentials::GetCredentialUsage() const {
@@ -128,7 +130,7 @@ const grpc::string CliCredentials::GetCredentialUsage() const {
const grpc::string CliCredentials::GetSslTargetNameOverride() const {
bool use_ssl = FLAGS_channel_creds_type.compare("ssl") == 0 ||
- (FLAGS_access_token.empty() && FLAGS_use_auth);
+ (FLAGS_access_token.empty() && FLAGS_use_auth);
return use_ssl ? FLAGS_ssl_target : "";
}
diff --git a/test/cpp/util/cli_credentials.h b/test/cpp/util/cli_credentials.h
index 259bd0ab7a..4636d3ca14 100644
--- a/test/cpp/util/cli_credentials.h
+++ b/test/cpp/util/cli_credentials.h
@@ -31,6 +31,7 @@ class CliCredentials {
std::shared_ptr<grpc::ChannelCredentials> GetCredentials() const;
virtual const grpc::string GetCredentialUsage() const;
virtual const grpc::string GetSslTargetNameOverride() const;
+
protected:
// Returns the appropriate channel_creds_type value for the set of legacy
// flag arguments.
diff --git a/test/cpp/util/grpc_tool_test.cc b/test/cpp/util/grpc_tool_test.cc
index 555f02af4b..3aae090e81 100644
--- a/test/cpp/util/grpc_tool_test.cc
+++ b/test/cpp/util/grpc_tool_test.cc
@@ -102,8 +102,8 @@ const int kServerDefaultResponseStreamsToSend = 3;
class TestCliCredentials final : public grpc::testing::CliCredentials {
public:
TestCliCredentials(bool secure = false) : secure_(secure) {}
- std::shared_ptr<grpc::ChannelCredentials> GetChannelCredentials() const
- override {
+ std::shared_ptr<grpc::ChannelCredentials> GetChannelCredentials()
+ const override {
if (!secure_) {
return InsecureChannelCredentials();
}