From 3faaad9fe1f11cfe5699c6720c897bfddc7cf49a Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Thu, 15 May 2025 00:18:27 -0600 Subject: Begone with the printf variants of the log functions --- libmisc/tests/test_log.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'libmisc/tests/test_log.c') diff --git a/libmisc/tests/test_log.c b/libmisc/tests/test_log.c index e5abb61..ee762e2 100644 --- a/libmisc/tests/test_log.c +++ b/libmisc/tests/test_log.c @@ -20,23 +20,6 @@ static struct fmt_buf log_output = {}; -size_t __lm_printf(const char *format, ...) { - restart: - va_list va; - va_start(va, format); - size_t ret = (size_t) vsnprintf(log_output.dat, log_output.cap, format, va); - va_end(va); - - if (ret > log_output.cap) { - log_output.cap = ret+8; - log_output.dat = realloc(log_output.dat, log_output.cap); - memset(log_output.dat, 0, log_output.cap); - goto restart; - } - log_output.len = ret; - return ret; -} - void __lm_putchar(unsigned char c) { if (log_output.len+1 >= log_output.cap) { log_output.cap += 16; @@ -74,23 +57,6 @@ static void log_output_clear(void) { } while (0) int main() { - /* printf */ - should_print("error: FROBNICATE: val=42\n", - log_errorf("val=%d", 42)); - should_print("info : FROBNICATE: val=0\n", - log_infof("val=%d", 0)); -#ifndef NDEBUG -#define CONFIG_FROBNICATE_DEBUG 1 - should_print("debug: FROBNICATE: val=-2\n", - log_debugf("val=%d", -2)); -#undef CONFIG_FROBNICATE_DEBUG -#define CONFIG_FROBNICATE_DEBUG 0 - should_print(NULL, - log_debugf("val=%d", -2)); -#undef CONFIG_FROBNICATE_DEBUG -#endif - - /* libmisc/fmt.h */ should_print("error: FROBNICATE: val=42\n", log_errorln("val=", 42)); should_print("info : FROBNICATE: val=0\n", -- cgit v1.2.3-2-g168b