diff --git a/glib/gtestutils.c b/glib/gtestutils.c index b640d9293..c1d827ecf 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -1135,9 +1135,19 @@ g_test_log (GTestLogType lbit, break; case G_TEST_LOG_ERROR: if (test_tap_log) - g_print ("%sBail out! %s\n", test_is_subtest ? "# " : "", string1); + { + char *message = g_strdup (string1); + char *line = message; + + while ((line = strchr (line, '\n'))) + *(line++) = ' '; + + g_print ("%sBail out! %s\n", test_is_subtest ? "# " : "", g_strstrip (message)); + } else if (g_test_verbose ()) - g_print ("(ERROR: %s)\n", string1); + { + g_print ("(ERROR: %s)\n", string1); + } break; default: ; } diff --git a/glib/tests/testing-helper.c b/glib/tests/testing-helper.c index c4cbe0058..4d26221ea 100644 --- a/glib/tests/testing-helper.c +++ b/glib/tests/testing-helper.c @@ -54,7 +54,7 @@ test_fail (void) static void test_error (void) { - g_error ("This should error out\nBecause it's just wrong!"); + g_error ("This should error out\nBecause it's just\nwrong!"); } static void diff --git a/glib/tests/testing.c b/glib/tests/testing.c index 5854c3cf5..885ac7541 100644 --- a/glib/tests/testing.c +++ b/glib/tests/testing.c @@ -1730,7 +1730,7 @@ test_tap_error (void) g_assert_nonnull (interesting_lines); interesting_lines += strlen (expected_tap_header); - g_assert_cmpstr (interesting_lines, ==, "# Bail out! GLib-FATAL-ERROR: This should error out\n" + g_assert_cmpstr (interesting_lines, ==, "# Bail out! GLib-FATAL-ERROR: This should error out " "Because it's just wrong!\n"); g_free (output); @@ -1771,7 +1771,7 @@ test_tap_error_and_pass (void) g_assert_nonnull (interesting_lines); interesting_lines += strlen (expected_tap_header); - g_assert_cmpstr (interesting_lines, ==, "# Bail out! GLib-FATAL-ERROR: This should error out\n" + g_assert_cmpstr (interesting_lines, ==, "# Bail out! GLib-FATAL-ERROR: This should error out " "Because it's just wrong!\n"); g_free (output);