[beast: 20/43] SFI: provide test_error() for failing tests



commit 1e7e577d37b9827c6d276bd0386c5d5a4e4b4acd
Author: Tim Janik <timj gnu org>
Date:   Sun Jun 25 18:38:03 2017 +0200

    SFI: provide test_error() for failing tests
    
    Signed-off-by: Tim Janik <timj gnu org>

 sfi/sfitests.hh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/sfi/sfitests.hh b/sfi/sfitests.hh
index 5c4cd08..de82ed8 100644
--- a/sfi/sfitests.hh
+++ b/sfi/sfitests.hh
@@ -13,6 +13,14 @@ sfi_init_test (int *argcp, char **argv)
   g_log_set_always_fatal ((GLogLevelFlags) (flags | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL));
 }
 
+/// Issue a printf-like message and abort the program with a breakpoint.
+template<class ...Args> void
+test_error (const char *format, const Args &...args)
+{
+  Bse::info ("error: %s", Bse::string_format (format, args...));
+  Bse::breakpoint();
+}
+
 #define TICK()  TOK()
 #define TACK()  TOK()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]