31 lines
557 B
C
31 lines
557 B
C
/*
|
|
* Copyright 2016 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_TESTS_LOOP_H
|
|
#define OCARINA_TESTS_LOOP_H
|
|
|
|
static GMainLoop *__test_main_loop;
|
|
|
|
static int __test_loop_on_idle(gpointer data)
|
|
{
|
|
g_main_loop_quit(__test_main_loop);
|
|
return G_SOURCE_CONTINUE;
|
|
}
|
|
|
|
static void test_loop_init()
|
|
{
|
|
__test_main_loop = g_main_loop_new(NULL, FALSE);
|
|
g_idle_add(__test_loop_on_idle, NULL);
|
|
}
|
|
|
|
static void test_loop_deinit()
|
|
{
|
|
g_main_loop_unref(__test_main_loop);
|
|
}
|
|
|
|
static void test_main_loop()
|
|
{
|
|
g_main_loop_run(__test_main_loop);
|
|
}
|
|
#endif /* OCARINA_TESTS_LOOP_H */
|