blob: 4726aed514ac3ed66e2d6c241509e12576947c17 [file] [log] [blame]
Patches to allow for android-base/logging to work without requiring liblog to be
linked at compile time.
This configures base logging to write to stderr by default, which is a good
start for the logging we want for NNAPI.
diff --git a/platform2/aosp/system/core/base/logging_test.cpp b/platform2/aosp/system/core/base/logging_test.cpp
index 593e2c1..f1cbe41 100644
--- a/platform2/aosp/system/core/base/logging_test.cpp
+++ b/platform2/aosp/system/core/base/logging_test.cpp
@@ -88,18 +88,18 @@ TEST(logging, CHECK) {
TEST(logging, DCHECK) {
if (android::base::kEnableDChecks) {
- ASSERT_DEATH({SuppressAbortUI(); DCHECK(false);}, "DCheck failed: false ");
+ ASSERT_DEATH({SuppressAbortUI(); DCHECK(false);}, "Check failed: false ");
}
DCHECK(true);
if (android::base::kEnableDChecks) {
- ASSERT_DEATH({SuppressAbortUI(); DCHECK_EQ(0, 1);}, "DCheck failed: 0 == 1 ");
+ ASSERT_DEATH({SuppressAbortUI(); DCHECK_EQ(0, 1);}, "Check failed: 0 == 1 ");
}
DCHECK_EQ(0, 0);
if (android::base::kEnableDChecks) {
ASSERT_DEATH({SuppressAbortUI(); DCHECK_STREQ("foo", "bar");},
- R"(DCheck failed: "foo" == "bar")");
+ R"(Check failed: "foo" == "bar")");
}
DCHECK_STREQ("foo", "foo");
@@ -190,6 +190,7 @@ TEST(logging, WOULD_LOG_VERBOSE_enabled) {
#undef CHECK_WOULD_LOG_ENABLED
+#if 0
#if !defined(_WIN32)
static std::string make_log_pattern(android::base::LogSeverity severity,
const char* message) {
@@ -203,8 +204,9 @@ static std::string make_log_pattern(android::base::LogSeverity severity,
log_char, basename(&holder[0]), message);
}
#endif
+#endif
-static void CheckMessage(const std::string& output, android::base::LogSeverity severity,
+static void CheckMessage(const std::string& output, android::base::LogSeverity /*severity*/,
const char* expected, const char* expected_tag = nullptr) {
// We can't usefully check the output of any of these on Windows because we
// don't have std::regex, but we can at least make sure we printed at least as
@@ -215,6 +217,7 @@ static void CheckMessage(const std::string& output, android::base::LogSeverity s
ASSERT_NE(nullptr, strstr(output.c_str(), expected_tag)) << output;
}
+#if 0
#if !defined(_WIN32)
std::string regex_str;
if (expected_tag != nullptr) {
@@ -225,6 +228,7 @@ static void CheckMessage(const std::string& output, android::base::LogSeverity s
std::regex message_regex(regex_str);
ASSERT_TRUE(std::regex_search(output, message_regex)) << output;
#endif
+#endif
}
static void CheckMessage(CapturedStderr& cap, android::base::LogSeverity severity,