8#include <framework/logging/Logger.h>
9#include <framework/logging/LogMethod.h>
10#include <framework/utilities/TestHelpers.h>
11#include <framework/logging/LogVariableStream.h>
13#include <gtest/gtest.h>
19 TEST(LoggingTest, B2ASSERT)
21#ifndef LOG_NO_B2ASSERT
22 B2ASSERT(
"this shouldn't happen",
true);
23 EXPECT_B2FATAL(B2ASSERT(
"This is just a test, ignore this message",
false));
25 B2ASSERT(
"this should be compiled out",
true);
26 B2ASSERT(
"this should be compiled out",
false);
37 TEST(LoggingTest, MacroSyntax)
53 TEST(LoggingTest, VariableLogging)
56 lv <<
"Some Text" << endl <<
"which is constant" <<
LogVar(
"intVar", 23) <<
LogVar(
"floatVar", 3.14) <<
LogVar(
"strVar",
58 EXPECT_EQ(
"Some Text\nwhich is constant\n\tintVar = 23\n\tfloatVar = 3.1400000000000001\n\tstrVar = someString", lv.
str());
64 EXPECT_EQ(
"Some Text\nwhich is constant\n\tintVar = 23\n\tfloatVar = 3.1400000000000001\n\tstrVar = someString", lv_assign.
str());
65 EXPECT_EQ(
"Some Text\nwhich is constant\n\tintVar = 23\n\tfloatVar = 3.1400000000000001\n\tstrVar = someString",
Class to store variables with their name which were sent to the logging service.
Specialized implementation of an ostream-like class where the << operator can be used to insert value...
std::string str(bool showVariables=true) const
Return the content of the stream as string.
Abstract base class for different kinds of events.