[beast: 50/57] SFI: remove test_error, use fatal_error instead



commit 0471b55b0bca8f971dc55bfb709296af65b15588
Author: Tim Janik <timj gnu org>
Date:   Tue Jul 18 01:32:52 2017 +0200

    SFI: remove test_error, use fatal_error instead
    
    Signed-off-by: Tim Janik <timj gnu org>

 bse/tests/loophandle.cc         |    6 +++---
 sfi/sfitests.hh                 |    8 --------
 tests/latency/bselatencytest.cc |    4 ++--
 3 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/bse/tests/loophandle.cc b/bse/tests/loophandle.cc
index fddb298..a030608 100644
--- a/bse/tests/loophandle.cc
+++ b/bse/tests/loophandle.cc
@@ -160,14 +160,14 @@ check_loop (GslDataHandle *src_handle,
   error = gsl_data_handle_open (loop_handle);
   if (error != 0)
     {
-      test_error ("loop_handle open failed: %s", bse_error_blurb (error));
+      Bse::fatal_error ("loop_handle open failed: %s", bse_error_blurb (error));
       exit (1);
     }
 
   error = gsl_data_handle_open (loop_handle_reference);
   if (error != 0)
     {
-      test_error ("loop_handle_reference open failed: %s", bse_error_blurb (error));
+      Bse::fatal_error ("loop_handle_reference open failed: %s", bse_error_blurb (error));
       exit (1);
     }
 
@@ -179,7 +179,7 @@ check_loop (GslDataHandle *src_handle,
 
       if (a != b)
        {
-         test_error ("bad read in loop<%lld,%lld> position %lld: a = %f, b = %f", loop_start, loop_end, i, 
a, b);
+         Bse::fatal_error ("bad read in loop<%lld,%lld> position %lld: a = %f, b = %f", loop_start, 
loop_end, i, a, b);
          exit (1);
        }
     }
diff --git a/sfi/sfitests.hh b/sfi/sfitests.hh
index 5d8dca0..0cfafe9 100644
--- a/sfi/sfitests.hh
+++ b/sfi/sfitests.hh
@@ -13,12 +13,4 @@ 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();
-}
-
 #endif /* __SFI_TESTS_H__ */
diff --git a/tests/latency/bselatencytest.cc b/tests/latency/bselatencytest.cc
index 27fd2cd..28da33a 100644
--- a/tests/latency/bselatencytest.cc
+++ b/tests/latency/bselatencytest.cc
@@ -76,14 +76,14 @@ class LatencyTest : public LatencyTestBase {
       if (Rapicorn::Path::check (midi_output_name, "pw")) /* writable pipe */
         midi_output_file = fopen (midi_output_name.c_str(), "w");
       if (!midi_output_file)
-        test_error ("failed to open midi output \"%s\": %s\n", midi_output_name.c_str(), g_strerror (errno));
+        fatal_error ("failed to open midi output \"%s\": %s\n", midi_output_name.c_str(), g_strerror 
(errno));
       if (logfile_name == "" || !midi_output_file)
         logfile = stdout;
       else
        {
          logfile = fopen (logfile_name.c_str(), "w");
          if (!logfile)
-            test_error ("failed to open log file \"%s\": %s\n", logfile_name.c_str(), g_strerror (errno));
+            fatal_error ("failed to open log file \"%s\": %s\n", logfile_name.c_str(), g_strerror (errno));
        }
     }
     void


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