Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5199016b
authored
Feb 23, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base_cpp: fixed codesonar warning
parent
f1752cf2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
base_cpp/test/log_test.cc
+10
-0
No files found.
base_cpp/test/log_test.cc
View file @
5199016b
...
@@ -56,6 +56,7 @@ void LogTest::Test() {
...
@@ -56,6 +56,7 @@ void LogTest::Test() {
logged_message
=
null
;
logged_message
=
null
;
Log
::
Trace
(
"chn"
,
test_msg
);
Log
::
Trace
(
"chn"
,
test_msg
);
#ifdef EMBB_DEBUG
#ifdef EMBB_DEBUG
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [TRACE] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [TRACE] hello"
));
#else
#else
PT_EXPECT_EQ
(
null
,
logged_message
);
PT_EXPECT_EQ
(
null
,
logged_message
);
...
@@ -63,15 +64,18 @@ void LogTest::Test() {
...
@@ -63,15 +64,18 @@ void LogTest::Test() {
logged_message
=
null
;
logged_message
=
null
;
Log
::
Info
(
"chn"
,
test_msg
);
Log
::
Info
(
"chn"
,
test_msg
);
#ifdef EMBB_DEBUG
#ifdef EMBB_DEBUG
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [INFO ] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [INFO ] hello"
));
#else
#else
PT_EXPECT_EQ
(
null
,
logged_message
);
PT_EXPECT_EQ
(
null
,
logged_message
);
#endif
#endif
logged_message
=
null
;
logged_message
=
null
;
Log
::
Warning
(
"chn"
,
test_msg
);
Log
::
Warning
(
"chn"
,
test_msg
);
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [WARN ] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [WARN ] hello"
));
logged_message
=
null
;
logged_message
=
null
;
Log
::
Error
(
"chn"
,
test_msg
);
Log
::
Error
(
"chn"
,
test_msg
);
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_INFO
);
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_INFO
);
...
@@ -81,15 +85,18 @@ void LogTest::Test() {
...
@@ -81,15 +85,18 @@ void LogTest::Test() {
logged_message
=
null
;
logged_message
=
null
;
Log
::
Info
(
"chn"
,
test_msg
);
Log
::
Info
(
"chn"
,
test_msg
);
#ifdef EMBB_DEBUG
#ifdef EMBB_DEBUG
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [INFO ] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [INFO ] hello"
));
#else
#else
PT_EXPECT_EQ
(
null
,
logged_message
);
PT_EXPECT_EQ
(
null
,
logged_message
);
#endif
#endif
logged_message
=
null
;
logged_message
=
null
;
Log
::
Warning
(
"chn"
,
test_msg
);
Log
::
Warning
(
"chn"
,
test_msg
);
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [WARN ] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [WARN ] hello"
));
logged_message
=
null
;
logged_message
=
null
;
Log
::
Error
(
"chn"
,
test_msg
);
Log
::
Error
(
"chn"
,
test_msg
);
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_WARNING
);
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_WARNING
);
...
@@ -101,9 +108,11 @@ void LogTest::Test() {
...
@@ -101,9 +108,11 @@ void LogTest::Test() {
PT_EXPECT_EQ
(
null
,
logged_message
);
PT_EXPECT_EQ
(
null
,
logged_message
);
logged_message
=
null
;
logged_message
=
null
;
Log
::
Warning
(
"chn"
,
test_msg
);
Log
::
Warning
(
"chn"
,
test_msg
);
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [WARN ] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [WARN ] hello"
));
logged_message
=
null
;
logged_message
=
null
;
Log
::
Error
(
"chn"
,
test_msg
);
Log
::
Error
(
"chn"
,
test_msg
);
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_ERROR
);
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_ERROR
);
...
@@ -118,6 +127,7 @@ void LogTest::Test() {
...
@@ -118,6 +127,7 @@ void LogTest::Test() {
PT_EXPECT_EQ
(
null
,
logged_message
);
PT_EXPECT_EQ
(
null
,
logged_message
);
logged_message
=
null
;
logged_message
=
null
;
Log
::
Error
(
"chn"
,
test_msg
);
Log
::
Error
(
"chn"
,
test_msg
);
PT_ASSERT_NE
(
logged_message
,
null
);
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
PT_EXPECT
(
0
==
strcmp
(
logged_message
,
"[chn] - [ERROR] hello"
));
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_NONE
);
Log
::
SetLogLevel
(
EMBB_LOG_LEVEL_NONE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment