Skip to content

Commit 3ea5079

Browse files
mbxxcopybara-github
authored andcommitted
Release tests for ABSL_RAW_DCHECK and ABSL_RAW_DLOG.
PiperOrigin-RevId: 749035257 Change-Id: Id7574a8b29ff15f1e46b0e9c02217fabcf873cca
1 parent 1c50475 commit 3ea5079

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

absl/base/raw_logging_test.cc

+15
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,27 @@ TEST(RawLoggingCompilationTest, PassingCheck) {
4343
ABSL_RAW_CHECK(true, "RAW CHECK");
4444
}
4545

46+
TEST(RawLoggingCompilationTest, DebugLog) {
47+
ABSL_RAW_DLOG(INFO, "RAW DLOG: %d", 1);
48+
}
49+
50+
TEST(RawLoggingCompilationTest, PassingDebugCheck) {
51+
ABSL_RAW_DCHECK(true, "failure message");
52+
}
53+
4654
// Not all platforms support output from raw log, so we don't verify any
4755
// particular output for RAW check failures (expecting the empty string
4856
// accomplishes this). This test is primarily a compilation test, but we
4957
// are verifying process death when EXPECT_DEATH works for a platform.
5058
const char kExpectedDeathOutput[] = "";
5159

60+
#if !defined(NDEBUG) // if debug build
61+
TEST(RawLoggingDeathTest, FailingDebugCheck) {
62+
EXPECT_DEATH_IF_SUPPORTED(ABSL_RAW_DCHECK(1 == 0, "explanation"),
63+
kExpectedDeathOutput);
64+
}
65+
#endif // if debug build
66+
5267
TEST(RawLoggingDeathTest, FailingCheck) {
5368
EXPECT_DEATH_IF_SUPPORTED(ABSL_RAW_CHECK(1 == 0, "explanation"),
5469
kExpectedDeathOutput);

0 commit comments

Comments
 (0)