mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-29 21:33:30 +02:00
don't treat debug/info/message as fatal messages by default
* glib/gtestutils.c: don't treat non-fatal messages as errors * glib/tests/.gitignore: silence * glib/tests/Makefile.am: updated * glib/tests/protocol.c: add a test for the message treatment
This commit is contained in:
@@ -1264,6 +1264,7 @@ gtest_default_log_handler (const gchar *log_domain,
|
||||
gpointer unused_data)
|
||||
{
|
||||
const gchar *strv[16];
|
||||
gboolean fatal = FALSE;
|
||||
gchar *msg;
|
||||
guint i = 0;
|
||||
if (log_domain)
|
||||
@@ -1272,7 +1273,10 @@ gtest_default_log_handler (const gchar *log_domain,
|
||||
strv[i++] = "-";
|
||||
}
|
||||
if (log_level & G_LOG_FLAG_FATAL)
|
||||
strv[i++] = "FATAL-";
|
||||
{
|
||||
strv[i++] = "FATAL-";
|
||||
fatal = TRUE;
|
||||
}
|
||||
if (log_level & G_LOG_FLAG_RECURSION)
|
||||
strv[i++] = "RECURSIVE-";
|
||||
if (log_level & G_LOG_LEVEL_ERROR)
|
||||
@@ -1291,7 +1295,7 @@ gtest_default_log_handler (const gchar *log_domain,
|
||||
strv[i++] = message;
|
||||
strv[i++] = NULL;
|
||||
msg = g_strjoinv ("", (gchar**) strv);
|
||||
g_test_log (G_TEST_LOG_ERROR, msg, NULL, 0, NULL);
|
||||
g_test_log (fatal ? G_TEST_LOG_ERROR : G_TEST_LOG_MESSAGE, msg, NULL, 0, NULL);
|
||||
g_log_default_handler (log_domain, log_level, message, unused_data);
|
||||
g_free (msg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user