mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-24 09:58:54 +02:00
gtestutils: Bail out of g_test_init() if G_DISABLE_ASSERT is defined
If G_DISABLE_ASSERT is defined, g_assert() is a no-op. Despite it now being standard practice to *not* use g_assert() in unit tests (use g_assert_*() instead), a lot of existing unit tests still use it. Compiling those tests with G_DISABLE_ASSERT would make them silently no-ops. Avoid that by warning the user loudly. Note that it’s pretty rare for people to compile with G_DISABLE_ASSERT, so it’s not expected that this will be hit often. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://gitlab.gnome.org/GNOME/glib/issues/976
This commit is contained in:
@@ -1274,9 +1274,9 @@ parse_args (gint *argc_p,
|
||||
* Since: 2.16
|
||||
*/
|
||||
void
|
||||
g_test_init (int *argc,
|
||||
char ***argv,
|
||||
...)
|
||||
(g_test_init) (int *argc,
|
||||
char ***argv,
|
||||
...)
|
||||
{
|
||||
static char seedstr[4 + 4 * 8 + 1];
|
||||
va_list args;
|
||||
|
Reference in New Issue
Block a user