From 52747821480e6cadd8b27a0947af5d7933f9dfb4 Mon Sep 17 00:00:00 2001 From: Andy Getzendanner Date: Tue, 23 May 2023 15:46:35 -0700 Subject: Migrate most RAW_LOGs and RAW_CHECKs in tests to regular LOG and CHECK. The non-RAW_ versions provide better output but weren't available when most of these tests were written. There are just a couple spots where RAW_ is actually needed, e.g. signal handlers and malloc hooks. Also fix a couple warnings in layout_test.cc newly surfaced because the optimizer understands CHECK_XX differently than INTERNAL_CHECK. PiperOrigin-RevId: 534584435 Change-Id: I8d36fa809ffdaae5a3813064bd602cb8611c1613 --- absl/types/BUILD.bazel | 4 ++-- absl/types/CMakeLists.txt | 4 ++-- absl/types/any_test.cc | 4 ++-- absl/types/optional_test.cc | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'absl/types') diff --git a/absl/types/BUILD.bazel b/absl/types/BUILD.bazel index bb801012..b57d3b9b 100644 --- a/absl/types/BUILD.bazel +++ b/absl/types/BUILD.bazel @@ -77,8 +77,8 @@ cc_test( ":any", "//absl/base:config", "//absl/base:exception_testing", - "//absl/base:raw_logging_internal", "//absl/container:test_instance_tracker", + "//absl/log", "@com_google_googletest//:gtest_main", ], ) @@ -185,7 +185,7 @@ cc_test( deps = [ ":optional", "//absl/base:config", - "//absl/base:raw_logging_internal", + "//absl/log", "//absl/meta:type_traits", "//absl/strings", "@com_google_googletest//:gtest_main", diff --git a/absl/types/CMakeLists.txt b/absl/types/CMakeLists.txt index 830953ae..c0dcee79 100644 --- a/absl/types/CMakeLists.txt +++ b/absl/types/CMakeLists.txt @@ -68,7 +68,7 @@ absl_cc_test( absl::any absl::config absl::exception_testing - absl::raw_logging_internal + absl::log absl::test_instance_tracker GTest::gmock_main ) @@ -220,7 +220,7 @@ absl_cc_test( DEPS absl::optional absl::config - absl::raw_logging_internal + absl::log absl::strings absl::type_traits GTest::gmock_main diff --git a/absl/types/any_test.cc b/absl/types/any_test.cc index d382b927..666ea5b6 100644 --- a/absl/types/any_test.cc +++ b/absl/types/any_test.cc @@ -25,8 +25,8 @@ #include "gtest/gtest.h" #include "absl/base/config.h" #include "absl/base/internal/exception_testing.h" -#include "absl/base/internal/raw_logging.h" #include "absl/container/internal/test_instance_tracker.h" +#include "absl/log/log.h" namespace { using absl::test_internal::CopyableOnlyInstance; @@ -704,7 +704,7 @@ struct BadCopyable { #ifdef ABSL_HAVE_EXCEPTIONS throw BadCopy(); #else - ABSL_RAW_LOG(FATAL, "Bad copy"); + LOG(FATAL) << "Bad copy"; #endif } }; diff --git a/absl/types/optional_test.cc b/absl/types/optional_test.cc index bd5fe082..5da297b0 100644 --- a/absl/types/optional_test.cc +++ b/absl/types/optional_test.cc @@ -23,7 +23,7 @@ #include "gtest/gtest.h" #include "absl/base/config.h" -#include "absl/base/internal/raw_logging.h" +#include "absl/log/log.h" #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" @@ -1542,8 +1542,7 @@ TEST(optionalTest, Hash) { struct MoveMeNoThrow { MoveMeNoThrow() : x(0) {} [[noreturn]] MoveMeNoThrow(const MoveMeNoThrow& other) : x(other.x) { - ABSL_RAW_LOG(FATAL, "Should not be called."); - abort(); + LOG(FATAL) << "Should not be called."; } MoveMeNoThrow(MoveMeNoThrow&& other) noexcept : x(other.x) {} int x; -- cgit v1.2.3