From 6de7a854ec94d6557c850bf15617e5bb80c77e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 15 Jan 2013 19:09:26 +0100 Subject: [PATCH] Fix TRACEF macro. Addition to test_logging.c --- include/ucore/ucore_utils.h | 4 ++-- test/test_logging.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ucore/ucore_utils.h b/include/ucore/ucore_utils.h index 0601622..fa559da 100644 --- a/include/ucore/ucore_utils.h +++ b/include/ucore/ucore_utils.h @@ -10,9 +10,9 @@ } while (0) #ifdef DEBUG - #define TRACEF(fmt, args...) + #define TRACEF(fmt, ...)\ do { \ - fprintf(stdout, "%s:%d (%s)\t" fmt, __FILE__, __LINE__, __FUNCTION__, ##args);\ + fprintf(stdout, "%s:%d (%s)\t" fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);\ fflush(stdout);\ } while(0) #else diff --git a/test/test_logging.c b/test/test_logging.c index e1ecd86..9511171 100644 --- a/test/test_logging.c +++ b/test/test_logging.c @@ -52,7 +52,7 @@ START_TEST (test_logfile_location) uc_log_add_destination(dest); UC_LOGF(UC_LL_DEBUG, 0, "Lorum ipson %d\n", 1); - UC_LOGF(UC_LL_DEBUG, 0, "Lorum ipson %d\n", 1); + UC_LOGF(UC_LL_DEBUG, 0, "Lorum ipson 2\n"); rc = stat(FILE_NAME, &st); fail_if(rc != 0, "stat failed: %s\n", strerror(errno));