diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-12-09 14:44:51 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-12-12 11:11:48 +0000 |
commit | dfc49a67e62bea359b33413e9b882e92952431de (patch) | |
tree | be1c51655516feb8c295f8371fda50d4546fd75b | |
parent | 0ebbcd671c362d98a60214872fa48aee1e42dde1 (diff) |
[test] Trim the number of fallback resolutions tested.
Simplify the test matrix to only include testing the fallback-resolution
of a uniform scale in one or both axes.
38 files changed, 121 insertions, 121 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 4e3731bc..769493b8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -479,39 +479,19 @@ REFERENCE_IMAGES = \ extend-repeat-similar.ps3.ref.png \ fallback-resolution.ppi37.5x37.5.ref.png \ fallback-resolution.ppi37.5x72.ref.png \ - fallback-resolution.ppi37.5x75.ref.png \ - fallback-resolution.ppi37.5x150.ref.png \ - fallback-resolution.ppi37.5x300.ref.png \ - fallback-resolution.ppi37.5x600.ref.png \ fallback-resolution.ppi72x37.5.ref.png \ fallback-resolution.ppi72x72.ref.png \ fallback-resolution.ppi72x75.ref.png \ fallback-resolution.ppi72x150.ref.png \ fallback-resolution.ppi72x300.ref.png \ fallback-resolution.ppi72x600.ref.png \ - fallback-resolution.ppi75x37.5.ref.png \ fallback-resolution.ppi75x72.ref.png \ fallback-resolution.ppi75x75.ref.png \ - fallback-resolution.ppi75x150.ref.png \ - fallback-resolution.ppi75x300.ref.png \ - fallback-resolution.ppi75x600.ref.png \ - fallback-resolution.ppi150x37.5.ref.png \ fallback-resolution.ppi150x72.ref.png \ - fallback-resolution.ppi150x75.ref.png \ fallback-resolution.ppi150x150.ref.png \ - fallback-resolution.ppi150x300.ref.png \ - fallback-resolution.ppi150x600.ref.png \ - fallback-resolution.ppi300x37.5.ref.png \ fallback-resolution.ppi300x72.ref.png \ - fallback-resolution.ppi300x75.ref.png \ - fallback-resolution.ppi300x150.ref.png \ fallback-resolution.ppi300x300.ref.png \ - fallback-resolution.ppi300x600.ref.png \ - fallback-resolution.ppi600x37.5.ref.png \ fallback-resolution.ppi600x72.ref.png \ - fallback-resolution.ppi600x75.ref.png \ - fallback-resolution.ppi600x150.ref.png \ - fallback-resolution.ppi600x300.ref.png \ fallback-resolution.ppi600x600.ref.png \ fill-alpha.ref.png \ fill-alpha-pattern.ref.png \ diff --git a/test/fallback-resolution.c b/test/fallback-resolution.c index c27ab905..7b1d313b 100644 --- a/test/fallback-resolution.c +++ b/test/fallback-resolution.c @@ -301,21 +301,43 @@ preamble (cairo_test_context_t *ctx) { cairo_t *cr; cairo_test_status_t ret = CAIRO_TEST_UNTESTED; - double ppi[] = { 600., 300., 150., 75., 72, 37.5 }; + struct { + double x, y; + } ppi[] = { + { 600, 600 }, + { 600, 72 }, + + { 300, 300 }, + { 300, 72 }, + + { 150, 150 }, + { 150, 72 }, + + { 75, 75 }, + { 75, 72 }, + + { 72, 600 }, + { 72, 300 }, + { 72, 150 }, + { 72, 75 }, + { 72, 72 }, + { 72, 37.5 }, + + { 37.5, 72 }, + { 37.5, 37.5 }, + }; unsigned int i; - int ppi_x, ppi_y, num_ppi; + int n, num_ppi; num_ppi = sizeof (ppi) / sizeof (ppi[0]); #if GENERATE_REFERENCE - for (ppi_x = 0; ppi_x < num_ppi; ppi_x++) { - for (ppi_y = 0; ppi_y < num_ppi; ppi_y++) { - char *ref_name; - xasprintf (&ref_name, "fallback-resolution.ppi%gx%g.ref.png", - ppi[ppi_x], ppi[ppi_y]); - generate_reference (ppi[ppi_x], ppi[ppi_y], ref_name); - free (ref_name); - } + for (n = 0; n < num_ppi; n++) { + char *ref_name; + xasprintf (&ref_name, "fallback-resolution.ppi%gx%g.ref.png", + ppi[n].x, ppi[n].y); + generate_reference (ppi[n].x, ppi[n].y, ref_name); + free (ref_name); } #endif @@ -331,7 +353,7 @@ preamble (cairo_test_context_t *ctx) continue; format = cairo_boilerplate_content_name (target->content); - xasprintf (&base_name, "fallback-resolution.%s-%s", + xasprintf (&base_name, "fallback-resolution.%s.%s", target->name, format); @@ -359,108 +381,106 @@ preamble (cairo_test_context_t *ctx) /* we need to recreate the surface for each resolution as we include * SVG in testing which does not support the paginated interface. */ - for (ppi_x = 0; ppi_x < num_ppi; ppi_x++) { - for (ppi_y = 0; ppi_y < num_ppi; ppi_y++) { - char *test_name; - cairo_bool_t pass; - - xasprintf (&test_name, "fallback-resolution.ppi%gx%g", - ppi[ppi_x], ppi[ppi_y]); - xasprintf (&base_name, "%s-%s-%s", - test_name, - target->name, - format); - - surface = (target->create_surface) (base_name, - target->content, - SIZE + 25, SIZE + 25, - SIZE + 25, SIZE + 25, - CAIRO_BOILERPLATE_MODE_TEST, - 0, - &closure); - if (surface == NULL || cairo_surface_status (surface)) { - cairo_test_log (ctx, "Failed to generate surface: %s-%s\n", - target->name, - format); - free (base_name); - free (test_name); - ret = CAIRO_TEST_FAILURE; - continue; - } - - cairo_test_log (ctx, - "Testing fallback-resolution %gx%g with %s target\n", - ppi[ppi_x], ppi[ppi_y], target->name); - printf ("%s:\t", base_name); - fflush (stdout); - - if (target->force_fallbacks != NULL) - target->force_fallbacks (surface, ~0U); - cr = cairo_create (surface); -#if SET_TOLERANCE - cairo_set_tolerance (cr, 3.0); -#endif - - cairo_surface_set_device_offset (surface, 25, 25); - cairo_surface_set_fallback_resolution (surface, - ppi[ppi_x], ppi[ppi_y]); + for (n = 0; n < num_ppi; n++) { + char *test_name; + cairo_bool_t pass; + + xasprintf (&test_name, "fallback-resolution.ppi%gx%g", + ppi[n].x, ppi[n].y); + xasprintf (&base_name, "%s.%s.%s", + test_name, + target->name, + format); + + surface = (target->create_surface) (base_name, + target->content, + SIZE + 25, SIZE + 25, + SIZE + 25, SIZE + 25, + CAIRO_BOILERPLATE_MODE_TEST, + 0, + &closure); + if (surface == NULL || cairo_surface_status (surface)) { + cairo_test_log (ctx, "Failed to generate surface: %s.%s\n", + target->name, + format); + free (base_name); + free (test_name); + ret = CAIRO_TEST_FAILURE; + continue; + } - cairo_save (cr); { - cairo_set_source_rgb (cr, 1, 1, 1); - cairo_paint (cr); - } cairo_restore (cr); + cairo_test_log (ctx, + "Testing fallback-resolution %gx%g with %s target\n", + ppi[n].x, ppi[n].y, target->name); + printf ("%s:\t", base_name); + fflush (stdout); - /* First draw the top half in a conventional way. */ - cairo_save (cr); { - cairo_rectangle (cr, 0, 0, SIZE, SIZE / 2.0); - cairo_clip (cr); + if (target->force_fallbacks != NULL) + target->force_fallbacks (surface, ~0U); + cr = cairo_create (surface); +#if SET_TOLERANCE + cairo_set_tolerance (cr, 3.0); +#endif - draw (cr, SIZE, SIZE); - } cairo_restore (cr); + cairo_surface_set_device_offset (surface, 25, 25); + cairo_surface_set_fallback_resolution (surface, + ppi[n].x, ppi[n].y); - /* Then draw the bottom half in a separate group, - * (exposing a bug in 1.6.4 with the group not being - * rendered with the correct fallback resolution). */ - cairo_save (cr); { - cairo_rectangle (cr, 0, SIZE / 2.0, SIZE, SIZE / 2.0); - cairo_clip (cr); + cairo_save (cr); { + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_paint (cr); + } cairo_restore (cr); - cairo_push_group (cr); { - draw (cr, SIZE, SIZE); - } cairo_pop_group_to_source (cr); + /* First draw the top half in a conventional way. */ + cairo_save (cr); { + cairo_rectangle (cr, 0, 0, SIZE, SIZE / 2.0); + cairo_clip (cr); - cairo_paint (cr); - } cairo_restore (cr); + draw (cr, SIZE, SIZE); + } cairo_restore (cr); - status = cairo_status (cr); - cairo_destroy (cr); + /* Then draw the bottom half in a separate group, + * (exposing a bug in 1.6.4 with the group not being + * rendered with the correct fallback resolution). */ + cairo_save (cr); { + cairo_rectangle (cr, 0, SIZE / 2.0, SIZE, SIZE / 2.0); + cairo_clip (cr); - pass = FALSE; - if (status) { - cairo_test_log (ctx, "Error: Failed to create target surface: %s\n", - cairo_status_to_string (status)); + cairo_push_group (cr); { + draw (cr, SIZE, SIZE); + } cairo_pop_group_to_source (cr); + + cairo_paint (cr); + } cairo_restore (cr); + + status = cairo_status (cr); + cairo_destroy (cr); + + pass = FALSE; + if (status) { + cairo_test_log (ctx, "Error: Failed to create target surface: %s\n", + cairo_status_to_string (status)); + ret = CAIRO_TEST_FAILURE; + } else { + /* extract the image and compare it to our reference */ + if (! check_result (ctx, target, test_name, base_name, surface)) ret = CAIRO_TEST_FAILURE; - } else { - /* extract the image and compare it to our reference */ - if (! check_result (ctx, target, test_name, base_name, surface)) - ret = CAIRO_TEST_FAILURE; - else - pass = TRUE; - } - cairo_surface_destroy (surface); - if (target->cleanup) - target->cleanup (closure); + else + pass = TRUE; + } + cairo_surface_destroy (surface); + if (target->cleanup) + target->cleanup (closure); - free (base_name); - free (test_name); + free (base_name); + free (test_name); - if (pass) { - printf ("PASS\n"); - } else { - printf ("FAIL\n"); - } - fflush (stdout); + if (pass) { + printf ("PASS\n"); + } else { + printf ("FAIL\n"); } + fflush (stdout); } } diff --git a/test/fallback-resolution.ppi150x150.ref.png b/test/fallback-resolution.ppi150x150.ref.png Binary files differindex 8a69481f..40e68a9e 100644 --- a/test/fallback-resolution.ppi150x150.ref.png +++ b/test/fallback-resolution.ppi150x150.ref.png diff --git a/test/fallback-resolution.ppi150x300.ref.png b/test/fallback-resolution.ppi150x300.ref.png Binary files differdeleted file mode 100644 index a23c62fd..00000000 --- a/test/fallback-resolution.ppi150x300.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi150x37.5.ref.png b/test/fallback-resolution.ppi150x37.5.ref.png Binary files differdeleted file mode 100644 index 640046ea..00000000 --- a/test/fallback-resolution.ppi150x37.5.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi150x600.ref.png b/test/fallback-resolution.ppi150x600.ref.png Binary files differdeleted file mode 100644 index baae3567..00000000 --- a/test/fallback-resolution.ppi150x600.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi150x72.ref.png b/test/fallback-resolution.ppi150x72.ref.png Binary files differindex beee81d4..47e0c58f 100644 --- a/test/fallback-resolution.ppi150x72.ref.png +++ b/test/fallback-resolution.ppi150x72.ref.png diff --git a/test/fallback-resolution.ppi150x75.ref.png b/test/fallback-resolution.ppi150x75.ref.png Binary files differdeleted file mode 100644 index 93328190..00000000 --- a/test/fallback-resolution.ppi150x75.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi300x150.ref.png b/test/fallback-resolution.ppi300x150.ref.png Binary files differdeleted file mode 100644 index 30c0e72a..00000000 --- a/test/fallback-resolution.ppi300x150.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi300x300.ref.png b/test/fallback-resolution.ppi300x300.ref.png Binary files differindex 66ed3ebe..61af74ca 100644 --- a/test/fallback-resolution.ppi300x300.ref.png +++ b/test/fallback-resolution.ppi300x300.ref.png diff --git a/test/fallback-resolution.ppi300x37.5.ref.png b/test/fallback-resolution.ppi300x37.5.ref.png Binary files differdeleted file mode 100644 index 42acb2de..00000000 --- a/test/fallback-resolution.ppi300x37.5.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi300x600.ref.png b/test/fallback-resolution.ppi300x600.ref.png Binary files differdeleted file mode 100644 index 5be37935..00000000 --- a/test/fallback-resolution.ppi300x600.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi300x72.ref.png b/test/fallback-resolution.ppi300x72.ref.png Binary files differindex a96fb72c..d790a386 100644 --- a/test/fallback-resolution.ppi300x72.ref.png +++ b/test/fallback-resolution.ppi300x72.ref.png diff --git a/test/fallback-resolution.ppi300x75.ref.png b/test/fallback-resolution.ppi300x75.ref.png Binary files differdeleted file mode 100644 index 9500328a..00000000 --- a/test/fallback-resolution.ppi300x75.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi37.5x150.ref.png b/test/fallback-resolution.ppi37.5x150.ref.png Binary files differdeleted file mode 100644 index 18143466..00000000 --- a/test/fallback-resolution.ppi37.5x150.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi37.5x300.ref.png b/test/fallback-resolution.ppi37.5x300.ref.png Binary files differdeleted file mode 100644 index 823ff01e..00000000 --- a/test/fallback-resolution.ppi37.5x300.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi37.5x37.5.ref.png b/test/fallback-resolution.ppi37.5x37.5.ref.png Binary files differindex fe87bc18..172fbcd7 100644 --- a/test/fallback-resolution.ppi37.5x37.5.ref.png +++ b/test/fallback-resolution.ppi37.5x37.5.ref.png diff --git a/test/fallback-resolution.ppi37.5x600.ref.png b/test/fallback-resolution.ppi37.5x600.ref.png Binary files differdeleted file mode 100644 index 614f6074..00000000 --- a/test/fallback-resolution.ppi37.5x600.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi37.5x72.ref.png b/test/fallback-resolution.ppi37.5x72.ref.png Binary files differindex 5156dd62..cac416ad 100644 --- a/test/fallback-resolution.ppi37.5x72.ref.png +++ b/test/fallback-resolution.ppi37.5x72.ref.png diff --git a/test/fallback-resolution.ppi37.5x75.ref.png b/test/fallback-resolution.ppi37.5x75.ref.png Binary files differdeleted file mode 100644 index 8d3b8280..00000000 --- a/test/fallback-resolution.ppi37.5x75.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi600x150.ref.png b/test/fallback-resolution.ppi600x150.ref.png Binary files differdeleted file mode 100644 index 0173c0c6..00000000 --- a/test/fallback-resolution.ppi600x150.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi600x300.ref.png b/test/fallback-resolution.ppi600x300.ref.png Binary files differdeleted file mode 100644 index 4b91a2e5..00000000 --- a/test/fallback-resolution.ppi600x300.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi600x37.5.ref.png b/test/fallback-resolution.ppi600x37.5.ref.png Binary files differdeleted file mode 100644 index a65688f7..00000000 --- a/test/fallback-resolution.ppi600x37.5.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi600x600.ref.png b/test/fallback-resolution.ppi600x600.ref.png Binary files differindex c5694a3a..34a2e561 100644 --- a/test/fallback-resolution.ppi600x600.ref.png +++ b/test/fallback-resolution.ppi600x600.ref.png diff --git a/test/fallback-resolution.ppi600x72.ref.png b/test/fallback-resolution.ppi600x72.ref.png Binary files differindex e1faae5e..ed45777b 100644 --- a/test/fallback-resolution.ppi600x72.ref.png +++ b/test/fallback-resolution.ppi600x72.ref.png diff --git a/test/fallback-resolution.ppi600x75.ref.png b/test/fallback-resolution.ppi600x75.ref.png Binary files differdeleted file mode 100644 index 23065b10..00000000 --- a/test/fallback-resolution.ppi600x75.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi72x150.ref.png b/test/fallback-resolution.ppi72x150.ref.png Binary files differindex a8662300..db61cba2 100644 --- a/test/fallback-resolution.ppi72x150.ref.png +++ b/test/fallback-resolution.ppi72x150.ref.png diff --git a/test/fallback-resolution.ppi72x300.ref.png b/test/fallback-resolution.ppi72x300.ref.png Binary files differindex 119c1a29..76b5b0c2 100644 --- a/test/fallback-resolution.ppi72x300.ref.png +++ b/test/fallback-resolution.ppi72x300.ref.png diff --git a/test/fallback-resolution.ppi72x37.5.ref.png b/test/fallback-resolution.ppi72x37.5.ref.png Binary files differindex 8260c104..a459d52d 100644 --- a/test/fallback-resolution.ppi72x37.5.ref.png +++ b/test/fallback-resolution.ppi72x37.5.ref.png diff --git a/test/fallback-resolution.ppi72x600.ref.png b/test/fallback-resolution.ppi72x600.ref.png Binary files differindex 82f6ad29..38235a3e 100644 --- a/test/fallback-resolution.ppi72x600.ref.png +++ b/test/fallback-resolution.ppi72x600.ref.png diff --git a/test/fallback-resolution.ppi72x72.ref.png b/test/fallback-resolution.ppi72x72.ref.png Binary files differindex b9b38031..b76fd944 100644 --- a/test/fallback-resolution.ppi72x72.ref.png +++ b/test/fallback-resolution.ppi72x72.ref.png diff --git a/test/fallback-resolution.ppi72x75.ref.png b/test/fallback-resolution.ppi72x75.ref.png Binary files differindex 2d6c598d..3c22ccac 100644 --- a/test/fallback-resolution.ppi72x75.ref.png +++ b/test/fallback-resolution.ppi72x75.ref.png diff --git a/test/fallback-resolution.ppi75x150.ref.png b/test/fallback-resolution.ppi75x150.ref.png Binary files differdeleted file mode 100644 index b23395d7..00000000 --- a/test/fallback-resolution.ppi75x150.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi75x300.ref.png b/test/fallback-resolution.ppi75x300.ref.png Binary files differdeleted file mode 100644 index 73971ca7..00000000 --- a/test/fallback-resolution.ppi75x300.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi75x37.5.ref.png b/test/fallback-resolution.ppi75x37.5.ref.png Binary files differdeleted file mode 100644 index c4481eee..00000000 --- a/test/fallback-resolution.ppi75x37.5.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi75x600.ref.png b/test/fallback-resolution.ppi75x600.ref.png Binary files differdeleted file mode 100644 index 01a33248..00000000 --- a/test/fallback-resolution.ppi75x600.ref.png +++ /dev/null diff --git a/test/fallback-resolution.ppi75x72.ref.png b/test/fallback-resolution.ppi75x72.ref.png Binary files differindex 323e0e4d..161edb0e 100644 --- a/test/fallback-resolution.ppi75x72.ref.png +++ b/test/fallback-resolution.ppi75x72.ref.png diff --git a/test/fallback-resolution.ppi75x75.ref.png b/test/fallback-resolution.ppi75x75.ref.png Binary files differindex 03aa6c26..3769d090 100644 --- a/test/fallback-resolution.ppi75x75.ref.png +++ b/test/fallback-resolution.ppi75x75.ref.png |