Commit 52747821 by Andy Getzendanner Committed by Copybara-Service

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
parent 79ca5d7a
...@@ -160,8 +160,8 @@ cc_test( ...@@ -160,8 +160,8 @@ cc_test(
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:exception_testing", "//absl/base:exception_testing",
"//absl/base:raw_logging_internal",
"//absl/hash:hash_testing", "//absl/hash:hash_testing",
"//absl/log:check",
"//absl/memory", "//absl/memory",
"//absl/strings", "//absl/strings",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
...@@ -255,7 +255,7 @@ cc_test( ...@@ -255,7 +255,7 @@ cc_test(
":unordered_map_lookup_test", ":unordered_map_lookup_test",
":unordered_map_members_test", ":unordered_map_members_test",
":unordered_map_modifiers_test", ":unordered_map_modifiers_test",
"//absl/base:raw_logging_internal", "//absl/log:check",
"//absl/types:any", "//absl/types:any",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
...@@ -289,7 +289,7 @@ cc_test( ...@@ -289,7 +289,7 @@ cc_test(
":unordered_set_lookup_test", ":unordered_set_lookup_test",
":unordered_set_members_test", ":unordered_set_members_test",
":unordered_set_modifiers_test", ":unordered_set_modifiers_test",
"//absl/base:raw_logging_internal", "//absl/log:check",
"//absl/memory", "//absl/memory",
"//absl/strings", "//absl/strings",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
...@@ -656,7 +656,6 @@ cc_test( ...@@ -656,7 +656,6 @@ cc_test(
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:prefetch", "//absl/base:prefetch",
"//absl/base:raw_logging_internal",
"//absl/log", "//absl/log",
"//absl/strings", "//absl/strings",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
...@@ -743,7 +742,7 @@ cc_test( ...@@ -743,7 +742,7 @@ cc_test(
":layout", ":layout",
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log:check",
"//absl/types:span", "//absl/types:span",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
......
...@@ -221,16 +221,16 @@ absl_cc_test( ...@@ -221,16 +221,16 @@ absl_cc_test(
COPTS COPTS
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
DEPS DEPS
absl::counting_allocator absl::check
absl::inlined_vector
absl::test_instance_tracker
absl::config absl::config
absl::core_headers absl::core_headers
absl::counting_allocator
absl::exception_testing absl::exception_testing
absl::hash_testing absl::hash_testing
absl::inlined_vector
absl::memory absl::memory
absl::raw_logging_internal
absl::strings absl::strings
absl::test_instance_tracker
GTest::gmock_main GTest::gmock_main
) )
...@@ -300,14 +300,14 @@ absl_cc_test( ...@@ -300,14 +300,14 @@ absl_cc_test(
COPTS COPTS
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
DEPS DEPS
absl::any
absl::check
absl::flat_hash_map absl::flat_hash_map
absl::hash_generator_testing absl::hash_generator_testing
absl::unordered_map_constructor_test absl::unordered_map_constructor_test
absl::unordered_map_lookup_test absl::unordered_map_lookup_test
absl::unordered_map_members_test absl::unordered_map_members_test
absl::unordered_map_modifiers_test absl::unordered_map_modifiers_test
absl::any
absl::raw_logging_internal
GTest::gmock_main GTest::gmock_main
) )
...@@ -337,15 +337,15 @@ absl_cc_test( ...@@ -337,15 +337,15 @@ absl_cc_test(
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
"-DUNORDERED_SET_CXX17" "-DUNORDERED_SET_CXX17"
DEPS DEPS
absl::check
absl::flat_hash_set absl::flat_hash_set
absl::hash_generator_testing absl::hash_generator_testing
absl::memory
absl::strings
absl::unordered_set_constructor_test absl::unordered_set_constructor_test
absl::unordered_set_lookup_test absl::unordered_set_lookup_test
absl::unordered_set_members_test absl::unordered_set_members_test
absl::unordered_set_modifiers_test absl::unordered_set_modifiers_test
absl::memory
absl::raw_logging_internal
absl::strings
GTest::gmock_main GTest::gmock_main
) )
...@@ -742,7 +742,6 @@ absl_cc_test( ...@@ -742,7 +742,6 @@ absl_cc_test(
absl::log absl::log
absl::prefetch absl::prefetch
absl::raw_hash_set absl::raw_hash_set
absl::raw_logging_internal
absl::strings absl::strings
GTest::gmock_main GTest::gmock_main
) )
...@@ -788,9 +787,9 @@ absl_cc_test( ...@@ -788,9 +787,9 @@ absl_cc_test(
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
DEPS DEPS
absl::layout absl::layout
absl::check
absl::config absl::config
absl::core_headers absl::core_headers
absl::raw_logging_internal
absl::span absl::span
GTest::gmock_main GTest::gmock_main
) )
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
#include <memory> #include <memory>
#include "absl/base/internal/raw_logging.h"
#include "absl/container/internal/hash_generator_testing.h" #include "absl/container/internal/hash_generator_testing.h"
#include "absl/container/internal/unordered_map_constructor_test.h" #include "absl/container/internal/unordered_map_constructor_test.h"
#include "absl/container/internal/unordered_map_lookup_test.h" #include "absl/container/internal/unordered_map_lookup_test.h"
#include "absl/container/internal/unordered_map_members_test.h" #include "absl/container/internal/unordered_map_members_test.h"
#include "absl/container/internal/unordered_map_modifiers_test.h" #include "absl/container/internal/unordered_map_modifiers_test.h"
#include "absl/log/check.h"
#include "absl/types/any.h" #include "absl/types/any.h"
namespace absl { namespace absl {
...@@ -40,10 +40,10 @@ struct BeforeMain { ...@@ -40,10 +40,10 @@ struct BeforeMain {
BeforeMain() { BeforeMain() {
absl::flat_hash_map<int, int> x; absl::flat_hash_map<int, int> x;
x.insert({1, 1}); x.insert({1, 1});
ABSL_RAW_CHECK(x.find(0) == x.end(), "x should not contain 0"); CHECK(x.find(0) == x.end()) << "x should not contain 0";
auto it = x.find(1); auto it = x.find(1);
ABSL_RAW_CHECK(it != x.end(), "x should contain 1"); CHECK(it != x.end()) << "x should contain 1";
ABSL_RAW_CHECK(it->second, "1 should map to 1"); CHECK(it->second) << "1 should map to 1";
} }
}; };
const BeforeMain before_main; const BeforeMain before_main;
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
#include <vector> #include <vector>
#include "absl/base/internal/raw_logging.h"
#include "absl/container/internal/hash_generator_testing.h" #include "absl/container/internal/hash_generator_testing.h"
#include "absl/container/internal/unordered_set_constructor_test.h" #include "absl/container/internal/unordered_set_constructor_test.h"
#include "absl/container/internal/unordered_set_lookup_test.h" #include "absl/container/internal/unordered_set_lookup_test.h"
#include "absl/container/internal/unordered_set_members_test.h" #include "absl/container/internal/unordered_set_members_test.h"
#include "absl/container/internal/unordered_set_modifiers_test.h" #include "absl/container/internal/unordered_set_modifiers_test.h"
#include "absl/log/check.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
...@@ -42,8 +42,8 @@ struct BeforeMain { ...@@ -42,8 +42,8 @@ struct BeforeMain {
BeforeMain() { BeforeMain() {
absl::flat_hash_set<int> x; absl::flat_hash_set<int> x;
x.insert(1); x.insert(1);
ABSL_RAW_CHECK(!x.contains(0), "x should not contain 0"); CHECK(!x.contains(0)) << "x should not contain 0";
ABSL_RAW_CHECK(x.contains(1), "x should contain 1"); CHECK(x.contains(1)) << "x should contain 1";
} }
}; };
const BeforeMain before_main; const BeforeMain before_main;
......
...@@ -31,12 +31,12 @@ ...@@ -31,12 +31,12 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/attributes.h" #include "absl/base/attributes.h"
#include "absl/base/internal/exception_testing.h" #include "absl/base/internal/exception_testing.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h" #include "absl/base/macros.h"
#include "absl/base/options.h" #include "absl/base/options.h"
#include "absl/container/internal/counting_allocator.h" #include "absl/container/internal/counting_allocator.h"
#include "absl/container/internal/test_instance_tracker.h" #include "absl/container/internal/test_instance_tracker.h"
#include "absl/hash/hash_testing.h" #include "absl/hash/hash_testing.h"
#include "absl/log/check.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
...@@ -103,13 +103,13 @@ class RefCounted { ...@@ -103,13 +103,13 @@ class RefCounted {
} }
void Ref() const { void Ref() const {
ABSL_RAW_CHECK(count_ != nullptr, ""); CHECK_NE(count_, nullptr);
++(*count_); ++(*count_);
} }
void Unref() const { void Unref() const {
--(*count_); --(*count_);
ABSL_RAW_CHECK(*count_ >= 0, ""); CHECK_GE(*count_, 0);
} }
int value_; int value_;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/config.h" #include "absl/base/config.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/check.h"
#include "absl/types/span.h" #include "absl/types/span.h"
namespace absl { namespace absl {
...@@ -38,7 +38,7 @@ using ::absl::Span; ...@@ -38,7 +38,7 @@ using ::absl::Span;
using ::testing::ElementsAre; using ::testing::ElementsAre;
size_t Distance(const void* from, const void* to) { size_t Distance(const void* from, const void* to) {
ABSL_RAW_CHECK(from <= to, "Distance must be non-negative"); CHECK_LE(from, to) << "Distance must be non-negative";
return static_cast<const char*>(to) - static_cast<const char*>(from); return static_cast<const char*>(to) - static_cast<const char*>(from);
} }
...@@ -366,7 +366,7 @@ TEST(Layout, Sizes) { ...@@ -366,7 +366,7 @@ TEST(Layout, Sizes) {
} }
TEST(Layout, PointerByIndex) { TEST(Layout, PointerByIndex) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ(0, Distance(p, Type<const int32_t*>(L::Partial().Pointer<0>(p)))); EXPECT_EQ(0, Distance(p, Type<const int32_t*>(L::Partial().Pointer<0>(p))));
...@@ -447,7 +447,7 @@ TEST(Layout, PointerByIndex) { ...@@ -447,7 +447,7 @@ TEST(Layout, PointerByIndex) {
} }
TEST(Layout, PointerByType) { TEST(Layout, PointerByType) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ( EXPECT_EQ(
...@@ -526,7 +526,7 @@ TEST(Layout, PointerByType) { ...@@ -526,7 +526,7 @@ TEST(Layout, PointerByType) {
} }
TEST(Layout, MutablePointerByIndex) { TEST(Layout, MutablePointerByIndex) {
alignas(max_align_t) unsigned char p[100]; alignas(max_align_t) unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ(0, Distance(p, Type<int32_t*>(L::Partial().Pointer<0>(p)))); EXPECT_EQ(0, Distance(p, Type<int32_t*>(L::Partial().Pointer<0>(p))));
...@@ -581,7 +581,7 @@ TEST(Layout, MutablePointerByIndex) { ...@@ -581,7 +581,7 @@ TEST(Layout, MutablePointerByIndex) {
} }
TEST(Layout, MutablePointerByType) { TEST(Layout, MutablePointerByType) {
alignas(max_align_t) unsigned char p[100]; alignas(max_align_t) unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ(0, Distance(p, Type<int32_t*>(L::Partial().Pointer<int32_t>(p)))); EXPECT_EQ(0, Distance(p, Type<int32_t*>(L::Partial().Pointer<int32_t>(p))));
...@@ -647,7 +647,7 @@ TEST(Layout, MutablePointerByType) { ...@@ -647,7 +647,7 @@ TEST(Layout, MutablePointerByType) {
} }
TEST(Layout, Pointers) { TEST(Layout, Pointers) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
using L = Layout<int8_t, int8_t, Int128>; using L = Layout<int8_t, int8_t, Int128>;
{ {
const auto x = L::Partial(); const auto x = L::Partial();
...@@ -683,7 +683,7 @@ TEST(Layout, Pointers) { ...@@ -683,7 +683,7 @@ TEST(Layout, Pointers) {
} }
TEST(Layout, MutablePointers) { TEST(Layout, MutablePointers) {
alignas(max_align_t) unsigned char p[100]; alignas(max_align_t) unsigned char p[100] = {0};
using L = Layout<int8_t, int8_t, Int128>; using L = Layout<int8_t, int8_t, Int128>;
{ {
const auto x = L::Partial(); const auto x = L::Partial();
...@@ -716,7 +716,7 @@ TEST(Layout, MutablePointers) { ...@@ -716,7 +716,7 @@ TEST(Layout, MutablePointers) {
} }
TEST(Layout, SliceByIndexSize) { TEST(Layout, SliceByIndexSize) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ(0, L::Partial(0).Slice<0>(p).size()); EXPECT_EQ(0, L::Partial(0).Slice<0>(p).size());
...@@ -744,7 +744,7 @@ TEST(Layout, SliceByIndexSize) { ...@@ -744,7 +744,7 @@ TEST(Layout, SliceByIndexSize) {
} }
TEST(Layout, SliceByTypeSize) { TEST(Layout, SliceByTypeSize) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ(0, L::Partial(0).Slice<int32_t>(p).size()); EXPECT_EQ(0, L::Partial(0).Slice<int32_t>(p).size());
...@@ -766,7 +766,7 @@ TEST(Layout, SliceByTypeSize) { ...@@ -766,7 +766,7 @@ TEST(Layout, SliceByTypeSize) {
} }
TEST(Layout, MutableSliceByIndexSize) { TEST(Layout, MutableSliceByIndexSize) {
alignas(max_align_t) unsigned char p[100]; alignas(max_align_t) unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ(0, L::Partial(0).Slice<0>(p).size()); EXPECT_EQ(0, L::Partial(0).Slice<0>(p).size());
...@@ -794,7 +794,7 @@ TEST(Layout, MutableSliceByIndexSize) { ...@@ -794,7 +794,7 @@ TEST(Layout, MutableSliceByIndexSize) {
} }
TEST(Layout, MutableSliceByTypeSize) { TEST(Layout, MutableSliceByTypeSize) {
alignas(max_align_t) unsigned char p[100]; alignas(max_align_t) unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ(0, L::Partial(0).Slice<int32_t>(p).size()); EXPECT_EQ(0, L::Partial(0).Slice<int32_t>(p).size());
...@@ -816,7 +816,7 @@ TEST(Layout, MutableSliceByTypeSize) { ...@@ -816,7 +816,7 @@ TEST(Layout, MutableSliceByTypeSize) {
} }
TEST(Layout, SliceByIndexData) { TEST(Layout, SliceByIndexData) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ( EXPECT_EQ(
...@@ -939,7 +939,7 @@ TEST(Layout, SliceByIndexData) { ...@@ -939,7 +939,7 @@ TEST(Layout, SliceByIndexData) {
} }
TEST(Layout, SliceByTypeData) { TEST(Layout, SliceByTypeData) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ( EXPECT_EQ(
...@@ -1037,7 +1037,7 @@ TEST(Layout, SliceByTypeData) { ...@@ -1037,7 +1037,7 @@ TEST(Layout, SliceByTypeData) {
} }
TEST(Layout, MutableSliceByIndexData) { TEST(Layout, MutableSliceByIndexData) {
alignas(max_align_t) unsigned char p[100]; alignas(max_align_t) unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ( EXPECT_EQ(
...@@ -1122,7 +1122,7 @@ TEST(Layout, MutableSliceByIndexData) { ...@@ -1122,7 +1122,7 @@ TEST(Layout, MutableSliceByIndexData) {
} }
TEST(Layout, MutableSliceByTypeData) { TEST(Layout, MutableSliceByTypeData) {
alignas(max_align_t) unsigned char p[100]; alignas(max_align_t) unsigned char p[100] = {0};
{ {
using L = Layout<int32_t>; using L = Layout<int32_t>;
EXPECT_EQ( EXPECT_EQ(
...@@ -1268,7 +1268,7 @@ testing::PolymorphicMatcher<TupleMatcher<M...>> Tuple(M... matchers) { ...@@ -1268,7 +1268,7 @@ testing::PolymorphicMatcher<TupleMatcher<M...>> Tuple(M... matchers) {
} }
TEST(Layout, Slices) { TEST(Layout, Slices) {
alignas(max_align_t) const unsigned char p[100] = {}; alignas(max_align_t) const unsigned char p[100] = {0};
using L = Layout<int8_t, int8_t, Int128>; using L = Layout<int8_t, int8_t, Int128>;
{ {
const auto x = L::Partial(); const auto x = L::Partial();
...@@ -1302,7 +1302,7 @@ TEST(Layout, Slices) { ...@@ -1302,7 +1302,7 @@ TEST(Layout, Slices) {
} }
TEST(Layout, MutableSlices) { TEST(Layout, MutableSlices) {
alignas(max_align_t) unsigned char p[100] = {}; alignas(max_align_t) unsigned char p[100] = {0};
using L = Layout<int8_t, int8_t, Int128>; using L = Layout<int8_t, int8_t, Int128>;
{ {
const auto x = L::Partial(); const auto x = L::Partial();
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include "absl/base/attributes.h" #include "absl/base/attributes.h"
#include "absl/base/config.h" #include "absl/base/config.h"
#include "absl/base/internal/cycleclock.h" #include "absl/base/internal/cycleclock.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/prefetch.h" #include "absl/base/prefetch.h"
#include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h" #include "absl/container/flat_hash_set.h"
...@@ -1280,7 +1279,7 @@ ExpectedStats XorSeedExpectedStats() { ...@@ -1280,7 +1279,7 @@ ExpectedStats XorSeedExpectedStats() {
{{0.95, 0}, {0.99, 1}, {0.999, 4}, {0.9999, 10}}}; {{0.95, 0}, {0.99, 1}, {0.999, 4}, {0.9999, 10}}};
} }
} }
ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width"); LOG(FATAL) << "Unknown Group width";
return {}; return {};
} }
...@@ -1376,7 +1375,7 @@ ExpectedStats LinearTransformExpectedStats() { ...@@ -1376,7 +1375,7 @@ ExpectedStats LinearTransformExpectedStats() {
{{0.95, 0}, {0.99, 1}, {0.999, 6}, {0.9999, 10}}}; {{0.95, 0}, {0.99, 1}, {0.999, 6}, {0.9999, 10}}};
} }
} }
ABSL_RAW_LOG(FATAL, "%s", "Unknown Group width"); LOG(FATAL) << "Unknown Group width";
return {}; return {};
} }
......
...@@ -122,7 +122,8 @@ cc_test( ...@@ -122,7 +122,8 @@ cc_test(
"//absl/base", "//absl/base",
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/log:check",
"//absl/memory", "//absl/memory",
"//absl/strings", "//absl/strings",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
...@@ -180,6 +181,7 @@ cc_test( ...@@ -180,6 +181,7 @@ cc_test(
":stacktrace", ":stacktrace",
":symbolize", ":symbolize",
"//absl/base:raw_logging_internal", "//absl/base:raw_logging_internal",
"//absl/log:check",
"//absl/strings", "//absl/strings",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
...@@ -233,7 +235,7 @@ cc_test( ...@@ -233,7 +235,7 @@ cc_test(
":stack_consumption", ":stack_consumption",
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/memory", "//absl/memory",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
...@@ -260,7 +262,7 @@ cc_test( ...@@ -260,7 +262,7 @@ cc_test(
deps = [ deps = [
":leak_check", ":leak_check",
"//absl/base:config", "//absl/base:config",
"//absl/base:raw_logging_internal", "//absl/log",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
) )
...@@ -277,7 +279,7 @@ cc_binary( ...@@ -277,7 +279,7 @@ cc_binary(
linkopts = ABSL_DEFAULT_LINKOPTS, linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [ deps = [
":leak_check", ":leak_check",
"//absl/base:raw_logging_internal", "//absl/log",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
) )
...@@ -306,7 +308,7 @@ cc_test( ...@@ -306,7 +308,7 @@ cc_test(
deps = [ deps = [
":stack_consumption", ":stack_consumption",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
) )
......
...@@ -101,14 +101,15 @@ absl_cc_test( ...@@ -101,14 +101,15 @@ absl_cc_test(
LINKOPTS LINKOPTS
$<$<BOOL:${MSVC}>:-DEBUG> $<$<BOOL:${MSVC}>:-DEBUG>
DEPS DEPS
absl::stack_consumption
absl::symbolize
absl::base absl::base
absl::check
absl::config absl::config
absl::core_headers absl::core_headers
absl::log
absl::memory absl::memory
absl::raw_logging_internal absl::stack_consumption
absl::strings absl::strings
absl::symbolize
GTest::gmock GTest::gmock
) )
...@@ -157,6 +158,7 @@ absl_cc_test( ...@@ -157,6 +158,7 @@ absl_cc_test(
COPTS COPTS
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
DEPS DEPS
absl::check
absl::failure_signal_handler absl::failure_signal_handler
absl::stacktrace absl::stacktrace
absl::symbolize absl::symbolize
...@@ -216,8 +218,8 @@ absl_cc_test( ...@@ -216,8 +218,8 @@ absl_cc_test(
absl::stack_consumption absl::stack_consumption
absl::config absl::config
absl::core_headers absl::core_headers
absl::log
absl::memory absl::memory
absl::raw_logging_internal
GTest::gmock_main GTest::gmock_main
) )
...@@ -248,6 +250,7 @@ absl_cc_test( ...@@ -248,6 +250,7 @@ absl_cc_test(
DEPS DEPS
absl::leak_check absl::leak_check
absl::base absl::base
absl::log
GTest::gmock_main GTest::gmock_main
) )
...@@ -278,7 +281,7 @@ absl_cc_test( ...@@ -278,7 +281,7 @@ absl_cc_test(
DEPS DEPS
absl::stack_consumption absl::stack_consumption
absl::core_headers absl::core_headers
absl::raw_logging_internal absl::log
GTest::gmock_main GTest::gmock_main
) )
......
...@@ -22,11 +22,12 @@ ...@@ -22,11 +22,12 @@
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>
#include "gtest/gtest.h"
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/base/internal/raw_logging.h"
#include "absl/debugging/stacktrace.h" #include "absl/debugging/stacktrace.h"
#include "absl/debugging/symbolize.h" #include "absl/debugging/symbolize.h"
#include "absl/log/check.h"
#include "absl/strings/match.h" #include "absl/strings/match.h"
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
...@@ -87,7 +88,7 @@ std::string GetTmpDir() { ...@@ -87,7 +88,7 @@ std::string GetTmpDir() {
// This function runs in a fork()ed process on most systems. // This function runs in a fork()ed process on most systems.
void InstallHandlerWithWriteToFileAndRaise(const char* file, int signo) { void InstallHandlerWithWriteToFileAndRaise(const char* file, int signo) {
error_file = fopen(file, "w"); error_file = fopen(file, "w");
ABSL_RAW_CHECK(error_file != nullptr, "Failed create error_file"); CHECK_NE(error_file, nullptr) << "Failed create error_file";
absl::FailureSignalHandlerOptions options; absl::FailureSignalHandlerOptions options;
options.writerfn = WriteToErrorFile; options.writerfn = WriteToErrorFile;
absl::InstallFailureSignalHandler(options); absl::InstallFailureSignalHandler(options);
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/config.h" #include "absl/base/config.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/debugging/internal/stack_consumption.h" #include "absl/debugging/internal/stack_consumption.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
namespace absl { namespace absl {
...@@ -151,7 +151,7 @@ static const char *DemangleStackConsumption(const char *mangled, ...@@ -151,7 +151,7 @@ static const char *DemangleStackConsumption(const char *mangled,
int *stack_consumed) { int *stack_consumed) {
g_mangled = mangled; g_mangled = mangled;
*stack_consumed = GetSignalHandlerStackConsumption(DemangleSignalHandler); *stack_consumed = GetSignalHandlerStackConsumption(DemangleSignalHandler);
ABSL_RAW_LOG(INFO, "Stack consumption of Demangle: %d", *stack_consumed); LOG(INFO) << "Stack consumption of Demangle: " << *stack_consumed;
return g_demangle_result; return g_demangle_result;
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <string.h> #include <string.h>
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
namespace absl { namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
...@@ -33,7 +33,7 @@ static void SimpleSignalHandler(int signo) { ...@@ -33,7 +33,7 @@ static void SimpleSignalHandler(int signo) {
// Never true, but prevents compiler from optimizing buf out. // Never true, but prevents compiler from optimizing buf out.
if (signo == 0) { if (signo == 0) {
ABSL_RAW_LOG(INFO, "%p", static_cast<void*>(buf)); LOG(INFO) << static_cast<void*>(buf);
} }
} }
......
...@@ -13,9 +13,10 @@ ...@@ -13,9 +13,10 @@
// limitations under the License. // limitations under the License.
#include <memory> #include <memory>
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/debugging/leak_check.h" #include "absl/debugging/leak_check.h"
#include "absl/log/log.h"
namespace { namespace {
...@@ -25,7 +26,7 @@ TEST(LeakCheckTest, LeakMemory) { ...@@ -25,7 +26,7 @@ TEST(LeakCheckTest, LeakMemory) {
// failed exit code. // failed exit code.
char* foo = strdup("lsan should complain about this leaked string"); char* foo = strdup("lsan should complain about this leaked string");
ABSL_RAW_LOG(INFO, "Should detect leaked string %s", foo); LOG(INFO) << "Should detect leaked string " << foo;
} }
TEST(LeakCheckTest, LeakMemoryAfterDisablerScope) { TEST(LeakCheckTest, LeakMemoryAfterDisablerScope) {
...@@ -34,8 +35,7 @@ TEST(LeakCheckTest, LeakMemoryAfterDisablerScope) { ...@@ -34,8 +35,7 @@ TEST(LeakCheckTest, LeakMemoryAfterDisablerScope) {
// failed exit code. // failed exit code.
{ absl::LeakCheckDisabler disabler; } { absl::LeakCheckDisabler disabler; }
char* foo = strdup("lsan should also complain about this leaked string"); char* foo = strdup("lsan should also complain about this leaked string");
ABSL_RAW_LOG(INFO, "Re-enabled leak detection.Should detect leaked string %s", LOG(INFO) << "Re-enabled leak detection.Should detect leaked string " << foo;
foo);
} }
} // namespace } // namespace
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/config.h" #include "absl/base/config.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/debugging/leak_check.h" #include "absl/debugging/leak_check.h"
#include "absl/log/log.h"
namespace { namespace {
...@@ -26,7 +26,7 @@ TEST(LeakCheckTest, IgnoreLeakSuppressesLeakedMemoryErrors) { ...@@ -26,7 +26,7 @@ TEST(LeakCheckTest, IgnoreLeakSuppressesLeakedMemoryErrors) {
GTEST_SKIP() << "LeakChecker is not active"; GTEST_SKIP() << "LeakChecker is not active";
} }
auto foo = absl::IgnoreLeak(new std::string("some ignored leaked string")); auto foo = absl::IgnoreLeak(new std::string("some ignored leaked string"));
ABSL_RAW_LOG(INFO, "Ignoring leaked string %s", foo->c_str()); LOG(INFO) << "Ignoring leaked string " << foo;
} }
TEST(LeakCheckTest, LeakCheckDisablerIgnoresLeak) { TEST(LeakCheckTest, LeakCheckDisablerIgnoresLeak) {
...@@ -35,7 +35,7 @@ TEST(LeakCheckTest, LeakCheckDisablerIgnoresLeak) { ...@@ -35,7 +35,7 @@ TEST(LeakCheckTest, LeakCheckDisablerIgnoresLeak) {
} }
absl::LeakCheckDisabler disabler; absl::LeakCheckDisabler disabler;
auto foo = new std::string("some string leaked while checks are disabled"); auto foo = new std::string("some string leaked while checks are disabled");
ABSL_RAW_LOG(INFO, "Ignoring leaked string %s", foo->c_str()); LOG(INFO) << "Ignoring leaked string " << foo;
} }
} // namespace } // namespace
...@@ -29,9 +29,10 @@ ...@@ -29,9 +29,10 @@
#include "absl/base/casts.h" #include "absl/base/casts.h"
#include "absl/base/config.h" #include "absl/base/config.h"
#include "absl/base/internal/per_thread_tls.h" #include "absl/base/internal/per_thread_tls.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/optimization.h" #include "absl/base/optimization.h"
#include "absl/debugging/internal/stack_consumption.h" #include "absl/debugging/internal/stack_consumption.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
...@@ -124,15 +125,17 @@ static char try_symbolize_buffer[4096]; ...@@ -124,15 +125,17 @@ static char try_symbolize_buffer[4096];
// absl::Symbolize() returns false, otherwise returns try_symbolize_buffer with // absl::Symbolize() returns false, otherwise returns try_symbolize_buffer with
// the result of absl::Symbolize(). // the result of absl::Symbolize().
static const char *TrySymbolizeWithLimit(void *pc, int limit) { static const char *TrySymbolizeWithLimit(void *pc, int limit) {
ABSL_RAW_CHECK(limit <= sizeof(try_symbolize_buffer), CHECK_LE(limit, sizeof(try_symbolize_buffer))
"try_symbolize_buffer is too small"); << "try_symbolize_buffer is too small";
// Use the heap to facilitate heap and buffer sanitizer tools. // Use the heap to facilitate heap and buffer sanitizer tools.
auto heap_buffer = absl::make_unique<char[]>(sizeof(try_symbolize_buffer)); auto heap_buffer = absl::make_unique<char[]>(sizeof(try_symbolize_buffer));
bool found = absl::Symbolize(pc, heap_buffer.get(), limit); bool found = absl::Symbolize(pc, heap_buffer.get(), limit);
if (found) { if (found) {
ABSL_RAW_CHECK(strnlen(heap_buffer.get(), limit) < limit, CHECK_LT(static_cast<int>(
"absl::Symbolize() did not properly terminate the string"); strnlen(heap_buffer.get(), static_cast<size_t>(limit))),
limit)
<< "absl::Symbolize() did not properly terminate the string";
strncpy(try_symbolize_buffer, heap_buffer.get(), strncpy(try_symbolize_buffer, heap_buffer.get(),
sizeof(try_symbolize_buffer) - 1); sizeof(try_symbolize_buffer) - 1);
try_symbolize_buffer[sizeof(try_symbolize_buffer) - 1] = '\0'; try_symbolize_buffer[sizeof(try_symbolize_buffer) - 1] = '\0';
...@@ -155,8 +158,8 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithReturnAddress() { ...@@ -155,8 +158,8 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithReturnAddress() {
#if defined(ABSL_HAVE_ATTRIBUTE_NOINLINE) #if defined(ABSL_HAVE_ATTRIBUTE_NOINLINE)
void *return_address = __builtin_return_address(0); void *return_address = __builtin_return_address(0);
const char *symbol = TrySymbolize(return_address); const char *symbol = TrySymbolize(return_address);
ABSL_RAW_CHECK(symbol != nullptr, "TestWithReturnAddress failed"); CHECK_NE(symbol, nullptr) << "TestWithReturnAddress failed";
ABSL_RAW_CHECK(strcmp(symbol, "main") == 0, "TestWithReturnAddress failed"); CHECK_STREQ(symbol, "main") << "TestWithReturnAddress failed";
std::cout << "TestWithReturnAddress passed" << std::endl; std::cout << "TestWithReturnAddress passed" << std::endl;
#endif #endif
} }
...@@ -314,8 +317,8 @@ static int FilterElfHeader(struct dl_phdr_info *info, size_t size, void *data) { ...@@ -314,8 +317,8 @@ static int FilterElfHeader(struct dl_phdr_info *info, size_t size, void *data) {
TEST(Symbolize, SymbolizeWithMultipleMaps) { TEST(Symbolize, SymbolizeWithMultipleMaps) {
// Force kPadding0 and kPadding1 to be linked in. // Force kPadding0 and kPadding1 to be linked in.
if (volatile_bool) { if (volatile_bool) {
ABSL_RAW_LOG(INFO, "%s", kPadding0); LOG(INFO) << kPadding0;
ABSL_RAW_LOG(INFO, "%s", kPadding1); LOG(INFO) << kPadding1;
} }
// Verify we can symbolize everything. // Verify we can symbolize everything.
...@@ -463,9 +466,9 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithPCInsideNonInlineFunction() { ...@@ -463,9 +466,9 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithPCInsideNonInlineFunction() {
(defined(__i386__) || defined(__x86_64__)) (defined(__i386__) || defined(__x86_64__))
void *pc = non_inline_func(); void *pc = non_inline_func();
const char *symbol = TrySymbolize(pc); const char *symbol = TrySymbolize(pc);
ABSL_RAW_CHECK(symbol != nullptr, "TestWithPCInsideNonInlineFunction failed"); CHECK_NE(symbol, nullptr) << "TestWithPCInsideNonInlineFunction failed";
ABSL_RAW_CHECK(strcmp(symbol, "non_inline_func") == 0, CHECK_STREQ(symbol, "non_inline_func")
"TestWithPCInsideNonInlineFunction failed"); << "TestWithPCInsideNonInlineFunction failed";
std::cout << "TestWithPCInsideNonInlineFunction passed" << std::endl; std::cout << "TestWithPCInsideNonInlineFunction passed" << std::endl;
#endif #endif
} }
...@@ -475,9 +478,8 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() { ...@@ -475,9 +478,8 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() {
(defined(__i386__) || defined(__x86_64__)) (defined(__i386__) || defined(__x86_64__))
void *pc = inline_func(); // Must be inlined. void *pc = inline_func(); // Must be inlined.
const char *symbol = TrySymbolize(pc); const char *symbol = TrySymbolize(pc);
ABSL_RAW_CHECK(symbol != nullptr, "TestWithPCInsideInlineFunction failed"); CHECK_NE(symbol, nullptr) << "TestWithPCInsideInlineFunction failed";
ABSL_RAW_CHECK(strcmp(symbol, __FUNCTION__) == 0, CHECK_STREQ(symbol, __FUNCTION__) << "TestWithPCInsideInlineFunction failed";
"TestWithPCInsideInlineFunction failed");
std::cout << "TestWithPCInsideInlineFunction passed" << std::endl; std::cout << "TestWithPCInsideInlineFunction passed" << std::endl;
#endif #endif
} }
...@@ -519,9 +521,8 @@ __attribute__((target("arm"))) int ArmThumbOverlapArm(int x) { ...@@ -519,9 +521,8 @@ __attribute__((target("arm"))) int ArmThumbOverlapArm(int x) {
void ABSL_ATTRIBUTE_NOINLINE TestArmThumbOverlap() { void ABSL_ATTRIBUTE_NOINLINE TestArmThumbOverlap() {
#if defined(ABSL_HAVE_ATTRIBUTE_NOINLINE) #if defined(ABSL_HAVE_ATTRIBUTE_NOINLINE)
const char *symbol = TrySymbolize((void *)&ArmThumbOverlapArm); const char *symbol = TrySymbolize((void *)&ArmThumbOverlapArm);
ABSL_RAW_CHECK(symbol != nullptr, "TestArmThumbOverlap failed"); CHECK_NE(symbol, nullptr) << "TestArmThumbOverlap failed";
ABSL_RAW_CHECK(strcmp("ArmThumbOverlapArm()", symbol) == 0, CHECK_STREQ("ArmThumbOverlapArm()", symbol) << "TestArmThumbOverlap failed";
"TestArmThumbOverlap failed");
std::cout << "TestArmThumbOverlap passed" << std::endl; std::cout << "TestArmThumbOverlap passed" << std::endl;
#endif #endif
} }
...@@ -584,7 +585,7 @@ int main(int argc, char **argv) { ...@@ -584,7 +585,7 @@ int main(int argc, char **argv) {
#if !defined(__EMSCRIPTEN__) #if !defined(__EMSCRIPTEN__)
// Make sure kHpageTextPadding is linked into the binary. // Make sure kHpageTextPadding is linked into the binary.
if (volatile_bool) { if (volatile_bool) {
ABSL_RAW_LOG(INFO, "%s", kHpageTextPadding); LOG(INFO) << kHpageTextPadding;
} }
#endif // !defined(__EMSCRIPTEN__) #endif // !defined(__EMSCRIPTEN__)
......
...@@ -452,8 +452,8 @@ cc_test( ...@@ -452,8 +452,8 @@ cc_test(
":parse", ":parse",
":reflection", ":reflection",
":usage_internal", ":usage_internal",
"//absl/base:raw_logging_internal",
"//absl/base:scoped_set_env", "//absl/base:scoped_set_env",
"//absl/log",
"//absl/strings", "//absl/strings",
"//absl/types:span", "//absl/types:span",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
......
...@@ -374,7 +374,7 @@ absl_cc_test( ...@@ -374,7 +374,7 @@ absl_cc_test(
absl::flags_parse absl::flags_parse
absl::flags_reflection absl::flags_reflection
absl::flags_usage_internal absl::flags_usage_internal
absl::raw_logging_internal absl::log
absl::scoped_set_env absl::scoped_set_env
absl::span absl::span
absl::strings absl::strings
......
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/internal/scoped_set_env.h" #include "absl/base/internal/scoped_set_env.h"
#include "absl/flags/flag.h" #include "absl/flags/flag.h"
#include "absl/flags/internal/parse.h" #include "absl/flags/internal/parse.h"
#include "absl/flags/internal/usage.h" #include "absl/flags/internal/usage.h"
#include "absl/flags/reflection.h" #include "absl/flags/reflection.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "absl/strings/substitute.h" #include "absl/strings/substitute.h"
...@@ -150,8 +150,7 @@ const std::string& GetTestTempDir() { ...@@ -150,8 +150,7 @@ const std::string& GetTestTempDir() {
} }
if (res->empty()) { if (res->empty()) {
ABSL_INTERNAL_LOG(FATAL, LOG(FATAL) << "Failed to make temporary directory for data files";
"Failed to make temporary directory for data files");
} }
#ifdef _WIN32 #ifdef _WIN32
......
...@@ -459,7 +459,6 @@ cc_test( ...@@ -459,7 +459,6 @@ cc_test(
":log_sink_registry", ":log_sink_registry",
":scoped_mock_log", ":scoped_mock_log",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal",
"//absl/log/internal:test_actions", "//absl/log/internal:test_actions",
"//absl/log/internal:test_helpers", "//absl/log/internal:test_helpers",
"//absl/log/internal:test_matchers", "//absl/log/internal:test_matchers",
......
...@@ -905,7 +905,6 @@ absl_cc_test( ...@@ -905,7 +905,6 @@ absl_cc_test(
absl::log_sink absl::log_sink
absl::log_sink_registry absl::log_sink_registry
absl::log_severity absl::log_severity
absl::raw_logging_internal
absl::scoped_mock_log absl::scoped_mock_log
absl::strings absl::strings
GTest::gtest_main GTest::gtest_main
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/attributes.h" #include "absl/base/attributes.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/log/internal/test_actions.h" #include "absl/log/internal/test_actions.h"
#include "absl/log/internal/test_helpers.h" #include "absl/log/internal/test_helpers.h"
#include "absl/log/internal/test_matchers.h" #include "absl/log/internal/test_matchers.h"
...@@ -205,7 +204,7 @@ class ReentrancyTest : public ::testing::Test { ...@@ -205,7 +204,7 @@ class ReentrancyTest : public ::testing::Test {
<< "The log is coming from *inside the sink*."; << "The log is coming from *inside the sink*.";
break; break;
default: default:
ABSL_RAW_LOG(FATAL, "Invalid mode %d.\n", static_cast<int>(mode_)); LOG(FATAL) << "Invalid mode " << static_cast<int>(mode_);
} }
} }
......
...@@ -189,7 +189,7 @@ cc_test( ...@@ -189,7 +189,7 @@ cc_test(
deps = [ deps = [
":distributions", ":distributions",
":random", ":random",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/numeric:representation", "//absl/numeric:representation",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
...@@ -244,7 +244,7 @@ cc_test( ...@@ -244,7 +244,7 @@ cc_test(
deps = [ deps = [
":distributions", ":distributions",
":random", ":random",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
"//absl/random/internal:sequence_urbg", "//absl/random/internal:sequence_urbg",
...@@ -265,7 +265,7 @@ cc_test( ...@@ -265,7 +265,7 @@ cc_test(
deps = [ deps = [
":distributions", ":distributions",
":random", ":random",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
"//absl/random/internal:sequence_urbg", "//absl/random/internal:sequence_urbg",
...@@ -292,8 +292,8 @@ cc_test( ...@@ -292,8 +292,8 @@ cc_test(
":distributions", ":distributions",
":random", ":random",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal",
"//absl/container:flat_hash_map", "//absl/container:flat_hash_map",
"//absl/log",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
"//absl/random/internal:sequence_urbg", "//absl/random/internal:sequence_urbg",
...@@ -314,7 +314,7 @@ cc_test( ...@@ -314,7 +314,7 @@ cc_test(
":distributions", ":distributions",
":random", ":random",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/numeric:representation", "//absl/numeric:representation",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
...@@ -338,7 +338,7 @@ cc_test( ...@@ -338,7 +338,7 @@ cc_test(
":distributions", ":distributions",
":random", ":random",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/numeric:representation", "//absl/numeric:representation",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:sequence_urbg", "//absl/random/internal:sequence_urbg",
...@@ -360,7 +360,7 @@ cc_test( ...@@ -360,7 +360,7 @@ cc_test(
deps = [ deps = [
":distributions", ":distributions",
":random", ":random",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
"//absl/random/internal:sequence_urbg", "//absl/random/internal:sequence_urbg",
...@@ -385,7 +385,7 @@ cc_test( ...@@ -385,7 +385,7 @@ cc_test(
deps = [ deps = [
":distributions", ":distributions",
":random", ":random",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/numeric:representation", "//absl/numeric:representation",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
...@@ -406,7 +406,7 @@ cc_test( ...@@ -406,7 +406,7 @@ cc_test(
deps = [ deps = [
":distributions", ":distributions",
":random", ":random",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/random/internal:distribution_test_util", "//absl/random/internal:distribution_test_util",
"//absl/random/internal:pcg_engine", "//absl/random/internal:pcg_engine",
"//absl/random/internal:sequence_urbg", "//absl/random/internal:sequence_urbg",
......
...@@ -260,13 +260,13 @@ absl_cc_test( ...@@ -260,13 +260,13 @@ absl_cc_test(
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::log
absl::numeric_representation absl::numeric_representation
absl::random_distributions absl::random_distributions
absl::random_random absl::random_random
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::random_internal_pcg_engine absl::random_internal_pcg_engine
absl::raw_logging_internal
absl::strings absl::strings
absl::str_format absl::str_format
GTest::gmock GTest::gmock
...@@ -299,6 +299,7 @@ absl_cc_test( ...@@ -299,6 +299,7 @@ absl_cc_test(
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_distributions absl::random_distributions
absl::random_random absl::random_random
absl::raw_logging_internal absl::raw_logging_internal
...@@ -315,12 +316,13 @@ absl_cc_test( ...@@ -315,12 +316,13 @@ absl_cc_test(
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::log
absl::random_distributions absl::random_distributions
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_pcg_engine absl::random_internal_pcg_engine
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::random_random absl::random_random
absl::raw_logging_internal
absl::strings absl::strings
absl::str_format absl::str_format
GTest::gmock GTest::gmock
...@@ -337,12 +339,12 @@ absl_cc_test( ...@@ -337,12 +339,12 @@ absl_cc_test(
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::log
absl::random_distributions absl::random_distributions
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_pcg_engine absl::random_internal_pcg_engine
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::random_random absl::random_random
absl::raw_logging_internal
absl::strings absl::strings
GTest::gmock GTest::gmock
GTest::gtest_main GTest::gtest_main
...@@ -362,10 +364,10 @@ absl_cc_test( ...@@ -362,10 +364,10 @@ absl_cc_test(
absl::random_random absl::random_random
absl::core_headers absl::core_headers
absl::flat_hash_map absl::flat_hash_map
absl::log
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_pcg_engine absl::random_internal_pcg_engine
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::raw_logging_internal
absl::strings absl::strings
absl::str_format absl::str_format
GTest::gmock GTest::gmock
...@@ -383,13 +385,13 @@ absl_cc_test( ...@@ -383,13 +385,13 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::core_headers absl::core_headers
absl::log
absl::numeric_representation absl::numeric_representation
absl::random_distributions absl::random_distributions
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_pcg_engine absl::random_internal_pcg_engine
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::random_random absl::random_random
absl::raw_logging_internal
absl::strings absl::strings
absl::str_format absl::str_format
GTest::gmock GTest::gmock
...@@ -407,12 +409,12 @@ absl_cc_test( ...@@ -407,12 +409,12 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::core_headers absl::core_headers
absl::log
absl::numeric_representation absl::numeric_representation
absl::random_distributions absl::random_distributions
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::random_random absl::random_random
absl::raw_logging_internal
absl::strings absl::strings
absl::str_format absl::str_format
GTest::gmock GTest::gmock
...@@ -429,12 +431,12 @@ absl_cc_test( ...@@ -429,12 +431,12 @@ absl_cc_test(
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::log
absl::random_distributions absl::random_distributions
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_pcg_engine absl::random_internal_pcg_engine
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::random_random absl::random_random
absl::raw_logging_internal
absl::strings absl::strings
GTest::gmock GTest::gmock
GTest::gtest_main GTest::gtest_main
...@@ -450,6 +452,7 @@ absl_cc_test( ...@@ -450,6 +452,7 @@ absl_cc_test(
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::log
absl::numeric_representation absl::numeric_representation
absl::random_distributions absl::random_distributions
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
...@@ -471,12 +474,12 @@ absl_cc_test( ...@@ -471,12 +474,12 @@ absl_cc_test(
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::log
absl::random_distributions absl::random_distributions
absl::random_internal_distribution_test_util absl::random_internal_distribution_test_util
absl::random_internal_pcg_engine absl::random_internal_pcg_engine
absl::random_internal_sequence_urbg absl::random_internal_sequence_urbg
absl::random_random absl::random_random
absl::raw_logging_internal
absl::strings absl::strings
GTest::gmock GTest::gmock
GTest::gtest_main GTest::gtest_main
...@@ -1090,9 +1093,9 @@ absl_cc_test( ...@@ -1090,9 +1093,9 @@ absl_cc_test(
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::log
absl::random_internal_explicit_seed_seq absl::random_internal_explicit_seed_seq
absl::random_internal_randen_engine absl::random_internal_randen_engine
absl::raw_logging_internal
absl::strings absl::strings
absl::time absl::time
GTest::gmock GTest::gmock
...@@ -1142,10 +1145,10 @@ absl_cc_test( ...@@ -1142,10 +1145,10 @@ absl_cc_test(
LINKOPTS LINKOPTS
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
DEPS DEPS
absl::log
absl::random_internal_platform absl::random_internal_platform
absl::random_internal_randen_hwaes absl::random_internal_randen_hwaes
absl::random_internal_randen_hwaes_impl absl::random_internal_randen_hwaes_impl
absl::raw_logging_internal
absl::str_format absl::str_format
GTest::gmock GTest::gmock
GTest::gtest GTest::gtest
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/numeric/internal/representation.h" #include "absl/numeric/internal/representation.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
...@@ -107,8 +107,8 @@ TYPED_TEST(BetaDistributionInterfaceTest, SerializeTest) { ...@@ -107,8 +107,8 @@ TYPED_TEST(BetaDistributionInterfaceTest, SerializeTest) {
}; };
for (TypeParam alpha : kValues) { for (TypeParam alpha : kValues) {
for (TypeParam beta : kValues) { for (TypeParam beta : kValues) {
ABSL_INTERNAL_LOG( LOG(INFO) << absl::StreamFormat("Smoke test for Beta(%a, %a)", alpha,
INFO, absl::StrFormat("Smoke test for Beta(%a, %a)", alpha, beta)); beta);
param_type param(alpha, beta); param_type param(alpha, beta);
absl::beta_distribution<TypeParam> before(alpha, beta); absl::beta_distribution<TypeParam> before(alpha, beta);
...@@ -327,15 +327,13 @@ bool BetaDistributionTest::SingleZTestOnMeanAndVariance(double p, ...@@ -327,15 +327,13 @@ bool BetaDistributionTest::SingleZTestOnMeanAndVariance(double p,
absl::random_internal::Near("z", z_mean, 0.0, max_err) && absl::random_internal::Near("z", z_mean, 0.0, max_err) &&
absl::random_internal::Near("z_variance", z_variance, 0.0, max_err); absl::random_internal::Near("z_variance", z_variance, 0.0, max_err);
if (!pass) { if (!pass) {
ABSL_INTERNAL_LOG( LOG(INFO) << "Beta(" << alpha_ << ", " << beta_ << "), mean: sample "
INFO, << m.mean << ", expect " << Mean() << ", which is "
absl::StrFormat( << std::abs(m.mean - Mean()) / mean_stddev
"Beta(%f, %f), " << " stddevs away, variance: sample " << m.variance << ", expect "
"mean: sample %f, expect %f, which is %f stddevs away, " << Variance() << ", which is "
"variance: sample %f, expect %f, which is %f stddevs away.", << std::abs(m.variance - Variance()) / variance_stddev
alpha_, beta_, m.mean, Mean(), << " stddevs away.";
std::abs(m.mean - Mean()) / mean_stddev, m.variance, Variance(),
std::abs(m.variance - Variance()) / variance_stddev));
} }
return pass; return pass;
} }
...@@ -396,18 +394,15 @@ bool BetaDistributionTest::SingleChiSquaredTest(double p, size_t samples, ...@@ -396,18 +394,15 @@ bool BetaDistributionTest::SingleChiSquaredTest(double p, size_t samples,
const bool pass = const bool pass =
(absl::random_internal::ChiSquarePValue(chi_square, dof) >= p); (absl::random_internal::ChiSquarePValue(chi_square, dof) >= p);
if (!pass) { if (!pass) {
for (int i = 0; i < cutoffs.size(); i++) { for (size_t i = 0; i < cutoffs.size(); i++) {
ABSL_INTERNAL_LOG( LOG(INFO) << "cutoff[" << i << "] = " << cutoffs[i] << ", actual count "
INFO, absl::StrFormat("cutoff[%d] = %f, actual count %d, expected %d", << counts[i] << ", expected " << static_cast<int>(expected[i]);
i, cutoffs[i], counts[i],
static_cast<int>(expected[i])));
} }
ABSL_INTERNAL_LOG( LOG(INFO) << "Beta(" << alpha_ << ", " << beta_ << ") "
INFO, absl::StrFormat( << absl::random_internal::kChiSquared << " " << chi_square
"Beta(%f, %f) %s %f, p = %f", alpha_, beta_, << ", p = "
absl::random_internal::kChiSquared, chi_square, << absl::random_internal::ChiSquarePValue(chi_square, dof);
absl::random_internal::ChiSquarePValue(chi_square, dof)));
} }
return pass; return pass;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
#include "absl/random/internal/pcg_engine.h" #include "absl/random/internal/pcg_engine.h"
...@@ -194,7 +194,7 @@ TEST(DiscreteDistributionTest, ChiSquaredTest50) { ...@@ -194,7 +194,7 @@ TEST(DiscreteDistributionTest, ChiSquaredTest50) {
absl::StrAppend(&msg, kChiSquared, " p-value ", p_value, "\n"); absl::StrAppend(&msg, kChiSquared, " p-value ", p_value, "\n");
absl::StrAppend(&msg, "High ", kChiSquared, " value: ", chi_square, " > ", absl::StrAppend(&msg, "High ", kChiSquared, " value: ", chi_square, " > ",
kThreshold); kThreshold);
ABSL_RAW_LOG(INFO, "%s", msg.c_str()); LOG(INFO) << msg;
FAIL() << msg; FAIL() << msg;
} }
} }
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h" #include "absl/base/macros.h"
#include "absl/log/log.h"
#include "absl/numeric/internal/representation.h" #include "absl/numeric/internal/representation.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
...@@ -115,9 +115,8 @@ TYPED_TEST(ExponentialDistributionTypedTest, SerializeTest) { ...@@ -115,9 +115,8 @@ TYPED_TEST(ExponentialDistributionTypedTest, SerializeTest) {
if (sample < sample_min) sample_min = sample; if (sample < sample_min) sample_min = sample;
} }
if (!std::is_same<TypeParam, long double>::value) { if (!std::is_same<TypeParam, long double>::value) {
ABSL_INTERNAL_LOG(INFO, LOG(INFO) << "Range {" << lambda << "}: " << sample_min << ", "
absl::StrFormat("Range {%f}: %f, %f, lambda=%f", lambda, << sample_max << ", lambda=" << lambda;
sample_min, sample_max, lambda));
} }
std::stringstream ss; std::stringstream ss;
...@@ -219,17 +218,16 @@ bool ExponentialDistributionTests::SingleZTest(const double p, ...@@ -219,17 +218,16 @@ bool ExponentialDistributionTests::SingleZTest(const double p,
const bool pass = absl::random_internal::Near("z", z, 0.0, max_err); const bool pass = absl::random_internal::Near("z", z, 0.0, max_err);
if (!pass) { if (!pass) {
ABSL_INTERNAL_LOG( // clang-format off
INFO, absl::StrFormat("p=%f max_err=%f\n" LOG(INFO)
" lambda=%f\n" << "p=" << p << " max_err=" << max_err << "\n"
" mean=%f vs. %f\n" " lambda=" << lambda() << "\n"
" stddev=%f vs. %f\n" " mean=" << m.mean << " vs. " << mean() << "\n"
" skewness=%f vs. %f\n" " stddev=" << std::sqrt(m.variance) << " vs. " << stddev() << "\n"
" kurtosis=%f vs. %f\n" " skewness=" << m.skewness << " vs. " << skew() << "\n"
" z=%f vs. 0", " kurtosis=" << m.kurtosis << " vs. " << kurtosis() << "\n"
p, max_err, lambda(), m.mean, mean(), " z=" << z << " vs. 0";
std::sqrt(m.variance), stddev(), m.skewness, // clang-format on
skew(), m.kurtosis, kurtosis(), z));
} }
return pass; return pass;
} }
...@@ -274,16 +272,16 @@ double ExponentialDistributionTests::SingleChiSquaredTest() { ...@@ -274,16 +272,16 @@ double ExponentialDistributionTests::SingleChiSquaredTest() {
double p = absl::random_internal::ChiSquarePValue(chi_square, dof); double p = absl::random_internal::ChiSquarePValue(chi_square, dof);
if (chi_square > threshold) { if (chi_square > threshold) {
for (int i = 0; i < cutoffs.size(); i++) { for (size_t i = 0; i < cutoffs.size(); i++) {
ABSL_INTERNAL_LOG( LOG(INFO) << i << " : (" << cutoffs[i] << ") = " << counts[i];
INFO, absl::StrFormat("%d : (%f) = %d", i, cutoffs[i], counts[i]));
} }
ABSL_INTERNAL_LOG(INFO, // clang-format off
absl::StrCat("lambda ", lambda(), "\n", // LOG(INFO) << "lambda " << lambda() << "\n"
" expected ", expected, "\n", // " expected " << expected << "\n"
kChiSquared, " ", chi_square, " (", p, ")\n", << kChiSquared << " " << chi_square << " (" << p << ")\n"
kChiSquared, " @ 0.98 = ", threshold)); << kChiSquared << " @ 0.98 = " << threshold;
// clang-format on
} }
return p; return p;
} }
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h" #include "absl/base/macros.h"
#include "absl/log/log.h"
#include "absl/numeric/internal/representation.h" #include "absl/numeric/internal/representation.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
...@@ -116,9 +116,8 @@ TYPED_TEST(GaussianDistributionInterfaceTest, SerializeTest) { ...@@ -116,9 +116,8 @@ TYPED_TEST(GaussianDistributionInterfaceTest, SerializeTest) {
EXPECT_LE(sample, before.max()) << before; EXPECT_LE(sample, before.max()) << before;
} }
if (!std::is_same<TypeParam, long double>::value) { if (!std::is_same<TypeParam, long double>::value) {
ABSL_INTERNAL_LOG( LOG(INFO) << "Range{" << mean << ", " << stddev << "}: " << sample_min
INFO, absl::StrFormat("Range{%f, %f}: %f, %f", mean, stddev, << ", " << sample_max;
sample_min, sample_max));
} }
std::stringstream ss; std::stringstream ss;
...@@ -240,17 +239,16 @@ bool GaussianDistributionTests::SingleZTest(const double p, ...@@ -240,17 +239,16 @@ bool GaussianDistributionTests::SingleZTest(const double p,
(std::pow(m.skewness, 2.0) + std::pow(m.kurtosis - 3.0, 2.0) / 4.0); (std::pow(m.skewness, 2.0) + std::pow(m.kurtosis - 3.0, 2.0) / 4.0);
if (!pass || jb > 9.21) { if (!pass || jb > 9.21) {
ABSL_INTERNAL_LOG( // clang-format off
INFO, absl::StrFormat("p=%f max_err=%f\n" LOG(INFO)
" mean=%f vs. %f\n" << "p=" << p << " max_err=" << max_err << "\n"
" stddev=%f vs. %f\n" " mean=" << m.mean << " vs. " << mean() << "\n"
" skewness=%f vs. %f\n" " stddev=" << std::sqrt(m.variance) << " vs. " << stddev() << "\n"
" kurtosis=%f vs. %f\n" " skewness=" << m.skewness << " vs. " << skew() << "\n"
" z=%f vs. 0\n" " kurtosis=" << m.kurtosis << " vs. " << kurtosis() << "\n"
" jb=%f vs. 9.21", " z=" << z << " vs. 0\n"
p, max_err, m.mean, mean(), std::sqrt(m.variance), " jb=" << jb << " vs. 9.21";
stddev(), m.skewness, skew(), m.kurtosis, // clang-format on
kurtosis(), z, jb));
} }
return pass; return pass;
} }
...@@ -297,16 +295,16 @@ double GaussianDistributionTests::SingleChiSquaredTest() { ...@@ -297,16 +295,16 @@ double GaussianDistributionTests::SingleChiSquaredTest() {
// Log if the chi_square value is above the threshold. // Log if the chi_square value is above the threshold.
if (chi_square > threshold) { if (chi_square > threshold) {
for (int i = 0; i < cutoffs.size(); i++) { for (size_t i = 0; i < cutoffs.size(); i++) {
ABSL_INTERNAL_LOG( LOG(INFO) << i << " : (" << cutoffs[i] << ") = " << counts[i];
INFO, absl::StrFormat("%d : (%f) = %d", i, cutoffs[i], counts[i]));
} }
ABSL_INTERNAL_LOG( // clang-format off
INFO, absl::StrCat("mean=", mean(), " stddev=", stddev(), "\n", // LOG(INFO) << "mean=" << mean() << " stddev=" << stddev() << "\n"
" expected ", expected, "\n", // " expected " << expected << "\n"
kChiSquared, " ", chi_square, " (", p, ")\n", // << kChiSquared << " " << chi_square << " (" << p << ")\n"
kChiSquared, " @ 0.98 = ", threshold)); << kChiSquared << " @ 0.98 = " << threshold;
// clang-format on
} }
return p; return p;
} }
......
...@@ -601,7 +601,7 @@ cc_test( ...@@ -601,7 +601,7 @@ cc_test(
deps = [ deps = [
":explicit_seed_seq", ":explicit_seed_seq",
":randen_engine", ":randen_engine",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/strings", "//absl/strings",
"//absl/time", "//absl/time",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
...@@ -646,7 +646,7 @@ cc_test( ...@@ -646,7 +646,7 @@ cc_test(
":platform", ":platform",
":randen_hwaes", ":randen_hwaes",
":randen_hwaes_impl", # build_cleaner: keep ":randen_hwaes_impl", # build_cleaner: keep
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/strings:str_format", "//absl/strings:str_format",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
...@@ -707,8 +707,10 @@ cc_test( ...@@ -707,8 +707,10 @@ cc_test(
], ],
deps = [ deps = [
":nanobenchmark", ":nanobenchmark",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/log:check",
"//absl/strings", "//absl/strings",
"//absl/strings:str_format",
], ],
) )
......
...@@ -14,8 +14,10 @@ ...@@ -14,8 +14,10 @@
#include "absl/random/internal/nanobenchmark.h" #include "absl/random/internal/nanobenchmark.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/numbers.h" #include "absl/strings/numbers.h"
#include "absl/strings/str_format.h"
namespace absl { namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
...@@ -36,16 +38,16 @@ void MeasureDiv(const FuncInput (&inputs)[N]) { ...@@ -36,16 +38,16 @@ void MeasureDiv(const FuncInput (&inputs)[N]) {
params.max_evals = 6; // avoid test timeout params.max_evals = 6; // avoid test timeout
const size_t num_results = Measure(&Div, nullptr, inputs, N, results, params); const size_t num_results = Measure(&Div, nullptr, inputs, N, results, params);
if (num_results == 0) { if (num_results == 0) {
ABSL_RAW_LOG( LOG(WARNING)
WARNING, << "WARNING: Measurement failed, should not happen when using "
"WARNING: Measurement failed, should not happen when using " "PinThreadToCPU unless the region to measure takes > 1 second.";
"PinThreadToCPU unless the region to measure takes > 1 second.\n");
return; return;
} }
for (size_t i = 0; i < num_results; ++i) { for (size_t i = 0; i < num_results; ++i) {
ABSL_RAW_LOG(INFO, "%5zu: %6.2f ticks; MAD=%4.2f%%\n", results[i].input, LOG(INFO) << absl::StreamFormat("%5u: %6.2f ticks; MAD=%4.2f%%\n",
results[i].ticks, results[i].variability * 100.0); results[i].input, results[i].ticks,
ABSL_RAW_CHECK(results[i].ticks != 0.0f, "Zero duration"); results[i].variability * 100.0);
CHECK_NE(results[i].ticks, 0.0f) << "Zero duration";
} }
} }
...@@ -54,7 +56,7 @@ void RunAll(const int argc, char* argv[]) { ...@@ -54,7 +56,7 @@ void RunAll(const int argc, char* argv[]) {
int cpu = -1; int cpu = -1;
if (argc == 2) { if (argc == 2) {
if (!absl::SimpleAtoi(argv[1], &cpu)) { if (!absl::SimpleAtoi(argv[1], &cpu)) {
ABSL_RAW_LOG(FATAL, "The optional argument must be a CPU number >= 0.\n"); LOG(FATAL) << "The optional argument must be a CPU number >= 0.";
} }
} }
PinThreadToCPU(cpu); PinThreadToCPU(cpu);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/random/internal/explicit_seed_seq.h" #include "absl/random/internal/explicit_seed_seq.h"
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
#include "absl/time/clock.h" #include "absl/time/clock.h"
...@@ -645,9 +645,8 @@ TEST(RandenTest, IsFastOrSlow) { ...@@ -645,9 +645,8 @@ TEST(RandenTest, IsFastOrSlow) {
} }
auto duration = absl::GetCurrentTimeNanos() - start; auto duration = absl::GetCurrentTimeNanos() - start;
ABSL_INTERNAL_LOG(INFO, absl::StrCat(static_cast<double>(duration) / LOG(INFO) << static_cast<double>(duration) / static_cast<double>(kCount)
static_cast<double>(kCount), << "ns";
"ns"));
EXPECT_GT(sum, 0); EXPECT_GT(sum, 0);
EXPECT_GE(duration, kCount); // Should be slower than 1ns per call. EXPECT_GE(duration, kCount); // Should be slower than 1ns per call.
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/random/internal/platform.h" #include "absl/random/internal/platform.h"
#include "absl/random/internal/randen_detect.h" #include "absl/random/internal/randen_detect.h"
#include "absl/random/internal/randen_traits.h" #include "absl/random/internal/randen_traits.h"
...@@ -67,32 +67,32 @@ TEST(RandenHwAesTest, Default) { ...@@ -67,32 +67,32 @@ TEST(RandenHwAesTest, Default) {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
ABSL_RAW_LOG(INFO, "ABSL_HAVE_ACCELERATED_AES=%d", ABSL_HAVE_ACCELERATED_AES); LOG(INFO) << "ABSL_HAVE_ACCELERATED_AES=" << ABSL_HAVE_ACCELERATED_AES;
ABSL_RAW_LOG(INFO, "ABSL_RANDOM_INTERNAL_AES_DISPATCH=%d", LOG(INFO) << "ABSL_RANDOM_INTERNAL_AES_DISPATCH="
ABSL_RANDOM_INTERNAL_AES_DISPATCH); << ABSL_RANDOM_INTERNAL_AES_DISPATCH;
#if defined(ABSL_ARCH_X86_64) #if defined(ABSL_ARCH_X86_64)
ABSL_RAW_LOG(INFO, "ABSL_ARCH_X86_64"); LOG(INFO) << "ABSL_ARCH_X86_64";
#elif defined(ABSL_ARCH_X86_32) #elif defined(ABSL_ARCH_X86_32)
ABSL_RAW_LOG(INFO, "ABSL_ARCH_X86_32"); LOG(INFO) << "ABSL_ARCH_X86_32";
#elif defined(ABSL_ARCH_AARCH64) #elif defined(ABSL_ARCH_AARCH64)
ABSL_RAW_LOG(INFO, "ABSL_ARCH_AARCH64"); LOG(INFO) << "ABSL_ARCH_AARCH64";
#elif defined(ABSL_ARCH_ARM) #elif defined(ABSL_ARCH_ARM)
ABSL_RAW_LOG(INFO, "ABSL_ARCH_ARM"); LOG(INFO) << "ABSL_ARCH_ARM";
#elif defined(ABSL_ARCH_PPC) #elif defined(ABSL_ARCH_PPC)
ABSL_RAW_LOG(INFO, "ABSL_ARCH_PPC"); LOG(INFO) << "ABSL_ARCH_PPC";
#else #else
ABSL_RAW_LOG(INFO, "ARCH Unknown"); LOG(INFO) << "ARCH Unknown";
#endif #endif
int x = absl::random_internal::HasRandenHwAesImplementation(); int x = absl::random_internal::HasRandenHwAesImplementation();
ABSL_RAW_LOG(INFO, "HasRandenHwAesImplementation = %d", x); LOG(INFO) << "HasRandenHwAesImplementation = " << x;
int y = absl::random_internal::CPUSupportsRandenHwAes(); int y = absl::random_internal::CPUSupportsRandenHwAes();
ABSL_RAW_LOG(INFO, "CPUSupportsRandenHwAes = %d", x); LOG(INFO) << "CPUSupportsRandenHwAes = " << x;
if (!x || !y) { if (!x || !y) {
ABSL_RAW_LOG(INFO, "Skipping Randen HWAES tests."); LOG(INFO) << "Skipping Randen HWAES tests.";
return 0; return 0;
} }
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
#include "absl/random/internal/pcg_engine.h" #include "absl/random/internal/pcg_engine.h"
...@@ -108,8 +108,7 @@ TYPED_TEST(LogUniformIntDistributionTypeTest, SerializeTest) { ...@@ -108,8 +108,7 @@ TYPED_TEST(LogUniformIntDistributionTypeTest, SerializeTest) {
if (sample > sample_max) sample_max = sample; if (sample > sample_max) sample_max = sample;
if (sample < sample_min) sample_min = sample; if (sample < sample_min) sample_min = sample;
} }
ABSL_INTERNAL_LOG(INFO, LOG(INFO) << "Range: " << sample_min << ", " << sample_max;
absl::StrCat("Range: ", +sample_min, ", ", +sample_max));
} }
} }
...@@ -182,16 +181,14 @@ double LogUniformIntChiSquaredTest::ChiSquaredTestImpl() { ...@@ -182,16 +181,14 @@ double LogUniformIntChiSquaredTest::ChiSquaredTestImpl() {
const double p = absl::random_internal::ChiSquarePValue(chi_square, dof); const double p = absl::random_internal::ChiSquarePValue(chi_square, dof);
if (chi_square > threshold) { if (chi_square > threshold) {
ABSL_INTERNAL_LOG(INFO, "values"); LOG(INFO) << "values";
for (size_t i = 0; i < buckets.size(); i++) { for (size_t i = 0; i < buckets.size(); i++) {
ABSL_INTERNAL_LOG(INFO, absl::StrCat(i, ": ", buckets[i])); LOG(INFO) << i << ": " << buckets[i];
} }
ABSL_INTERNAL_LOG(INFO, LOG(INFO) << "trials=" << trials << "\n"
absl::StrFormat("trials=%d\n" << kChiSquared << "(data, " << dof << ") = " << chi_square << " ("
"%s(data, %d) = %f (%f)\n" << p << ")\n"
"%s @ 0.98 = %f", << kChiSquared << " @ 0.98 = " << threshold;
trials, kChiSquared, dof, chi_square, p,
kChiSquared, threshold));
} }
return p; return p;
} }
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h" #include "absl/base/macros.h"
#include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_map.h"
#include "absl/log/log.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
#include "absl/random/internal/pcg_engine.h" #include "absl/random/internal/pcg_engine.h"
...@@ -134,8 +134,8 @@ TYPED_TEST(PoissonDistributionInterfaceTest, SerializeTest) { ...@@ -134,8 +134,8 @@ TYPED_TEST(PoissonDistributionInterfaceTest, SerializeTest) {
if (sample < sample_min) sample_min = sample; if (sample < sample_min) sample_min = sample;
} }
ABSL_INTERNAL_LOG(INFO, absl::StrCat("Range {", param.mean(), "}: ", LOG(INFO) << "Range {" << param.mean() << "}: " << sample_min << ", "
+sample_min, ", ", +sample_max)); << sample_max;
// Validate stream serialization. // Validate stream serialization.
std::stringstream ss; std::stringstream ss;
...@@ -188,10 +188,9 @@ class PoissonModel { ...@@ -188,10 +188,9 @@ class PoissonModel {
} }
void LogCDF() { void LogCDF() {
ABSL_INTERNAL_LOG(INFO, absl::StrCat("CDF (mean = ", mean_, ")")); LOG(INFO) << "CDF (mean = " << mean_ << ")";
for (const auto c : cdf_) { for (const auto c : cdf_) {
ABSL_INTERNAL_LOG(INFO, LOG(INFO) << c.index << ": pmf=" << c.pmf << " cdf=" << c.cdf;
absl::StrCat(c.index, ": pmf=", c.pmf, " cdf=", c.cdf));
} }
} }
...@@ -286,16 +285,15 @@ bool PoissonDistributionZTest::SingleZTest(const double p, ...@@ -286,16 +285,15 @@ bool PoissonDistributionZTest::SingleZTest(const double p,
const bool pass = absl::random_internal::Near("z", z, 0.0, max_err); const bool pass = absl::random_internal::Near("z", z, 0.0, max_err);
if (!pass) { if (!pass) {
ABSL_INTERNAL_LOG( // clang-format off
INFO, absl::StrFormat("p=%f max_err=%f\n" LOG(INFO)
" mean=%f vs. %f\n" << "p=" << p << " max_err=" << max_err << "\n"
" stddev=%f vs. %f\n" " mean=" << m.mean << " vs. " << mean() << "\n"
" skewness=%f vs. %f\n" " stddev=" << std::sqrt(m.variance) << " vs. " << stddev() << "\n"
" kurtosis=%f vs. %f\n" " skewness=" << m.skewness << " vs. " << skew() << "\n"
" z=%f", " kurtosis=" << m.kurtosis << " vs. " << kurtosis() << "\n"
p, max_err, m.mean, mean(), std::sqrt(m.variance), " z=" << z;
stddev(), m.skewness, skew(), m.kurtosis, // clang-format on
kurtosis(), z));
} }
return pass; return pass;
} }
...@@ -439,17 +437,16 @@ double PoissonDistributionChiSquaredTest::ChiSquaredTestImpl() { ...@@ -439,17 +437,16 @@ double PoissonDistributionChiSquaredTest::ChiSquaredTestImpl() {
if (chi_square > threshold) { if (chi_square > threshold) {
LogCDF(); LogCDF();
ABSL_INTERNAL_LOG(INFO, absl::StrCat("VALUES buckets=", counts.size(), LOG(INFO) << "VALUES buckets=" << counts.size()
" samples=", kSamples)); << " samples=" << kSamples;
for (size_t i = 0; i < counts.size(); i++) { for (size_t i = 0; i < counts.size(); i++) {
ABSL_INTERNAL_LOG( LOG(INFO) << cutoffs_[i] << ": " << counts[i] << " vs. E=" << e[i];
INFO, absl::StrCat(cutoffs_[i], ": ", counts[i], " vs. E=", e[i]));
} }
ABSL_INTERNAL_LOG( LOG(INFO) << kChiSquared << "(data, dof=" << dof << ") = " << chi_square
INFO, << " (" << p << ")\n"
absl::StrCat(kChiSquared, "(data, dof=", dof, ") = ", chi_square, " (", << " vs.\n"
p, ")\n", " vs.\n", kChiSquared, " @ 0.98 = ", threshold)); << kChiSquared << " @ 0.98 = " << threshold;
} }
return p; return p;
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
#include "absl/random/internal/pcg_engine.h" #include "absl/random/internal/pcg_engine.h"
...@@ -107,8 +107,7 @@ TYPED_TEST(UniformIntDistributionTest, ParamSerializeTest) { ...@@ -107,8 +107,7 @@ TYPED_TEST(UniformIntDistributionTest, ParamSerializeTest) {
sample_min = sample; sample_min = sample;
} }
} }
std::string msg = absl::StrCat("Range: ", +sample_min, ", ", +sample_max); LOG(INFO) << "Range: " << sample_min << ", " << sample_max;
ABSL_RAW_LOG(INFO, "%s", msg.c_str());
} }
} }
...@@ -210,7 +209,7 @@ TYPED_TEST(UniformIntDistributionTest, ChiSquaredTest50) { ...@@ -210,7 +209,7 @@ TYPED_TEST(UniformIntDistributionTest, ChiSquaredTest50) {
absl::StrAppend(&msg, kChiSquared, " p-value ", p_value, "\n"); absl::StrAppend(&msg, kChiSquared, " p-value ", p_value, "\n");
absl::StrAppend(&msg, "High ", kChiSquared, " value: ", chi_square, " > ", absl::StrAppend(&msg, "High ", kChiSquared, " value: ", chi_square, " > ",
kThreshold); kThreshold);
ABSL_RAW_LOG(INFO, "%s", msg.c_str()); LOG(INFO) << msg;
FAIL() << msg; FAIL() << msg;
} }
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/numeric/internal/representation.h" #include "absl/numeric/internal/representation.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/distribution_test_util.h" #include "absl/random/internal/distribution_test_util.h"
...@@ -182,9 +182,8 @@ TYPED_TEST(UniformRealDistributionTest, ParamSerializeTest) { ...@@ -182,9 +182,8 @@ TYPED_TEST(UniformRealDistributionTest, ParamSerializeTest) {
if (!std::is_same<real_type, long double>::value) { if (!std::is_same<real_type, long double>::value) {
// static_cast<double>(long double) can overflow. // static_cast<double>(long double) can overflow.
std::string msg = absl::StrCat("Range: ", static_cast<double>(sample_min), LOG(INFO) << "Range: " << static_cast<double>(sample_min) << ", "
", ", static_cast<double>(sample_max)); << static_cast<double>(sample_max);
ABSL_RAW_LOG(INFO, "%s", msg.c_str());
} }
} }
} }
...@@ -324,7 +323,7 @@ TYPED_TEST(UniformRealDistributionTest, ChiSquaredTest50) { ...@@ -324,7 +323,7 @@ TYPED_TEST(UniformRealDistributionTest, ChiSquaredTest50) {
absl::StrAppend(&msg, kChiSquared, " p-value ", p_value, "\n"); absl::StrAppend(&msg, kChiSquared, " p-value ", p_value, "\n");
absl::StrAppend(&msg, "High ", kChiSquared, " value: ", chi_square, " > ", absl::StrAppend(&msg, "High ", kChiSquared, " value: ", chi_square, " > ",
kThreshold); kThreshold);
ABSL_RAW_LOG(INFO, "%s", msg.c_str()); LOG(INFO) << msg;
FAIL() << msg; FAIL() << msg;
} }
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/random/internal/chi_square.h" #include "absl/random/internal/chi_square.h"
#include "absl/random/internal/pcg_engine.h" #include "absl/random/internal/pcg_engine.h"
#include "absl/random/internal/sequence_urbg.h" #include "absl/random/internal/sequence_urbg.h"
...@@ -102,8 +102,7 @@ TYPED_TEST(ZipfDistributionTypedTest, SerializeTest) { ...@@ -102,8 +102,7 @@ TYPED_TEST(ZipfDistributionTypedTest, SerializeTest) {
if (sample > sample_max) sample_max = sample; if (sample > sample_max) sample_max = sample;
if (sample < sample_min) sample_min = sample; if (sample < sample_min) sample_min = sample;
} }
ABSL_INTERNAL_LOG(INFO, LOG(INFO) << "Range: " << sample_min << ", " << sample_max;
absl::StrCat("Range: ", +sample_min, ", ", +sample_max));
} }
} }
...@@ -303,18 +302,15 @@ TEST_P(ZipfTest, ChiSquaredTest) { ...@@ -303,18 +302,15 @@ TEST_P(ZipfTest, ChiSquaredTest) {
// Log if the chi_squared value is above the threshold. // Log if the chi_squared value is above the threshold.
if (chi_square > threshold) { if (chi_square > threshold) {
ABSL_INTERNAL_LOG(INFO, "values"); LOG(INFO) << "values";
for (size_t i = 0; i < expected.size(); i++) { for (size_t i = 0; i < expected.size(); i++) {
ABSL_INTERNAL_LOG(INFO, absl::StrCat(points[i], ": ", buckets[i], LOG(INFO) << points[i] << ": " << buckets[i] << " vs. E=" << expected[i];
" vs. E=", expected[i]));
} }
ABSL_INTERNAL_LOG(INFO, absl::StrCat("trials ", trials)); LOG(INFO) << "trials " << trials;
ABSL_INTERNAL_LOG(INFO, LOG(INFO) << "mean " << avg << " vs. expected " << mean();
absl::StrCat("mean ", avg, " vs. expected ", mean())); LOG(INFO) << kChiSquared << "(data, " << dof << ") = " << chi_square << " ("
ABSL_INTERNAL_LOG(INFO, absl::StrCat(kChiSquared, "(data, ", dof, ") = ", << p_actual << ")";
chi_square, " (", p_actual, ")")); LOG(INFO) << kChiSquared << " @ 0.9995 = " << threshold;
ABSL_INTERNAL_LOG(INFO,
absl::StrCat(kChiSquared, " @ 0.9995 = ", threshold));
FAIL() << kChiSquared << " value of " << chi_square FAIL() << kChiSquared << " value of " << chi_square
<< " is above the threshold."; << " is above the threshold.";
} }
......
...@@ -774,10 +774,10 @@ cc_test( ...@@ -774,10 +774,10 @@ cc_test(
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:endian", "//absl/base:endian",
"//absl/base:raw_logging_internal",
"//absl/container:fixed_array", "//absl/container:fixed_array",
"//absl/hash", "//absl/hash",
"//absl/log", "//absl/log",
"//absl/log:check",
"//absl/random", "//absl/random",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
...@@ -1019,7 +1019,7 @@ cc_test( ...@@ -1019,7 +1019,7 @@ cc_test(
":pow10_helper", ":pow10_helper",
":strings", ":strings",
"//absl/base:config", "//absl/base:config",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/random", "//absl/random",
"//absl/random:distributions", "//absl/random:distributions",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
...@@ -1096,7 +1096,7 @@ cc_test( ...@@ -1096,7 +1096,7 @@ cc_test(
deps = [ deps = [
":strings", ":strings",
"//absl/base:config", "//absl/base:config",
"//absl/base:raw_logging_internal", "//absl/log:check",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
) )
...@@ -1253,6 +1253,7 @@ cc_test( ...@@ -1253,6 +1253,7 @@ cc_test(
":strings", ":strings",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/base:raw_logging_internal",
"//absl/log",
"//absl/types:optional", "//absl/types:optional",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
......
...@@ -317,7 +317,7 @@ absl_cc_test( ...@@ -317,7 +317,7 @@ absl_cc_test(
absl::core_headers absl::core_headers
absl::pow10_helper absl::pow10_helper
absl::config absl::config
absl::raw_logging_internal absl::log
absl::random_random absl::random_random
absl::random_distributions absl::random_distributions
absl::strings_internal absl::strings_internal
...@@ -372,9 +372,9 @@ absl_cc_test( ...@@ -372,9 +372,9 @@ absl_cc_test(
COPTS COPTS
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
DEPS DEPS
absl::strings absl::check
absl::config absl::config
absl::raw_logging_internal absl::strings
GTest::gmock_main GTest::gmock_main
) )
...@@ -516,6 +516,7 @@ absl_cc_test( ...@@ -516,6 +516,7 @@ absl_cc_test(
absl::strings absl::strings
absl::str_format_internal absl::str_format_internal
absl::core_headers absl::core_headers
absl::log
absl::raw_logging_internal absl::raw_logging_internal
absl::int128 absl::int128
GTest::gmock_main GTest::gmock_main
...@@ -960,19 +961,20 @@ absl_cc_test( ...@@ -960,19 +961,20 @@ absl_cc_test(
COPTS COPTS
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
DEPS DEPS
absl::cord
absl::str_format
absl::strings
absl::base absl::base
absl::check
absl::config absl::config
absl::cord
absl::cord_test_helpers absl::cord_test_helpers
absl::cordz_test_helpers absl::cordz_test_helpers
absl::core_headers absl::core_headers
absl::endian absl::endian
absl::fixed_array
absl::hash absl::hash
absl::log
absl::random_random absl::random_random
absl::raw_logging_internal absl::str_format
absl::fixed_array absl::strings
GTest::gmock_main GTest::gmock_main
) )
......
...@@ -30,10 +30,11 @@ ...@@ -30,10 +30,11 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/config.h" #include "absl/base/config.h"
#include "absl/base/internal/endian.h" #include "absl/base/internal/endian.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h" #include "absl/base/macros.h"
#include "absl/container/fixed_array.h" #include "absl/container/fixed_array.h"
#include "absl/hash/hash.h" #include "absl/hash/hash.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/random/random.h" #include "absl/random/random.h"
#include "absl/strings/cord_test_helpers.h" #include "absl/strings/cord_test_helpers.h"
#include "absl/strings/cordz_test_helpers.h" #include "absl/strings/cordz_test_helpers.h"
...@@ -210,9 +211,8 @@ class CordTestPeer { ...@@ -210,9 +211,8 @@ class CordTestPeer {
} }
static Cord MakeSubstring(Cord src, size_t offset, size_t length) { static Cord MakeSubstring(Cord src, size_t offset, size_t length) {
ABSL_RAW_CHECK(src.contents_.is_tree(), "Can not be inlined"); CHECK(src.contents_.is_tree()) << "Can not be inlined";
ABSL_RAW_CHECK(src.ExpectedChecksum() == absl::nullopt, CHECK(!src.ExpectedChecksum().has_value()) << "Can not be hardened";
"Can not be hardened");
Cord cord; Cord cord;
auto* tree = cord_internal::SkipCrcNode(src.contents_.tree()); auto* tree = cord_internal::SkipCrcNode(src.contents_.tree());
auto* rep = CordRepSubstring::Create(CordRep::Ref(tree), offset, length); auto* rep = CordRepSubstring::Create(CordRep::Ref(tree), offset, length);
...@@ -374,7 +374,7 @@ TEST_P(CordTest, GigabyteCordFromExternal) { ...@@ -374,7 +374,7 @@ TEST_P(CordTest, GigabyteCordFromExternal) {
for (int i = 0; i < 1024; ++i) { for (int i = 0; i < 1024; ++i) {
c.Append(from); c.Append(from);
} }
ABSL_RAW_LOG(INFO, "Made a Cord with %zu bytes!", c.size()); LOG(INFO) << "Made a Cord with " << c.size() << " bytes!";
// Note: on a 32-bit build, this comes out to 2,818,048,000 bytes. // Note: on a 32-bit build, this comes out to 2,818,048,000 bytes.
// Note: on a 64-bit build, this comes out to 171,932,385,280 bytes. // Note: on a 64-bit build, this comes out to 171,932,385,280 bytes.
} }
...@@ -1247,15 +1247,15 @@ absl::Cord BigCord(size_t len, char v) { ...@@ -1247,15 +1247,15 @@ absl::Cord BigCord(size_t len, char v) {
// Splice block into cord. // Splice block into cord.
absl::Cord SpliceCord(const absl::Cord& blob, int64_t offset, absl::Cord SpliceCord(const absl::Cord& blob, int64_t offset,
const absl::Cord& block) { const absl::Cord& block) {
ABSL_RAW_CHECK(offset >= 0, ""); CHECK_GE(offset, 0);
ABSL_RAW_CHECK(offset + block.size() <= blob.size(), ""); CHECK_LE(static_cast<size_t>(offset) + block.size(), blob.size());
absl::Cord result(blob); absl::Cord result(blob);
result.RemoveSuffix(blob.size() - offset); result.RemoveSuffix(blob.size() - offset);
result.Append(block); result.Append(block);
absl::Cord suffix(blob); absl::Cord suffix(blob);
suffix.RemovePrefix(offset + block.size()); suffix.RemovePrefix(offset + block.size());
result.Append(suffix); result.Append(suffix);
ABSL_RAW_CHECK(blob.size() == result.size(), ""); CHECK_EQ(blob.size(), result.size());
return result; return result;
} }
...@@ -1855,7 +1855,7 @@ TEST(CordTest, CordMemoryUsageBTree) { ...@@ -1855,7 +1855,7 @@ TEST(CordTest, CordMemoryUsageBTree) {
// windows DLL, we may have ODR like effects on the flag, meaning the DLL // windows DLL, we may have ODR like effects on the flag, meaning the DLL
// code will run with the picked up default. // code will run with the picked up default.
if (!absl::CordTestPeer::Tree(cord1)->IsBtree()) { if (!absl::CordTestPeer::Tree(cord1)->IsBtree()) {
ABSL_RAW_LOG(WARNING, "Cord library code not respecting btree flag"); LOG(WARNING) << "Cord library code not respecting btree flag";
return; return;
} }
...@@ -1940,8 +1940,7 @@ TEST_P(CordTest, DiabolicalGrowth) { ...@@ -1940,8 +1940,7 @@ TEST_P(CordTest, DiabolicalGrowth) {
std::string value; std::string value;
absl::CopyCordToString(cord, &value); absl::CopyCordToString(cord, &value);
EXPECT_EQ(value, expected); EXPECT_EQ(value, expected);
ABSL_RAW_LOG(INFO, "Diabolical size allocated = %zu", LOG(INFO) << "Diabolical size allocated = " << cord.EstimatedMemoryUsage();
cord.EstimatedMemoryUsage());
} }
// The following tests check support for >4GB cords in 64-bit binaries, and // The following tests check support for >4GB cords in 64-bit binaries, and
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/check.h"
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
using absl::chars_format; using absl::chars_format;
...@@ -56,14 +56,14 @@ void ExpectParsedFloat(std::string s, absl::chars_format format_flags, ...@@ -56,14 +56,14 @@ void ExpectParsedFloat(std::string s, absl::chars_format format_flags,
begin_subrange = static_cast<int>(open_bracket_pos); begin_subrange = static_cast<int>(open_bracket_pos);
s.replace(open_bracket_pos, 1, ""); s.replace(open_bracket_pos, 1, "");
std::string::size_type close_bracket_pos = s.find(']'); std::string::size_type close_bracket_pos = s.find(']');
ABSL_RAW_CHECK(close_bracket_pos != absl::string_view::npos, CHECK_NE(close_bracket_pos, absl::string_view::npos)
"Test input contains [ without matching ]"); << "Test input contains [ without matching ]";
end_subrange = static_cast<int>(close_bracket_pos); end_subrange = static_cast<int>(close_bracket_pos);
s.replace(close_bracket_pos, 1, ""); s.replace(close_bracket_pos, 1, "");
} }
const std::string::size_type expected_characters_matched = s.find('$'); const std::string::size_type expected_characters_matched = s.find('$');
ABSL_RAW_CHECK(expected_characters_matched != std::string::npos, CHECK_NE(expected_characters_matched, std::string::npos)
"Input string must contain $"); << "Input string must contain $";
s.replace(expected_characters_matched, 1, ""); s.replace(expected_characters_matched, 1, "");
ParsedFloat parsed = ParsedFloat parsed =
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/attributes.h" #include "absl/base/attributes.h"
#include "absl/base/internal/raw_logging.h" #include "absl/base/internal/raw_logging.h"
#include "absl/log/log.h"
#include "absl/strings/internal/str_format/bind.h" #include "absl/strings/internal/str_format/bind.h"
#include "absl/strings/match.h" #include "absl/strings/match.h"
#include "absl/types/optional.h" #include "absl/types/optional.h"
...@@ -264,7 +265,7 @@ MATCHER_P(MatchesPointerString, ptr, "") { ...@@ -264,7 +265,7 @@ MATCHER_P(MatchesPointerString, ptr, "") {
} }
void* parsed = nullptr; void* parsed = nullptr;
if (sscanf(arg.c_str(), "%p", &parsed) != 1) { if (sscanf(arg.c_str(), "%p", &parsed) != 1) {
ABSL_RAW_LOG(FATAL, "Could not parse %s", arg.c_str()); LOG(FATAL) << "Could not parse " << arg;
} }
return ptr == parsed; return ptr == parsed;
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h" #include "absl/log/log.h"
#include "absl/random/distributions.h" #include "absl/random/distributions.h"
#include "absl/random/random.h" #include "absl/random/random.h"
#include "absl/strings/internal/numbers_test_common.h" #include "absl/strings/internal/numbers_test_common.h"
...@@ -1337,11 +1337,9 @@ TEST_F(SimpleDtoaTest, ExhaustiveDoubleToSixDigits) { ...@@ -1337,11 +1337,9 @@ TEST_F(SimpleDtoaTest, ExhaustiveDoubleToSixDigits) {
if (strcmp(sixdigitsbuf, snprintfbuf) != 0) { if (strcmp(sixdigitsbuf, snprintfbuf) != 0) {
mismatches.push_back(d); mismatches.push_back(d);
if (mismatches.size() < 10) { if (mismatches.size() < 10) {
ABSL_RAW_LOG(ERROR, "%s", LOG(ERROR) << "Six-digit failure with double. d=" << d
absl::StrCat("Six-digit failure with double. ", "d=", d, << " sixdigits=" << sixdigitsbuf
"=", d, " sixdigits=", sixdigitsbuf, << " printf(%g)=" << snprintfbuf;
" printf(%g)=", snprintfbuf)
.c_str());
} }
} }
}; };
...@@ -1389,12 +1387,10 @@ TEST_F(SimpleDtoaTest, ExhaustiveDoubleToSixDigits) { ...@@ -1389,12 +1387,10 @@ TEST_F(SimpleDtoaTest, ExhaustiveDoubleToSixDigits) {
if (kFloatNumCases >= 1e9) { if (kFloatNumCases >= 1e9) {
// The exhaustive test takes a very long time, so log progress. // The exhaustive test takes a very long time, so log progress.
char buf[kSixDigitsToBufferSize]; char buf[kSixDigitsToBufferSize];
ABSL_RAW_LOG( LOG(INFO) << "Exp " << exponent << " powten=" << powten << "(" << powten
INFO, "%s", << ") ("
absl::StrCat("Exp ", exponent, " powten=", powten, "(", powten, << absl::string_view(buf, SixDigitsToBuffer(powten, buf))
") (", << ")";
std::string(buf, SixDigitsToBuffer(powten, buf)), ")")
.c_str());
} }
for (int digits : digit_testcases) { for (int digits : digit_testcases) {
if (exponent == 308 && digits >= 179769) break; // don't overflow! if (exponent == 308 && digits >= 179769) break; // don't overflow!
...@@ -1419,20 +1415,17 @@ TEST_F(SimpleDtoaTest, ExhaustiveDoubleToSixDigits) { ...@@ -1419,20 +1415,17 @@ TEST_F(SimpleDtoaTest, ExhaustiveDoubleToSixDigits) {
double before = nextafter(d, 0.0); double before = nextafter(d, 0.0);
double after = nextafter(d, 1.7976931348623157e308); double after = nextafter(d, 1.7976931348623157e308);
char b1[32], b2[kSixDigitsToBufferSize]; char b1[32], b2[kSixDigitsToBufferSize];
ABSL_RAW_LOG( LOG(ERROR) << "Mismatch #" << i << " d=" << d << " (" << ToNineDigits(d)
ERROR, "%s", << ") sixdigits='" << sixdigitsbuf << "' snprintf='"
absl::StrCat( << snprintfbuf << "' Before.=" << PerfectDtoa(before) << " "
"Mismatch #", i, " d=", d, " (", ToNineDigits(d), ")", << (SixDigitsToBuffer(before, b2), b2) << " vs snprintf="
" sixdigits='", sixdigitsbuf, "'", " snprintf='", snprintfbuf, << (snprintf(b1, sizeof(b1), "%g", before), b1)
"'", " Before.=", PerfectDtoa(before), " ", << " Perfect=" << PerfectDtoa(d) << " "
(SixDigitsToBuffer(before, b2), b2), << (SixDigitsToBuffer(d, b2), b2)
" vs snprintf=", (snprintf(b1, sizeof(b1), "%g", before), b1), << " vs snprintf=" << (snprintf(b1, sizeof(b1), "%g", d), b1)
" Perfect=", PerfectDtoa(d), " ", (SixDigitsToBuffer(d, b2), b2), << " After.=." << PerfectDtoa(after) << " "
" vs snprintf=", (snprintf(b1, sizeof(b1), "%g", d), b1), << (SixDigitsToBuffer(after, b2), b2) << " vs snprintf="
" After.=.", PerfectDtoa(after), " ", << (snprintf(b1, sizeof(b1), "%g", after), b1);
(SixDigitsToBuffer(after, b2), b2),
" vs snprintf=", (snprintf(b1, sizeof(b1), "%g", after), b1))
.c_str());
} }
} }
} }
......
...@@ -198,7 +198,8 @@ cc_test( ...@@ -198,7 +198,8 @@ cc_test(
deps = [ deps = [
":graphcycles_internal", ":graphcycles_internal",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/log:check",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
) )
...@@ -247,7 +248,8 @@ cc_test( ...@@ -247,7 +248,8 @@ cc_test(
"//absl/base", "//absl/base",
"//absl/base:config", "//absl/base:config",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/log:check",
"//absl/memory", "//absl/memory",
"//absl/time", "//absl/time",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
...@@ -376,6 +378,6 @@ cc_test( ...@@ -376,6 +378,6 @@ cc_test(
deps = [ deps = [
":synchronization", ":synchronization",
"//absl/base:core_headers", "//absl/base:core_headers",
"//absl/base:raw_logging_internal", "//absl/log:check",
], ],
) )
...@@ -151,9 +151,10 @@ absl_cc_test( ...@@ -151,9 +151,10 @@ absl_cc_test(
COPTS COPTS
${ABSL_TEST_COPTS} ${ABSL_TEST_COPTS}
DEPS DEPS
absl::graphcycles_internal absl::check
absl::core_headers absl::core_headers
absl::raw_logging_internal absl::graphcycles_internal
absl::log
GTest::gmock_main GTest::gmock_main
) )
...@@ -183,10 +184,11 @@ absl_cc_test( ...@@ -183,10 +184,11 @@ absl_cc_test(
absl::synchronization absl::synchronization
absl::thread_pool absl::thread_pool
absl::base absl::base
absl::check
absl::config absl::config
absl::core_headers absl::core_headers
absl::log
absl::memory absl::memory
absl::raw_logging_internal
absl::time absl::time
GTest::gmock_main GTest::gmock_main
) )
...@@ -278,5 +280,5 @@ absl_cc_test( ...@@ -278,5 +280,5 @@ absl_cc_test(
DEPS DEPS
absl::synchronization absl::synchronization
absl::core_headers absl::core_headers
absl::raw_logging_internal absl::check
) )
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#include <vector> #include <vector>
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h" #include "absl/base/macros.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
namespace absl { namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
...@@ -65,51 +66,51 @@ static bool IsReachable(Edges *edges, int from, int to, ...@@ -65,51 +66,51 @@ static bool IsReachable(Edges *edges, int from, int to,
} }
static void PrintEdges(Edges *edges) { static void PrintEdges(Edges *edges) {
ABSL_RAW_LOG(INFO, "EDGES (%zu)", edges->size()); LOG(INFO) << "EDGES (" << edges->size() << ")";
for (const auto &edge : *edges) { for (const auto &edge : *edges) {
int a = edge.from; int a = edge.from;
int b = edge.to; int b = edge.to;
ABSL_RAW_LOG(INFO, "%d %d", a, b); LOG(INFO) << a << " " << b;
} }
ABSL_RAW_LOG(INFO, "---"); LOG(INFO) << "---";
} }
static void PrintGCEdges(Nodes *nodes, const IdMap &id, GraphCycles *gc) { static void PrintGCEdges(Nodes *nodes, const IdMap &id, GraphCycles *gc) {
ABSL_RAW_LOG(INFO, "GC EDGES"); LOG(INFO) << "GC EDGES";
for (int a : *nodes) { for (int a : *nodes) {
for (int b : *nodes) { for (int b : *nodes) {
if (gc->HasEdge(Get(id, a), Get(id, b))) { if (gc->HasEdge(Get(id, a), Get(id, b))) {
ABSL_RAW_LOG(INFO, "%d %d", a, b); LOG(INFO) << a << " " << b;
} }
} }
} }
ABSL_RAW_LOG(INFO, "---"); LOG(INFO) << "---";
} }
static void PrintTransitiveClosure(Nodes *nodes, Edges *edges) { static void PrintTransitiveClosure(Nodes *nodes, Edges *edges) {
ABSL_RAW_LOG(INFO, "Transitive closure"); LOG(INFO) << "Transitive closure";
for (int a : *nodes) { for (int a : *nodes) {
for (int b : *nodes) { for (int b : *nodes) {
std::unordered_set<int> seen; std::unordered_set<int> seen;
if (IsReachable(edges, a, b, &seen)) { if (IsReachable(edges, a, b, &seen)) {
ABSL_RAW_LOG(INFO, "%d %d", a, b); LOG(INFO) << a << " " << b;
} }
} }
} }
ABSL_RAW_LOG(INFO, "---"); LOG(INFO) << "---";
} }
static void PrintGCTransitiveClosure(Nodes *nodes, const IdMap &id, static void PrintGCTransitiveClosure(Nodes *nodes, const IdMap &id,
GraphCycles *gc) { GraphCycles *gc) {
ABSL_RAW_LOG(INFO, "GC Transitive closure"); LOG(INFO) << "GC Transitive closure";
for (int a : *nodes) { for (int a : *nodes) {
for (int b : *nodes) { for (int b : *nodes) {
if (gc->IsReachable(Get(id, a), Get(id, b))) { if (gc->IsReachable(Get(id, a), Get(id, b))) {
ABSL_RAW_LOG(INFO, "%d %d", a, b); LOG(INFO) << a << " " << b;
} }
} }
} }
ABSL_RAW_LOG(INFO, "---"); LOG(INFO) << "---";
} }
static void CheckTransitiveClosure(Nodes *nodes, Edges *edges, const IdMap &id, static void CheckTransitiveClosure(Nodes *nodes, Edges *edges, const IdMap &id,
...@@ -125,9 +126,8 @@ static void CheckTransitiveClosure(Nodes *nodes, Edges *edges, const IdMap &id, ...@@ -125,9 +126,8 @@ static void CheckTransitiveClosure(Nodes *nodes, Edges *edges, const IdMap &id,
PrintGCEdges(nodes, id, gc); PrintGCEdges(nodes, id, gc);
PrintTransitiveClosure(nodes, edges); PrintTransitiveClosure(nodes, edges);
PrintGCTransitiveClosure(nodes, id, gc); PrintGCTransitiveClosure(nodes, id, gc);
ABSL_RAW_LOG(FATAL, "gc_reachable %s reachable %s a %d b %d", LOG(FATAL) << "gc_reachable " << gc_reachable << " reachable "
gc_reachable ? "true" : "false", << reachable << " a " << a << " b " << b;
reachable ? "true" : "false", a, b);
} }
} }
} }
...@@ -142,7 +142,7 @@ static void CheckEdges(Nodes *nodes, Edges *edges, const IdMap &id, ...@@ -142,7 +142,7 @@ static void CheckEdges(Nodes *nodes, Edges *edges, const IdMap &id,
if (!gc->HasEdge(Get(id, a), Get(id, b))) { if (!gc->HasEdge(Get(id, a), Get(id, b))) {
PrintEdges(edges); PrintEdges(edges);
PrintGCEdges(nodes, id, gc); PrintGCEdges(nodes, id, gc);
ABSL_RAW_LOG(FATAL, "!gc->HasEdge(%d, %d)", a, b); LOG(FATAL) << "!gc->HasEdge(" << a << ", " << b << ")";
} }
} }
for (const auto &a : *nodes) { for (const auto &a : *nodes) {
...@@ -155,13 +155,12 @@ static void CheckEdges(Nodes *nodes, Edges *edges, const IdMap &id, ...@@ -155,13 +155,12 @@ static void CheckEdges(Nodes *nodes, Edges *edges, const IdMap &id,
if (count != edges->size()) { if (count != edges->size()) {
PrintEdges(edges); PrintEdges(edges);
PrintGCEdges(nodes, id, gc); PrintGCEdges(nodes, id, gc);
ABSL_RAW_LOG(FATAL, "edges->size() %zu count %d", edges->size(), count); LOG(FATAL) << "edges->size() " << edges->size() << " count " << count;
} }
} }
static void CheckInvariants(const GraphCycles &gc) { static void CheckInvariants(const GraphCycles &gc) {
if (ABSL_PREDICT_FALSE(!gc.CheckInvariants())) CHECK(gc.CheckInvariants()) << "CheckInvariants";
ABSL_RAW_LOG(FATAL, "CheckInvariants");
} }
// Returns the index of a randomly chosen node in *nodes. // Returns the index of a randomly chosen node in *nodes.
...@@ -309,7 +308,7 @@ TEST(GraphCycles, RandomizedTest) { ...@@ -309,7 +308,7 @@ TEST(GraphCycles, RandomizedTest) {
break; break;
default: default:
ABSL_RAW_LOG(FATAL, "op %d", op); LOG(FATAL) << "op " << op;
} }
// Very rarely, test graph expansion by adding then removing many nodes. // Very rarely, test graph expansion by adding then removing many nodes.
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include "absl/base/attributes.h" #include "absl/base/attributes.h"
#include "absl/base/const_init.h" #include "absl/base/const_init.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/thread_annotations.h" #include "absl/base/thread_annotations.h"
#include "absl/log/check.h"
#include "absl/synchronization/mutex.h" #include "absl/synchronization/mutex.h"
#include "absl/synchronization/notification.h" #include "absl/synchronization/notification.h"
...@@ -35,20 +35,20 @@ namespace { ...@@ -35,20 +35,20 @@ namespace {
// Thread two waits on 'notification', then sets 'state' inside the 'mutex', // Thread two waits on 'notification', then sets 'state' inside the 'mutex',
// signalling the change via 'condvar'. // signalling the change via 'condvar'.
// //
// These tests use ABSL_RAW_CHECK to validate invariants, rather than EXPECT or // These tests use CHECK to validate invariants, rather than EXPECT or ASSERT
// ASSERT from gUnit, because we need to invoke them during global destructors, // from gUnit, because we need to invoke them during global destructors, when
// when gUnit teardown would have already begun. // gUnit teardown would have already begun.
void ThreadOne(absl::Mutex* mutex, absl::CondVar* condvar, void ThreadOne(absl::Mutex* mutex, absl::CondVar* condvar,
absl::Notification* notification, bool* state) { absl::Notification* notification, bool* state) {
// Test that the notification is in a valid initial state. // Test that the notification is in a valid initial state.
ABSL_RAW_CHECK(!notification->HasBeenNotified(), "invalid Notification"); CHECK(!notification->HasBeenNotified()) << "invalid Notification";
ABSL_RAW_CHECK(*state == false, "*state not initialized"); CHECK(!*state) << "*state not initialized";
{ {
absl::MutexLock lock(mutex); absl::MutexLock lock(mutex);
notification->Notify(); notification->Notify();
ABSL_RAW_CHECK(notification->HasBeenNotified(), "invalid Notification"); CHECK(notification->HasBeenNotified()) << "invalid Notification";
while (*state == false) { while (*state == false) {
condvar->Wait(mutex); condvar->Wait(mutex);
...@@ -58,11 +58,11 @@ void ThreadOne(absl::Mutex* mutex, absl::CondVar* condvar, ...@@ -58,11 +58,11 @@ void ThreadOne(absl::Mutex* mutex, absl::CondVar* condvar,
void ThreadTwo(absl::Mutex* mutex, absl::CondVar* condvar, void ThreadTwo(absl::Mutex* mutex, absl::CondVar* condvar,
absl::Notification* notification, bool* state) { absl::Notification* notification, bool* state) {
ABSL_RAW_CHECK(*state == false, "*state not initialized"); CHECK(!*state) << "*state not initialized";
// Wake thread one // Wake thread one
notification->WaitForNotification(); notification->WaitForNotification();
ABSL_RAW_CHECK(notification->HasBeenNotified(), "invalid Notification"); CHECK(notification->HasBeenNotified()) << "invalid Notification";
{ {
absl::MutexLock lock(mutex); absl::MutexLock lock(mutex);
*state = true; *state = true;
......
...@@ -77,8 +77,8 @@ cc_test( ...@@ -77,8 +77,8 @@ cc_test(
":any", ":any",
"//absl/base:config", "//absl/base:config",
"//absl/base:exception_testing", "//absl/base:exception_testing",
"//absl/base:raw_logging_internal",
"//absl/container:test_instance_tracker", "//absl/container:test_instance_tracker",
"//absl/log",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
) )
...@@ -185,7 +185,7 @@ cc_test( ...@@ -185,7 +185,7 @@ cc_test(
deps = [ deps = [
":optional", ":optional",
"//absl/base:config", "//absl/base:config",
"//absl/base:raw_logging_internal", "//absl/log",
"//absl/meta:type_traits", "//absl/meta:type_traits",
"//absl/strings", "//absl/strings",
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
......
...@@ -68,7 +68,7 @@ absl_cc_test( ...@@ -68,7 +68,7 @@ absl_cc_test(
absl::any absl::any
absl::config absl::config
absl::exception_testing absl::exception_testing
absl::raw_logging_internal absl::log
absl::test_instance_tracker absl::test_instance_tracker
GTest::gmock_main GTest::gmock_main
) )
...@@ -220,7 +220,7 @@ absl_cc_test( ...@@ -220,7 +220,7 @@ absl_cc_test(
DEPS DEPS
absl::optional absl::optional
absl::config absl::config
absl::raw_logging_internal absl::log
absl::strings absl::strings
absl::type_traits absl::type_traits
GTest::gmock_main GTest::gmock_main
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/config.h" #include "absl/base/config.h"
#include "absl/base/internal/exception_testing.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/container/internal/test_instance_tracker.h"
#include "absl/log/log.h"
namespace { namespace {
using absl::test_internal::CopyableOnlyInstance; using absl::test_internal::CopyableOnlyInstance;
...@@ -704,7 +704,7 @@ struct BadCopyable { ...@@ -704,7 +704,7 @@ struct BadCopyable {
#ifdef ABSL_HAVE_EXCEPTIONS #ifdef ABSL_HAVE_EXCEPTIONS
throw BadCopy(); throw BadCopy();
#else #else
ABSL_RAW_LOG(FATAL, "Bad copy"); LOG(FATAL) << "Bad copy";
#endif #endif
} }
}; };
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "absl/base/config.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/meta/type_traits.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
...@@ -1542,8 +1542,7 @@ TEST(optionalTest, Hash) { ...@@ -1542,8 +1542,7 @@ TEST(optionalTest, Hash) {
struct MoveMeNoThrow { struct MoveMeNoThrow {
MoveMeNoThrow() : x(0) {} MoveMeNoThrow() : x(0) {}
[[noreturn]] MoveMeNoThrow(const MoveMeNoThrow& other) : x(other.x) { [[noreturn]] MoveMeNoThrow(const MoveMeNoThrow& other) : x(other.x) {
ABSL_RAW_LOG(FATAL, "Should not be called."); LOG(FATAL) << "Should not be called.";
abort();
} }
MoveMeNoThrow(MoveMeNoThrow&& other) noexcept : x(other.x) {} MoveMeNoThrow(MoveMeNoThrow&& other) noexcept : x(other.x) {}
int x; int x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment