aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-06-15 12:56:38 -0700
committerGravatar Vijay Pai <vpai@google.com>2016-06-15 12:56:38 -0700
commita63271c77f7ee4802761535f8c844f789328ad9f (patch)
treeb4f7525f453771dc45f5690b8f7431ed92b33187 /test/cpp/util
parent12bf3801b8dd298a2cfd89f45499d5f681e27ed6 (diff)
Deal with to_string, proper usage of nullptr, and lack of map::emplace
Diffstat (limited to 'test/cpp/util')
-rw-r--r--test/cpp/util/metrics_server.cc4
-rw-r--r--test/cpp/util/test_credentials_provider.cc9
2 files changed, 3 insertions, 10 deletions
diff --git a/test/cpp/util/metrics_server.cc b/test/cpp/util/metrics_server.cc
index cc6b39b753..1c7cd6382a 100644
--- a/test/cpp/util/metrics_server.cc
+++ b/test/cpp/util/metrics_server.cc
@@ -99,7 +99,7 @@ std::shared_ptr<QpsGauge> MetricsServiceImpl::CreateQpsGauge(
std::lock_guard<std::mutex> lock(mu_);
std::shared_ptr<QpsGauge> qps_gauge(new QpsGauge());
- const auto p = qps_gauges_.emplace(name, qps_gauge);
+ const auto p = qps_gauges_.insert(std::make_pair(name, qps_gauge));
// p.first is an iterator pointing to <name, shared_ptr<QpsGauge>> pair.
// p.second is a boolean which is set to 'true' if the QpsGauge is
@@ -114,7 +114,7 @@ std::shared_ptr<QpsGauge> MetricsServiceImpl::CreateQpsGauge(
std::unique_ptr<grpc::Server> MetricsServiceImpl::StartServer(int port) {
gpr_log(GPR_INFO, "Building metrics server..");
- const grpc::string address = "0.0.0.0:" + std::to_string(port);
+ const grpc::string address = "0.0.0.0:" + grpc::to_string(port);
ServerBuilder builder;
builder.AddListeningPort(address, grpc::InsecureServerCredentials());
diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc
index 9d762ce657..6e68f59e6a 100644
--- a/test/cpp/util/test_credentials_provider.cc
+++ b/test/cpp/util/test_credentials_provider.cc
@@ -41,15 +41,9 @@
#include "test/core/end2end/data/ssl_test_data.h"
+namespace grpc {
namespace {
-using grpc::ChannelArguments;
-using grpc::ChannelCredentials;
-using grpc::InsecureChannelCredentials;
-using grpc::InsecureServerCredentials;
-using grpc::ServerCredentials;
-using grpc::SslCredentialsOptions;
-using grpc::SslServerCredentialsOptions;
using grpc::testing::CredentialTypeProvider;
// Provide test credentials. Thread-safe.
@@ -162,7 +156,6 @@ CredentialsProvider* GetProvider() {
} // namespace
-namespace grpc {
namespace testing {
void AddSecureType(const grpc::string& type,