From eecae8dfef452194bd183a86cfb7d31f8d93dcba Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Mon, 15 Oct 2012 21:18:40 +0300 Subject: [PATCH] flip_test: unify the name of the current test in status messages Signed-off-by: Imre Deak --- tests/flip_test.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/flip_test.c b/tests/flip_test.c index 5ea880d5..351edb71 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -84,6 +84,7 @@ struct event_state { }; struct test_output { + const char *test_name; uint32_t id; int mode_valid; drmModeModeInfo mode; @@ -543,8 +544,8 @@ static void flip_mode(struct test_output *o, int crtc, int duration) if (!o->mode_valid) return; - fprintf(stdout, "Beginning page flipping on crtc %d, connector %d\n", - crtc, o->id); + fprintf(stdout, "Beginning %s on crtc %d, connector %d\n", + o->test_name, crtc, o->id); o->fb_width = o->mode.hdisplay; o->fb_height = o->mode.vdisplay; @@ -592,8 +593,8 @@ static void flip_mode(struct test_output *o, int crtc, int duration) check_final_state(o, &o->flip_state, ellapsed); - fprintf(stdout, "\npage flipping on crtc %d, connector %d: PASSED\n", - crtc, o->id); + fprintf(stdout, "\n%s on crtc %d, connector %d: PASSED\n\n", + o->test_name, crtc, o->id); kmstest_remove_fb(drm_fd, o->fb_ids[1]); kmstest_remove_fb(drm_fd, o->fb_ids[0]); @@ -615,7 +616,7 @@ static int get_pipe_from_crtc_id(int crtc_id) return pfci.pipe; } -static int run_test(int duration, int flags) +static int run_test(int duration, int flags, const char *test_name) { struct test_output o; int c, i; @@ -633,6 +634,7 @@ static int run_test(int duration, int flags) int crtc; memset(&o, 0, sizeof(o)); + o.test_name = test_name; o.id = resources->connectors[c]; o.flags = flags; o.flip_state.name = "flip"; @@ -672,7 +674,7 @@ int main(int argc, char **argv) for (i = 0; i < sizeof(tests) / sizeof (tests[0]); i++) { printf("running testcase: %s\n", tests[i].name); - run_test(tests[i].duration, tests[i].flags); + run_test(tests[i].duration, tests[i].flags, tests[i].name); } close(drm_fd);