[Spice-commits] tests/test-logging.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 19 14:47:21 UTC 2020

 tests/test-logging.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a64d86d1d5e5a8cf5f843144f0ea02c7c13f89f
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon Mar 16 21:26:43 2020 +0000

    test-logging: Do not use G_PASTE to join level
    "level" can have value "DEBUG". In some environment "DEBUG" is
    used as preprocessor name to enable some debugging code.
    Using -DDEBUG option (or similar) cause "DEBUG" to be defined as "1"
    so "G_PASTE(G_LOG_LEVEL_, level)" will be expanded to "G_LOG_LEVEL_1"
    instead of "G_LOG_LEVEL_DEBUG".
    Just concatenate the two literal to avoid "DEBUG" expansion.
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/tests/test-logging.c b/tests/test-logging.c
index d151990..09f13c5 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -31,7 +31,7 @@
         va_list args;                                                            \
         va_start (args, format);                                                 \
-        g_logv(OTHER_LOG_DOMAIN, G_PASTE(G_LOG_LEVEL_, level), format, args);    \
+        g_logv(OTHER_LOG_DOMAIN, G_LOG_LEVEL_ ## level, format, args);           \
         va_end (args);                                                           \

More information about the Spice-commits mailing list