From 551e6e34b7897d7991e4a87f74163de68b13b58d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 22 Nov 2022 18:22:16 +0000 Subject: [PATCH] Fix proper ifdef for log test - value is always defined but may be 0 or 1 --- src/lib/support/tests/TestBytesToHex.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/support/tests/TestBytesToHex.cpp b/src/lib/support/tests/TestBytesToHex.cpp index f99fed9f1b6cbc..21a6963ffd6faa 100644 --- a/src/lib/support/tests/TestBytesToHex.cpp +++ b/src/lib/support/tests/TestBytesToHex.cpp @@ -338,6 +338,8 @@ void TestHexToBytesAndUint(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, test16Out == test16OutExpected); } +#if CHIP_PROGRESS_LOGGING + ENFORCE_FORMAT(3, 0) void AccumulateLogLineCallback(const char * module, uint8_t category, const char * msg, va_list args) { (void) module; @@ -427,13 +429,15 @@ void TestLogBufferAsHex(nlTestSuite * inSuite, void * inContext) } } +#endif + const nlTest sTests[] = { NL_TEST_DEF("TestBytesToHexNotNullTerminated", TestBytesToHexNotNullTerminated), // NL_TEST_DEF("TestBytesToHexNullTerminated", TestBytesToHexNullTerminated), // NL_TEST_DEF("TestBytesToHexErrors", TestBytesToHexErrors), // NL_TEST_DEF("TestBytesToHexUint64", TestBytesToHexUint64), // NL_TEST_DEF("TestHexToBytesAndUint", TestHexToBytesAndUint), // -#ifdef CHIP_PROGRESS_LOGGING +#if CHIP_PROGRESS_LOGGING NL_TEST_DEF("TestLogBufferAsHex", TestLogBufferAsHex), // #endif NL_TEST_SENTINEL() //