[tests] Assert as soon as possible

In order to give a usable location of the errors in the test
suite, we need to assert() as soon as possible.
This commit is contained in:
Emmanuele Bassi 2009-01-23 17:56:25 +00:00
parent 763de185e9
commit 0616237064

View File

@ -258,12 +258,9 @@ test_timeline (TestConformSimpleFixture *fixture,
clutter_main (); clutter_main ();
if (!check_timeline (timeline_1, &data_1, TRUE)) g_assert (check_timeline (timeline_1, &data_1, TRUE));
pass = FALSE; g_assert (check_timeline (timeline_2, &data_2, TRUE));
if (!check_timeline (timeline_2, &data_2, TRUE)) g_assert (check_timeline (timeline_3, &data_3, TRUE));
pass = FALSE;
if (!check_timeline (timeline_3, &data_3, TRUE))
pass = FALSE;
if (g_test_verbose ()) if (g_test_verbose ())
g_print ("With delay...\n"); g_print ("With delay...\n");
@ -284,12 +281,9 @@ test_timeline (TestConformSimpleFixture *fixture,
clutter_main (); clutter_main ();
if (!check_timeline (timeline_1, &data_1, FALSE)) g_assert (check_timeline (timeline_1, &data_1, FALSE));
pass = FALSE; g_assert (check_timeline (timeline_2, &data_2, FALSE));
if (!check_timeline (timeline_2, &data_2, FALSE)) g_assert (check_timeline (timeline_3, &data_3, FALSE));
pass = FALSE;
if (!check_timeline (timeline_3, &data_3, FALSE))
pass = FALSE;
g_object_unref (timeline_1); g_object_unref (timeline_1);
g_object_unref (timeline_2); g_object_unref (timeline_2);
@ -300,9 +294,4 @@ test_timeline (TestConformSimpleFixture *fixture,
timeline_data_destroy (&data_3); timeline_data_destroy (&data_3);
g_source_remove (delay_tag); g_source_remove (delay_tag);
if (g_test_verbose ())
g_print ("Overall result: %s\n", pass == TRUE ? "PASS" : "FAIL");
g_assert (pass == TRUE);
} }