Move RTC_CHECK_OP error message construction out of header file.
This simplifies the logic, prevents emitting code for every pair of
argument types to RTC_CHECK_OP and partially unblocks removing streams from
the check code altogether.
Bug: webrtc:8982
Change-Id: Ib6652ac9a342e4471c12574a79872833cc943407
Reviewed-on: https://webrtc-review.googlesource.com/86544
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23821}
diff --git a/rtc_base/logging_unittest.cc b/rtc_base/logging_unittest.cc
index 158f204..af51212 100644
--- a/rtc_base/logging_unittest.cc
+++ b/rtc_base/logging_unittest.cc
@@ -194,38 +194,34 @@
EXPECT_EQ(sev, LogMessage::GetLogToStream(nullptr));
}
-/*
#if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
TEST(LogTest, Checks) {
EXPECT_DEATH(FATAL() << "message",
"\n\n#\n"
- "# Fatal error in: \\S+, line \\d+\n"
- "# last system error: \\d+\n"
+ "# Fatal error in: \\S+, line \\w+\n"
+ "# last system error: \\w+\n"
"# Check failed: FATAL\\(\\)\n"
- "# message"
- );
+ "# message");
int a = 1, b = 2;
EXPECT_DEATH(RTC_CHECK_EQ(a, b) << 1 << 2u,
"\n\n#\n"
- "# Fatal error in: \\S+, line \\d+\n"
- "# last system error: \\d+\n"
+ "# Fatal error in: \\S+, line \\w+\n"
+ "# last system error: \\w+\n"
"# Check failed: a == b \\(1 vs. 2\\)\n"
- "# 12"
- );
+ "# 12");
RTC_CHECK_EQ(5, 5);
RTC_CHECK(true) << "Shouldn't crash" << 1;
EXPECT_DEATH(RTC_CHECK(false) << "Hi there!",
"\n\n#\n"
- "# Fatal error in: \\S+, line \\d+\n"
- "# last system error: \\d+\n"
+ "# Fatal error in: \\S+, line \\w+\n"
+ "# last system error: \\w+\n"
"# Check failed: false\n"
- "# Hi there!"
- );
+ "# Hi there!");
}
#endif
-*/
+
// Test using multiple log streams. The INFO stream should get the INFO message,
// the VERBOSE stream should get the INFO and the VERBOSE.
// We should restore the correct global state at the end.