summaryrefslogtreecommitdiff
path: root/tests/testing-util
diff options
context:
space:
mode:
authorGarrett Regier <garrettregier@gmail.com>2013-02-14 00:38:04 -0800
committerGarrett Regier <garrettregier@gmail.com>2013-02-14 03:45:18 -0800
commitff48b37e609008d7cbefb1c913c89ceabd68276f (patch)
tree3bd5b760b6db1387b52bce93582eff06c7ee8863 /tests/testing-util
parent9539be96f9b0df1e0afe8191945585334dc53631 (diff)
downloadlibpeas-ff48b37e609008d7cbefb1c913c89ceabd68276f.tar.gz
Make calling testing_init() required
Also encapsulate the order in which {g,gtk}_test_init() must be called.
Diffstat (limited to 'tests/testing-util')
-rw-r--r--tests/testing-util/testing-util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/testing-util/testing-util.c b/tests/testing-util/testing-util.c
index a97bcbd..7c78384 100644
--- a/tests/testing-util/testing-util.c
+++ b/tests/testing-util/testing-util.c
@@ -39,6 +39,7 @@ typedef struct {
static PeasEngine *engine = NULL;
static GPtrArray *log_hooks = NULL;
+static gboolean initialized = FALSE;
/* These are warnings and criticals that just have to happen
* for testing purposes and as such we don't want to abort on them.
@@ -119,7 +120,6 @@ void
testing_util_init (void)
{
GError *error = NULL;
- static gboolean initialized = FALSE;
if (initialized)
return;
@@ -153,13 +153,13 @@ testing_util_init (void)
PeasEngine *
testing_util_engine_new (void)
{
+ g_assert (initialized);
+
/* testing_util_engine_free() checks that the
* engine is freed so only one engine can be created
*/
g_assert (engine == NULL);
- testing_util_init ();
-
/* Must be after requiring typelibs */
engine = peas_engine_new ();
@@ -192,6 +192,8 @@ testing_util_run_tests (void)
{
int retval;
+ g_assert (initialized);
+
retval = g_test_run ();
if (log_hooks != NULL)