mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 20:35:49 +01:00
testutils: Return a boolean from g_test_case_run()
Return value is intened to be TRUE for success, FALSE for failure. Currently we return TRUE all the time. Previously the test returned 0 all the time.
This commit is contained in:
parent
01602e1695
commit
19fdb18ef8
@ -1146,7 +1146,7 @@ g_test_queue_destroy (GDestroyNotify destroy_func,
|
|||||||
test_destroy_queue = dentry;
|
test_destroy_queue = dentry;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static gboolean
|
||||||
test_case_run (GTestCase *tc)
|
test_case_run (GTestCase *tc)
|
||||||
{
|
{
|
||||||
gchar *old_name = test_run_name, *old_base = g_strdup (test_uri_base);
|
gchar *old_name = test_run_name, *old_base = g_strdup (test_uri_base);
|
||||||
@ -1195,7 +1195,7 @@ test_case_run (GTestCase *tc)
|
|||||||
test_run_name = old_name;
|
test_run_name = old_name;
|
||||||
g_free (test_uri_base);
|
g_free (test_uri_base);
|
||||||
test_uri_base = old_base;
|
test_uri_base = old_base;
|
||||||
return 0;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1220,7 +1220,8 @@ g_test_run_suite_internal (GTestSuite *suite,
|
|||||||
if (l == n && strncmp (path, tc->name, n) == 0)
|
if (l == n && strncmp (path, tc->name, n) == 0)
|
||||||
{
|
{
|
||||||
n_good++;
|
n_good++;
|
||||||
n_bad += test_case_run (tc) != 0;
|
if (!test_case_run (tc))
|
||||||
|
n_bad++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_slist_free (reversed);
|
g_slist_free (reversed);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user