Fix abseil-* clang-tidy errors

pull/24437/head
Esun Kim 4 years ago
parent 19b8e657fb
commit a51fe3e675
  1. 2
      test/core/end2end/dualstack_socket_test.cc
  2. 6
      test/cpp/end2end/server_interceptors_end2end_test.cc
  3. 4
      test/cpp/qps/client.h

@ -127,7 +127,7 @@ void test_connect(const char* server_host, const char* client_host, int port,
if (client_host[0] == 'i') {
/* for ipv4:/ipv6: addresses, concatenate the port to each of the parts */
std::vector<absl::string_view> uri_parts =
absl::StrSplit(client_host, ",", absl::SkipEmpty());
absl::StrSplit(client_host, ',', absl::SkipEmpty());
std::vector<std::string> hosts_with_port;
hosts_with_port.reserve(uri_parts.size());
for (const absl::string_view& uri_part : uri_parts) {

@ -29,6 +29,8 @@
#include <grpcpp/server_context.h>
#include <grpcpp/support/server_interceptor.h>
#include "absl/strings/match.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@ -96,8 +98,8 @@ class LoggingInterceptor : public experimental::Interceptor {
bool found = false;
// Check that we received the metadata as an echo
for (const auto& pair : *map) {
found = pair.first.find("testkey") == 0 &&
pair.second.find("testvalue") == 0;
found = absl::StartsWith(pair.first, "testkey") &&
absl::StartsWith(pair.second, "testvalue");
if (found) break;
}
EXPECT_EQ(found, true);

@ -34,6 +34,8 @@
#include <grpcpp/support/channel_arguments.h>
#include <grpcpp/support/slice.h>
#include "absl/strings/match.h"
#include "src/proto/grpc/testing/benchmark_service.grpc.pb.h"
#include "src/proto/grpc/testing/payloads.pb.h"
@ -521,7 +523,7 @@ class ClientImpl : public Client {
}
std::string inproc_pfx(INPROC_NAME_PREFIX);
if (target.find(inproc_pfx) != 0) {
if (!absl::StartsWith(target, inproc_pfx)) {
channel_ = CreateTestChannel(
target, type, config.security_params().server_host_override(),
!config.security_params().use_test_ca(),

Loading…
Cancel
Save