[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - GPR_ASSERT

pull/36223/head
tanvi-jagtap 10 months ago
parent da43a61322
commit 205ba1d023
  1. 1
      CMakeLists.txt
  2. 1
      build_autogenerated.yaml
  3. 1
      test/cpp/grpclb/BUILD
  4. 5
      test/cpp/grpclb/grpclb_api_test.cc

1
CMakeLists.txt generated

@ -16103,6 +16103,7 @@ target_include_directories(grpclb_api_test
target_link_libraries(grpclb_api_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc++_test_util
)

@ -10802,6 +10802,7 @@ targets:
- test/cpp/grpclb/grpclb_api_test.cc
deps:
- gtest
- absl/log:check
- grpc++_test_util
- name: grpclb_end2end_test
gtest: true

@ -25,6 +25,7 @@ grpc_cc_test(
name = "grpclb_api_test",
srcs = ["grpclb_api_test.cc"],
external_deps = [
"absl/log:check",
"gtest",
],
deps = [

@ -18,6 +18,7 @@
#include <gtest/gtest.h>
#include "absl/log/check.h"
#include "google/protobuf/duration.upb.h"
#include "upb/mem/arena.hpp"
@ -45,7 +46,7 @@ class GrpclbTest : public ::testing::Test {
std::string Ip4ToPackedString(const char* ip_str) {
struct in_addr ip4;
GPR_ASSERT(inet_pton(AF_INET, ip_str, &ip4) == 1);
CHECK(inet_pton(AF_INET, ip_str, &ip4) == 1);
return std::string(reinterpret_cast<const char*>(&ip4), sizeof(ip4));
}
@ -59,7 +60,7 @@ std::string PackedStringToIp(const grpc_core::GrpcLbServer& server) {
} else {
abort();
}
GPR_ASSERT(inet_ntop(af, (void*)server.ip_addr, ip_str, 46) != nullptr);
CHECK(inet_ntop(af, (void*)server.ip_addr, ip_str, 46) != nullptr);
return ip_str;
}

Loading…
Cancel
Save