shared/tests: add nmtst_g_source_set_boolean_true() helper

(cherry picked from commit 0008c6c801)
(cherry picked from commit 421844c89c)
This commit is contained in:
Thomas Haller 2020-01-03 13:41:14 +01:00
parent a7f451a2b3
commit 52bd1d8cef
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -981,6 +981,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)
{