Commit | Line | Data |
---|---|---|
a8144573 MW |
1 | Disable some image comparison tests on architectures such as i686 |
2 | where intermediate floating-point operations are done with 80-bit long | |
3 | doubles, and typically later rounded to 64-bit doubles. This double | |
4 | rounding causes small differences in the resulting pixel values | |
5 | compared with other architectures, causing the image comparisons to | |
6 | fail. | |
7 | ||
8 | Patch by Mark H Weaver <mhw@netris.org>. | |
9 | ||
10 | diff -ru libgd-2.2.3.orig/tests/gdimagecopyresampled/basic_alpha.c libgd-2.2.3/tests/gdimagecopyresampled/basic_alpha.c | |
11 | --- libgd-2.2.3.orig/tests/gdimagecopyresampled/basic_alpha.c 2016-07-21 04:06:42.000000000 -0400 | |
12 | +++ libgd-2.2.3/tests/gdimagecopyresampled/basic_alpha.c 2016-07-29 13:50:56.214877446 -0400 | |
13 | @@ -1,5 +1,6 @@ | |
14 | /* Testing basic gdImageCopyResampled() functionality with alpha channel */ | |
15 | ||
16 | +#include <float.h> | |
17 | #include "gd.h" | |
18 | #include "gdtest.h" | |
19 | ||
20 | @@ -33,7 +34,8 @@ | |
21 | gdImageCopyResampled(copy, im, 0,0, 0,0, 200,200, 400,300); | |
22 | gdImageDestroy(im); | |
23 | ||
24 | - gdAssertImageEqualsToFile("gdimagecopyresampled/basic_alpha_exp.png", copy); | |
25 | + if (FLT_EVAL_METHOD != 2) | |
26 | + gdAssertImageEqualsToFile("gdimagecopyresampled/basic_alpha_exp.png", copy); | |
27 | ||
28 | gdImageDestroy(copy); | |
29 | return gdNumFailures(); | |
30 | diff -ru libgd-2.2.3.orig/tests/gdimagecopyresampled/bug00201.c libgd-2.2.3/tests/gdimagecopyresampled/bug00201.c | |
31 | --- libgd-2.2.3.orig/tests/gdimagecopyresampled/bug00201.c 2016-07-21 04:06:42.000000000 -0400 | |
32 | +++ libgd-2.2.3/tests/gdimagecopyresampled/bug00201.c 2016-07-29 13:50:30.638559003 -0400 | |
33 | @@ -1,3 +1,4 @@ | |
34 | +#include <float.h> | |
35 | #include "gd.h" | |
36 | #include "gdtest.h" | |
37 | ||
38 | @@ -65,7 +66,8 @@ | |
39 | gdImageDestroy(background); | |
40 | gdImageDestroy(scaled_logo); | |
736d772b | 41 | |
a8144573 MW |
42 | - gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img); |
43 | + if (FLT_EVAL_METHOD != 2) | |
44 | + gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img); | |
45 | gdImageDestroy(img); | |
46 | return gdNumFailures(); | |
47 | } | |
48 | diff -ru libgd-2.2.3.orig/tests/gdimagerotate/bug00067.c libgd-2.2.3/tests/gdimagerotate/bug00067.c | |
49 | --- libgd-2.2.3.orig/tests/gdimagerotate/bug00067.c 2016-06-18 05:42:16.000000000 -0400 | |
50 | +++ libgd-2.2.3/tests/gdimagerotate/bug00067.c 2016-07-29 13:50:07.566271765 -0400 | |
51 | @@ -1,5 +1,6 @@ | |
52 | #include <stdio.h> | |
53 | #include <stdlib.h> | |
54 | +#include <float.h> | |
55 | #include "gd.h" | |
56 | ||
57 | #include "gdtest.h" | |
58 | @@ -43,7 +44,7 @@ | |
59 | ||
60 | sprintf(filename, "bug00067_%03d_exp.png", angle); | |
61 | path = gdTestFilePath2("gdimagerotate", filename); | |
62 | - if (!gdAssertImageEqualsToFile(path, exp)) { | |
63 | + if (FLT_EVAL_METHOD != 2 && !gdAssertImageEqualsToFile(path, exp)) { | |
64 | gdTestErrorMsg("comparing rotated image to %s failed.\n", path); | |
65 | error += 1; | |
66 | } |