#define CODE_ERROR_LOCATIONS #include "Errors.hpp" #include #include #include #include "Logger.hpp" using namespace nb; class TestError : public ErrorBase { public: using ErrorBase::ErrorBase; enum ErrorCodes : unsigned int { A, B, C, D }; static const std::string type; static const ErrorCodeMap ErrorMessages; }; const std::string TestError::type="TestError"; const ErrorCodeMap TestError::ErrorMessages{ {TestError::ErrorCodes::A, "Hey!"}, {TestError::ErrorCodes::B, "How"}, {TestError::ErrorCodes::C, "You"}, {TestError::ErrorCodes::D, "Doin"} }; TEST(ErrorTest, Test) { EXPECT_EQ(1, 1); std::stringstream sstream; nb::DefaultDebugLogger logr(std::cout, sstream); ASSERT_TRUE(logr.run()); ASSERT_TRUE(logr.isRunning()); while (!logr.isRunning()){ 1+1; } logr.log("Hey!"); logr.stop(); std::cout << "STRINGSTREAM:\n" << sstream.str(); }