1 #include <framework/logging/Logger.h>
2 #include <framework/logging/LogMethod.h>
3 #include <framework/utilities/TestHelpers.h>
4 #include <framework/logging/LogVariableStream.h>
6 #include <gtest/gtest.h>
12 TEST(LoggingTest, B2ASSERT)
14 #ifndef LOG_NO_B2ASSERT
15 B2ASSERT(
"this shouldn't happen",
true);
17 EXPECT_B2FATAL(B2ASSERT(
"This is just a test, ignore this message",
false));
19 B2ASSERT(
"this should be compiled out",
true);
20 B2ASSERT(
"this should be compiled out",
false);
31 TEST(LoggingTest, MacroSyntax)
47 TEST(LoggingTest, VariableLogging)
50 lv <<
"Some Text" << endl <<
"which is constant" <<
LogVar(
"intVar", 23) <<
LogVar(
"floatVar", 3.14) <<
LogVar(
"strVar",
52 EXPECT_EQ(
"Some Text\nwhich is constant\n\tintVar = 23\n\tfloatVar = 3.1400000000000001\n\tstrVar = someString", lv.
str());
58 EXPECT_EQ(
"Some Text\nwhich is constant\n\tintVar = 23\n\tfloatVar = 3.1400000000000001\n\tstrVar = someString", lv_assign.
str());
59 EXPECT_EQ(
"Some Text\nwhich is constant\n\tintVar = 23\n\tfloatVar = 3.1400000000000001\n\tstrVar = someString",