[tests] Don't add a newline to the end of g_test_message calls

Two of the timeline tests were calling g_test_message and adding a \n
so the output looked odd.
This commit is contained in:
Neil Roberts 2009-06-11 11:38:49 +01:00
parent 19cbb30783
commit 6bb5b3a13e
2 changed files with 17 additions and 17 deletions

View File

@ -57,16 +57,16 @@ new_frame_cb (ClutterTimeline *timeline,
if (current_frame >= (state->expected_frame-TEST_ERROR_TOLERANCE) if (current_frame >= (state->expected_frame-TEST_ERROR_TOLERANCE)
&& current_frame <= (state->expected_frame+TEST_ERROR_TOLERANCE)) && current_frame <= (state->expected_frame+TEST_ERROR_TOLERANCE))
{ {
g_test_message ("\nelapsed milliseconds=%-5li " g_test_message ("elapsed milliseconds=%-5li "
"expected frame=%-4i actual frame=%-4i (OK)\n", "expected frame=%-4i actual frame=%-4i (OK)",
msec_diff, msec_diff,
state->expected_frame, state->expected_frame,
current_frame); current_frame);
} }
else else
{ {
g_test_message ("\nelapsed milliseconds=%-5li " g_test_message ("elapsed milliseconds=%-5li "
"expected frame=%-4i actual frame=%-4i (FAILED)\n", "expected frame=%-4i actual frame=%-4i (FAILED)",
msec_diff, msec_diff,
state->expected_frame, state->expected_frame,
current_frame); current_frame);
@ -77,7 +77,7 @@ new_frame_cb (ClutterTimeline *timeline,
{ {
state->expected_frame = current_frame + (TEST_TIMELINE_FPS / 4); state->expected_frame = current_frame + (TEST_TIMELINE_FPS / 4);
g_test_message ("Sleeping for 250ms " g_test_message ("Sleeping for 250ms "
"so next frame should be (%i + %i) = %i\n", "so next frame should be (%i + %i) = %i",
current_frame, current_frame,
(TEST_TIMELINE_FPS / 4), (TEST_TIMELINE_FPS / 4),
state->expected_frame); state->expected_frame);
@ -87,7 +87,7 @@ new_frame_cb (ClutterTimeline *timeline,
{ {
state->expected_frame = current_frame + TEST_TIMELINE_FPS; state->expected_frame = current_frame + TEST_TIMELINE_FPS;
g_test_message ("Sleeping for 1sec " g_test_message ("Sleeping for 1sec "
"so next frame should be (%i + %i) = %i\n", "so next frame should be (%i + %i) = %i",
current_frame, current_frame,
TEST_TIMELINE_FPS, TEST_TIMELINE_FPS,
state->expected_frame); state->expected_frame);
@ -99,7 +99,7 @@ new_frame_cb (ClutterTimeline *timeline,
state->expected_frame += loop_overflow; state->expected_frame += loop_overflow;
state->expected_frame -= TEST_TIMELINE_DURATION; state->expected_frame -= TEST_TIMELINE_DURATION;
g_test_message ("End of timeline reached: " g_test_message ("End of timeline reached: "
"Wrapping expected frame too %i\n", "Wrapping expected frame too %i",
state->expected_frame); state->expected_frame);
} }

View File

@ -16,17 +16,17 @@ typedef struct _TestState
static gboolean static gboolean
watchdog_timeout (TestState *state) watchdog_timeout (TestState *state)
{ {
g_test_message ("Watchdog timer kicking in\n"); g_test_message ("Watchdog timer kicking in");
g_test_message ("rewind_count=%i\n", state->rewind_count); g_test_message ("rewind_count=%i", state->rewind_count);
if (state->rewind_count <= 3) if (state->rewind_count <= 3)
{ {
/* The test has hung */ /* The test has hung */
g_test_message ("Failed (This test shouldn't have hung!)\n"); g_test_message ("Failed (This test shouldn't have hung!)");
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
else else
{ {
g_test_message ("Passed\n"); g_test_message ("Passed");
clutter_main_quit (); clutter_main_quit ();
} }
@ -42,8 +42,8 @@ new_frame_cb (ClutterTimeline *timeline,
if (elapsed_time == TEST_TIMELINE_DURATION) if (elapsed_time == TEST_TIMELINE_DURATION)
{ {
g_test_message ("new-frame signal recieved (end of timeline)\n"); g_test_message ("new-frame signal received (end of timeline)");
g_test_message ("Rewinding timeline\n"); g_test_message ("Rewinding timeline");
clutter_timeline_rewind (timeline); clutter_timeline_rewind (timeline);
state->rewind_count++; state->rewind_count++;
} }
@ -51,16 +51,16 @@ new_frame_cb (ClutterTimeline *timeline,
{ {
if (elapsed_time == 0) if (elapsed_time == 0)
{ {
g_test_message ("new-frame signal recieved (start of timeline)\n"); g_test_message ("new-frame signal received (start of timeline)");
} }
else else
{ {
g_test_message ("new-frame signal recieved (mid frame)\n"); g_test_message ("new-frame signal received (mid frame)");
} }
if (state->rewind_count >= 2) if (state->rewind_count >= 2)
{ {
g_test_message ("Sleeping for 1 second\n"); g_test_message ("Sleeping for 1 second");
g_usleep (1000000); g_usleep (1000000);
} }
} }
@ -79,7 +79,7 @@ test_timeline_rewind (TestConformSimpleFixture *fixture,
G_CALLBACK(new_frame_cb), G_CALLBACK(new_frame_cb),
&state); &state);
g_test_message ("Installing a watchdog timeout " g_test_message ("Installing a watchdog timeout "
"to determine if this test hangs\n"); "to determine if this test hangs");
g_timeout_add (TEST_WATCHDOG_KICK_IN_SECONDS*1000, g_timeout_add (TEST_WATCHDOG_KICK_IN_SECONDS*1000,
(GSourceFunc)watchdog_timeout, (GSourceFunc)watchdog_timeout,
&state); &state);