Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/base_tests/logging_test.cpp')
-rw-r--r--base/base_tests/logging_test.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/base/base_tests/logging_test.cpp b/base/base_tests/logging_test.cpp
index ff5e50ad16..365db44668 100644
--- a/base/base_tests/logging_test.cpp
+++ b/base/base_tests/logging_test.cpp
@@ -18,6 +18,13 @@ namespace
g_SomeFunctionCalled = true;
return 3;
}
+
+ bool g_NegativeFunctionCalled;
+ bool NegativeFunction()
+ {
+ g_NegativeFunctionCalled = true;
+ return false;
+ }
}
UNIT_TEST(Logging_Level)
@@ -43,3 +50,14 @@ UNIT_TEST(NullMessage)
char const * ptr = 0;
LOG(LINFO, ("Null message test", ptr));
}
+
+UNIT_TEST(Logging_ConditionalLog)
+{
+ g_SomeFunctionCalled = false;
+ CLOG(LINFO, SomeFunction(), ("This should not pass"));
+ TEST(g_SomeFunctionCalled, ());
+
+ g_NegativeFunctionCalled = false;
+ CLOG(LWARNING, NegativeFunction(), ("This should pass"));
+ TEST(g_NegativeFunctionCalled, ());
+}