[gcab/wip/smcv/insttest: 1/2] self-test: Use g_test_message instead of printing to stdout



commit a57e5d66e9f2625b627f49779c03d4018015378a
Author: Simon McVittie <smcv debian org>
Date:   Mon Sep 2 10:46:52 2019 +0100

    self-test: Use g_test_message instead of printing to stdout
    
    GLib now defaults to structured TAP output on stdout, and printing
    unstructured messages to stdout corrupts this. In a TAP test, arbitrary
    diagnostics can either use g_test_message() or a GLib logging function
    like g_debug(), or be printed to stderr with g_printerr().
    
    Signed-off-by: Simon McVittie <smcv debian org>

 tests/gcab-self-test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/gcab-self-test.c b/tests/gcab-self-test.c
index aee690b..66a4778 100644
--- a/tests/gcab-self-test.c
+++ b/tests/gcab-self-test.c
@@ -365,7 +365,7 @@ gcab_test_cabinet_load_func (void)
         };
 
         /* read file */
-        g_print ("%s... ", tests[i].fn);
+        g_test_message ("%s... ", tests[i].fn);
         fn = gcab_test_get_filename (tests[i].fn);
         g_assert (fn != NULL);
         file = g_file_new_for_path (fn);
@@ -446,7 +446,7 @@ gcab_test_cabinet_error_cves_func (void)
         g_autoptr(GInputStream) in = NULL;
 
         /* read file */
-        g_print ("%s... ", tests[i]);
+        g_test_message ("%s... ", tests[i]);
         fn = gcab_test_get_filename (tests[i]);
         g_assert (fn != NULL);
         file = g_file_new_for_path (fn);
@@ -557,7 +557,7 @@ gcab_test_cabinet_write_func (void)
         }
 
         /* write the file */
-        g_print ("%s... ", tests[i].fn);
+        g_test_message ("%s... ", tests[i].fn);
         fn_out = g_build_filename ("/tmp", tests[i].fn, NULL);
         file_out = g_file_new_for_path (fn_out);
         op = G_OUTPUT_STREAM (g_file_replace (file_out, NULL, FALSE, 0, NULL, &error));


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