summaryrefslogtreecommitdiff
path: root/libartbase/base/logging_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libartbase/base/logging_test.cc')
-rw-r--r--libartbase/base/logging_test.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/libartbase/base/logging_test.cc b/libartbase/base/logging_test.cc
index 46ba41bb1f..540b9a7ef4 100644
--- a/libartbase/base/logging_test.cc
+++ b/libartbase/base/logging_test.cc
@@ -39,10 +39,6 @@ class LoggingTest : public testing::Test {
}
};
-#ifdef NDEBUG
-#error Unexpected NDEBUG
-#endif
-
class TestClass {
public:
DECLARE_RUNTIME_DEBUG_FLAG(kFlag);
@@ -51,7 +47,12 @@ DEFINE_RUNTIME_DEBUG_FLAG(TestClass, kFlag);
TEST_F(LoggingTest, DECL_DEF) {
SetRuntimeDebugFlagsEnabled(true);
- EXPECT_TRUE(TestClass::kFlag);
+ if (kIsDebugBuild) {
+ EXPECT_TRUE(TestClass::kFlag);
+ } else {
+ // Runtime debug flags have a constant `false` value on non-debug builds.
+ EXPECT_FALSE(TestClass::kFlag);
+ }
SetRuntimeDebugFlagsEnabled(false);
EXPECT_FALSE(TestClass::kFlag);