[Intel-gfx] [PATCH 1/2] tests/pm_rps: use igt_assert_cmpint
Daniel Vetter
daniel.vetter at ffwll.ch
Fri Mar 14 11:07:48 CET 2014
Much better debug output almost for free.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
tests/pm_rps.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index b5dd494443ff..f5af9c2e92e8 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -110,25 +110,25 @@ static int do_writeval(FILE *filp, int val, int lerrno)
static void checkit(const int *freqs)
{
- igt_assert(freqs[MIN] <= freqs[MAX]);
- igt_assert(freqs[CUR] <= freqs[MAX]);
- igt_assert(freqs[MIN] <= freqs[CUR]);
- igt_assert(freqs[RPn] <= freqs[MIN]);
- igt_assert(freqs[MAX] <= freqs[RP0]);
- igt_assert(freqs[RP1] <= freqs[RP0]);
- igt_assert(freqs[RPn] <= freqs[RP1]);
+ igt_assert_cmpint(freqs[MIN], <=, freqs[MAX]);
+ igt_assert_cmpint(freqs[CUR], <=, freqs[MAX]);
+ igt_assert_cmpint(freqs[MIN], <=, freqs[CUR]);
+ igt_assert_cmpint(freqs[RPn], <=, freqs[MIN]);
+ igt_assert_cmpint(freqs[MAX], <=, freqs[RP0]);
+ igt_assert_cmpint(freqs[RP1], <=, freqs[RP0]);
+ igt_assert_cmpint(freqs[RPn], <=, freqs[RP1]);
igt_assert(freqs[RP0] != 0);
igt_assert(freqs[RP1] != 0);
}
static void matchit(const int *freqs1, const int *freqs2)
{
- igt_assert(freqs1[CUR] == freqs2[CUR]);
- igt_assert(freqs1[MIN] == freqs2[MIN]);
- igt_assert(freqs1[MAX] == freqs2[MAX]);
- igt_assert(freqs1[RP0] == freqs2[RP0]);
- igt_assert(freqs1[RP1] == freqs2[RP1]);
- igt_assert(freqs1[RPn] == freqs2[RPn]);
+ igt_assert_cmpint(freqs1[CUR], ==, freqs2[CUR]);
+ igt_assert_cmpint(freqs1[MIN], ==, freqs2[MIN]);
+ igt_assert_cmpint(freqs1[MAX], ==, freqs2[MAX]);
+ igt_assert_cmpint(freqs1[RP0], ==, freqs2[RP0]);
+ igt_assert_cmpint(freqs1[RP1], ==, freqs2[RP1]);
+ igt_assert_cmpint(freqs1[RPn], ==, freqs2[RPn]);
}
static void dump(const int *freqs)
@@ -434,7 +434,7 @@ static void idle_check(void)
wait += IDLE_WAIT_TIMESTEP_MSEC;
} while (wait < IDLE_WAIT_TIMEOUT_MSEC);
- igt_assert(freqs[CUR] == freqs[MIN]);
+ igt_assert_cmpint(freqs[CUR], ==, freqs[MIN]);
igt_debug("Required %d msec to reach cur=min\n", wait);
}
@@ -457,7 +457,7 @@ static void loaded_check(void)
wait += LOADED_WAIT_TIMESTEP_MSEC;
} while (wait < LOADED_WAIT_TIMEOUT_MSEC);
- igt_assert(freqs[CUR] == freqs[MAX]);
+ igt_assert_cmpint(freqs[CUR], ==, freqs[MAX]);
igt_debug("Required %d msec to reach cur=max\n", wait);
}
--
1.8.4.rc3
More information about the Intel-gfx
mailing list