diff --git a/CMakeLists.txt b/CMakeLists.txt index 95a26f71fc6..78b03154637 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 130752f1638..0449cc212bc 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -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 diff --git a/test/cpp/grpclb/BUILD b/test/cpp/grpclb/BUILD index cc557badea7..cf8c4b79c66 100644 --- a/test/cpp/grpclb/BUILD +++ b/test/cpp/grpclb/BUILD @@ -25,6 +25,7 @@ grpc_cc_test( name = "grpclb_api_test", srcs = ["grpclb_api_test.cc"], external_deps = [ + "absl/log:check", "gtest", ], deps = [ diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index 44401c290f0..9999d3957d6 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -18,6 +18,7 @@ #include +#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(&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; }