From 58256ff151ca9d54cde315d61ec5ff85e053ccf6 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Sun, 14 Sep 2025 06:10:03 +0300 Subject: [PATCH] test(compiled-level): add coverage for level-dependent macros --- tests/compiled_level_test.cpp | 49 ++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/tests/compiled_level_test.cpp b/tests/compiled_level_test.cpp index 8f93199..6eadbfe 100644 --- a/tests/compiled_level_test.cpp +++ b/tests/compiled_level_test.cpp @@ -8,9 +8,56 @@ int should_not_compile() { } int main() { + // TRACE macros LOGIT_TRACE(should_not_compile()); - LOGIT_DEBUG(should_not_compile()); LOGIT_TRACE0(); + LOGIT_0TRACE(); + LOGIT_0_TRACE(); + LOGIT_NOARGS_TRACE(); + LOGIT_FORMAT_TRACE("%d", should_not_compile()); + LOGIT_PRINT_TRACE(should_not_compile()); + LOGIT_PRINTF_TRACE("%d", should_not_compile()); + LOGIT_TRACE_TO(0, should_not_compile()); + LOGIT_TRACE0_TO(0); + LOGIT_0TRACE_TO(0); + LOGIT_0_TRACE_TO(0); + LOGIT_NOARGS_TRACE_TO(0); + LOGIT_FORMAT_TRACE_TO(0, "%d", should_not_compile()); + LOGIT_PRINT_TRACE_TO(0, should_not_compile()); + LOGIT_PRINTF_TRACE_TO(0, "%d", should_not_compile()); + LOGIT_TRACE_IF(false, should_not_compile()); + LOGIT_TRACE0_IF(false); + LOGIT_0TRACE_IF(false); + LOGIT_0_TRACE_IF(false); + LOGIT_NOARGS_TRACE_IF(false); + LOGIT_FORMAT_TRACE_IF(false, "%d", should_not_compile()); + LOGIT_PRINT_TRACE_IF(false, should_not_compile()); + LOGIT_PRINTF_TRACE_IF(false, "%d", should_not_compile()); + + // DEBUG macros + LOGIT_DEBUG(should_not_compile()); LOGIT_DEBUG0(); + LOGIT_0DEBUG(); + LOGIT_0_DEBUG(); + LOGIT_NOARGS_DEBUG(); + LOGIT_FORMAT_DEBUG("%d", should_not_compile()); + LOGIT_PRINT_DEBUG(should_not_compile()); + LOGIT_PRINTF_DEBUG("%d", should_not_compile()); + LOGIT_DEBUG_TO(0, should_not_compile()); + LOGIT_DEBUG0_TO(0); + LOGIT_0DEBUG_TO(0); + LOGIT_0_DEBUG_TO(0); + LOGIT_NOARGS_DEBUG_TO(0); + LOGIT_FORMAT_DEBUG_TO(0, "%d", should_not_compile()); + LOGIT_PRINT_DEBUG_TO(0, should_not_compile()); + LOGIT_PRINTF_DEBUG_TO(0, "%d", should_not_compile()); + LOGIT_DEBUG_IF(false, should_not_compile()); + LOGIT_DEBUG0_IF(false); + LOGIT_0DEBUG_IF(false); + LOGIT_0_DEBUG_IF(false); + LOGIT_NOARGS_DEBUG_IF(false); + LOGIT_FORMAT_DEBUG_IF(false, "%d", should_not_compile()); + LOGIT_PRINT_DEBUG_IF(false, should_not_compile()); + LOGIT_PRINTF_DEBUG_IF(false, "%d", should_not_compile()); return 0; }