mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-27 17:46:53 +02:00
Merge branch 'glib-2.78.0-g_assert_cmpint' into 'main'
gtestutils.h: Fix warning with -Wsign-conversion caused by g_assert_cmpint See merge request GNOME/glib!3590
This commit is contained in:
commit
31e96edbdd
@ -54,7 +54,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
|
|||||||
gint64 __n1 = (n1), __n2 = (n2); \
|
gint64 __n1 = (n1), __n2 = (n2); \
|
||||||
if (__n1 cmp __n2) ; else \
|
if (__n1 cmp __n2) ; else \
|
||||||
g_assertion_message_cmpint (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
g_assertion_message_cmpint (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||||
#n1 " " #cmp " " #n2, __n1, #cmp, __n2, 'i'); \
|
#n1 " " #cmp " " #n2, (guint64)__n1, #cmp, (guint64)__n2, 'i'); \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
#define g_assert_cmpuint(n1, cmp, n2) G_STMT_START { \
|
#define g_assert_cmpuint(n1, cmp, n2) G_STMT_START { \
|
||||||
guint64 __n1 = (n1), __n2 = (n2); \
|
guint64 __n1 = (n1), __n2 = (n2); \
|
||||||
|
@ -138,6 +138,13 @@ glib_tests = {
|
|||||||
'args': [ '--verbose' ],
|
'args': [ '--verbose' ],
|
||||||
'extra_programs' : ['testing-helper'],
|
'extra_programs' : ['testing-helper'],
|
||||||
},
|
},
|
||||||
|
'testing-macro' : {
|
||||||
|
'args': [ '--verbose' ],
|
||||||
|
'extra_programs' : ['testing-helper'],
|
||||||
|
'source' : 'testing.c',
|
||||||
|
'c_args' : cc.get_id() == 'gcc' ? ['-Werror=sign-conversion'] : [],
|
||||||
|
'install' : false,
|
||||||
|
},
|
||||||
'test-printf' : {},
|
'test-printf' : {},
|
||||||
'thread' : {},
|
'thread' : {},
|
||||||
'thread-deprecated' : {},
|
'thread-deprecated' : {},
|
||||||
|
@ -486,7 +486,7 @@ test_random_conversions (void)
|
|||||||
int vint = g_test_rand_int();
|
int vint = g_test_rand_int();
|
||||||
char *err, *str = g_strdup_printf ("%d", vint);
|
char *err, *str = g_strdup_printf ("%d", vint);
|
||||||
gint64 vint64 = g_ascii_strtoll (str, &err, 10);
|
gint64 vint64 = g_ascii_strtoll (str, &err, 10);
|
||||||
g_assert_cmphex (vint, ==, vint64);
|
g_assert_cmpint (vint, ==, vint64);
|
||||||
g_assert_true (!err || *err == 0);
|
g_assert_true (!err || *err == 0);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user