Commit eec3dd7d by Marcus Winter

base_cpp: fixed error in log test

parent a6c4506a
...@@ -55,10 +55,18 @@ void LogTest::Test() { ...@@ -55,10 +55,18 @@ void LogTest::Test() {
Log::SetLogLevel(EMBB_LOG_LEVEL_TRACE); Log::SetLogLevel(EMBB_LOG_LEVEL_TRACE);
logged_message = null; logged_message = null;
Log::Trace("chn", test_msg); Log::Trace("chn", test_msg);
#ifdef EMBB_DEBUG
PT_EXPECT(0 == strcmp(logged_message, "[chn] - [TRACE] hello")); PT_EXPECT(0 == strcmp(logged_message, "[chn] - [TRACE] hello"));
#else
PT_EXPECT_EQ(null, logged_message);
#endif
logged_message = null; logged_message = null;
Log::Info("chn", test_msg); Log::Info("chn", test_msg);
#ifdef EMBB_DEBUG
PT_EXPECT(0 == strcmp(logged_message, "[chn] - [INFO ] hello")); PT_EXPECT(0 == strcmp(logged_message, "[chn] - [INFO ] hello"));
#else
PT_EXPECT_EQ(null, logged_message);
#endif
logged_message = null; logged_message = null;
Log::Warning("chn", test_msg); Log::Warning("chn", test_msg);
PT_EXPECT(0 == strcmp(logged_message, "[chn] - [WARN ] hello")); PT_EXPECT(0 == strcmp(logged_message, "[chn] - [WARN ] hello"));
...@@ -72,7 +80,11 @@ void LogTest::Test() { ...@@ -72,7 +80,11 @@ void LogTest::Test() {
PT_EXPECT_EQ(null, logged_message); PT_EXPECT_EQ(null, logged_message);
logged_message = null; logged_message = null;
Log::Info("chn", test_msg); Log::Info("chn", test_msg);
#ifdef EMBB_DEBUG
PT_EXPECT(0 == strcmp(logged_message, "[chn] - [INFO ] hello")); PT_EXPECT(0 == strcmp(logged_message, "[chn] - [INFO ] hello"));
#else
PT_EXPECT_EQ(null, logged_message);
#endif
logged_message = null; logged_message = null;
Log::Warning("chn", test_msg); Log::Warning("chn", test_msg);
PT_EXPECT(0 == strcmp(logged_message, "[chn] - [WARN ] hello")); PT_EXPECT(0 == strcmp(logged_message, "[chn] - [WARN ] hello"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment