Fix the gtestutils core dump prevention again

The previous patch was preventing core dumps on failed assertions, but
not on g_error()s.
This commit is contained in:
Dan Winship 2013-11-27 10:15:44 -05:00
parent 1300108e0c
commit 695070b52e

View File

@ -290,10 +290,10 @@ static gpointer fatal_log_data;
/* --- functions --- */ /* --- functions --- */
static void _g_log_abort (void) G_GNUC_NORETURN; static void _g_log_abort (gboolean breakpoint) G_GNUC_NORETURN;
static void static void
_g_log_abort (void) _g_log_abort (gboolean breakpoint)
{ {
if (g_test_subprocess ()) if (g_test_subprocess ())
{ {
@ -304,6 +304,9 @@ _g_log_abort (void)
*/ */
_exit (1); _exit (1);
} }
if (breakpoint)
G_BREAKPOINT ();
else else
abort (); abort ();
} }
@ -1033,15 +1036,9 @@ g_logv (const gchar *log_domain,
MessageBox (NULL, locale_msg, NULL, MessageBox (NULL, locale_msg, NULL,
MB_ICONERROR|MB_SETFOREGROUND); MB_ICONERROR|MB_SETFOREGROUND);
} }
if (IsDebuggerPresent () && !(test_level & G_LOG_FLAG_RECURSION)) _g_log_abort (IsDebuggerPresent () && !(test_level & G_LOG_FLAG_RECURSION));
G_BREAKPOINT ();
else
_g_log_abort ();
#else #else
if (!(test_level & G_LOG_FLAG_RECURSION)) _g_log_abort (!(test_level & G_LOG_FLAG_RECURSION));
G_BREAKPOINT ();
else
_g_log_abort ();
#endif /* !G_OS_WIN32 */ #endif /* !G_OS_WIN32 */
} }
@ -1132,7 +1129,7 @@ g_assert_warning (const char *log_domain,
line, line,
pretty_function, pretty_function,
expression); expression);
_g_log_abort (); _g_log_abort (FALSE);
} }
/** /**