From ac90d81e68e7a43d026a6922c70d56ccecb934a8 Mon Sep 17 00:00:00 2001 From: Masonlet Date: Wed, 19 Nov 2025 17:28:37 -0500 Subject: [PATCH] Wrap debug logging tests in #ifndef NDEBUG to pass Release tests --- tests/logger_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/logger_test.cpp b/tests/logger_test.cpp index c114971..c88b61f 100644 --- a/tests/logger_test.cpp +++ b/tests/logger_test.cpp @@ -9,12 +9,14 @@ TEST(LoggerTest, BasicLog) { const std::string output = testing::internal::GetCapturedStdout(); EXPECT_EQ(output, "[TestCaller TestFunction INFO] Test message\n"); } +#ifndef NDEBUG TEST(LoggerTest, BasicDebugLog) { testing::internal::CaptureStdout(); SLogger::debug("TestCaller", "TestFunction", "True message"); const std::string outputT = testing::internal::GetCapturedStdout(); EXPECT_EQ(outputT, "[TestCaller TestFunction DEBUG] True message\n"); } +#endif TEST(LoggerTest, BasicWarningLog) { testing::internal::CaptureStderr(); SLogger::warning("TestCaller", "TestFunction", "Test message"); @@ -35,7 +37,9 @@ TEST(LoggerTest, AllLevels) { SLogger::warning("Caller", "Func", "warning", true); std::string output = testing::internal::GetCapturedStdout(); EXPECT_NE(output.find("[Caller Func INFO] info\n"), std::string::npos); +#ifndef NDEBUG EXPECT_NE(output.find("[Caller Func DEBUG] debug\n"), std::string::npos); +#endif EXPECT_NE(output.find("[Caller Func WARNING] warning\n"), std::string::npos); testing::internal::CaptureStderr();