From 2964c9ea99fd4f90f6f9f130999b654792df06b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 23 Jun 2019 20:30:14 +0300 Subject: [PATCH] New QPMS_UNTESTED macro Former-commit-id: c8f3b6f43e735b6dfa45b747395a5ad97c350eed --- qpms/qpms_error.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qpms/qpms_error.h b/qpms/qpms_error.h index af5fdc5..1347acd 100644 --- a/qpms/qpms_error.h +++ b/qpms/qpms_error.h @@ -41,7 +41,6 @@ qpms_dbgmsg_flags qpms_dbgmsg_disable(qpms_dbgmsg_flags types); qpms_dbgmsg_flags qpms_dbgmsg_enable(qpms_dbgmsg_flags types); - #define QPMS_WARN(msg, ...) qpms_warn_at_flf(__FILE__,__LINE__,__func__,msg, ##__VA_ARGS__) #define QPMS_DEBUG(type, msg, ...) qpms_debug_at_flf(__FILE__,__LINE__,__func__,type,msg, ##__VA_ARGS__) @@ -52,6 +51,14 @@ qpms_dbgmsg_flags qpms_dbgmsg_enable(qpms_dbgmsg_flags types); #define QPMS_WTF qpms_pr_error_at_flf(__FILE__,__LINE__,__func__,"Unexpected error.") +#define QPMS_UNTESTED {\ + static bool already_bitched = false; \ + if (!already_bitched) {\ + qpms_warn_at_flf(__FILE__,__LINE__,__func__,"Warning: untested function/feature!")\ + already_bitched = true;\ + }\ +} + #define QPMS_PR_ERROR(msg, ...) qpms_pr_error_at_flf(__FILE__,__LINE__,__func__,msg, ##__VA_ARGS__) #define QPMS_ENSURE_SUCCESS(x) {if(x) QPMS_WTF;}