[Pixman] [PATCH 1/2] Extend blitters test to first check known failure cases
Søren Sandmann
sandmann at daimi.au.dk
Wed Apr 7 16:39:04 PDT 2010
From: Søren Sandmann Pedersen <ssp at redhat.com>
This serves to make sure we don't accidentally reintroduce old bugs.
---
test/blitters-test.c | 43 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 5e33031..25b3c7b 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -437,6 +437,46 @@ initialize_palette (void)
palette.ent[i] = lcg_rand() & 0xff;
}
+typedef struct
+{
+ uint32_t nth;
+ uint32_t crc;
+} testcase_t;
+
+static testcase_t known_failures[] =
+{
+ { 592654, 0x06BF6ADE },
+};
+
+static int
+run_known_failures (void)
+{
+ int i;
+
+ for (i = 0; i < sizeof (known_failures) / sizeof (known_failures[0]); ++i)
+ {
+ testcase_t *testcase = &(known_failures[i]);
+ uint32_t crc;
+
+ crc = test_composite (0, testcase->nth, 0);
+
+ if (crc != testcase->crc)
+ {
+ crc = test_composite (0, testcase->nth, 1);
+
+ printf ("Test case %d failed\n"
+ "CRC: %08x\n"
+ "Expected: %08x\n",
+ testcase->nth,
+ crc,
+ testcase->crc);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
int
main (int argc, char *argv[])
{
@@ -446,6 +486,9 @@ main (int argc, char *argv[])
initialize_palette();
+ if (run_known_failures ())
+ return 1;
+
if (argc >= 3)
{
n1 = atoi (argv[1]);
--
1.7.0.1
More information about the Pixman
mailing list