shared/tests: add nmtst_g_source_set_boolean_true() helper

This commit is contained in:
Thomas Haller 2020-01-03 13:41:14 +01:00
parent 71fb823a43
commit 0008c6c801

View file

@ -967,6 +967,26 @@ nmtst_rand_perm_gslist (GRand *rand, GSList *list)
/*****************************************************************************/
static inline gboolean
nmtst_g_source_assert_not_called (gpointer user_data)
{
g_assert_not_reached ();
return G_SOURCE_CONTINUE;
}
static inline gboolean
nmtst_g_source_set_boolean_true (gpointer user_data)
{
gboolean *ptr = user_data;
g_assert (ptr);
g_assert (!*ptr);
*ptr = TRUE;
return G_SOURCE_CONTINUE;
}
/*****************************************************************************/
static inline gboolean
_nmtst_main_loop_run_timeout (gpointer user_data)
{
@ -2391,13 +2411,4 @@ nmtst_keyfile_get_num_keys (GKeyFile *keyfile,
/*****************************************************************************/
static inline gboolean
nmtst_g_source_assert_not_called (gpointer user_data)
{
g_assert_not_reached ();
return G_SOURCE_CONTINUE;
}
/*****************************************************************************/
#endif /* __NM_TEST_UTILS_H__ */