unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 8675684198f4912466c591991234711d0e61a8d7 3204 bytes (raw)
name: gnu/packages/patches/gd-fix-tests-on-i686.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
Disable some image comparison tests on architectures such as i686
where intermediate floating-point operations are done with 80-bit long
doubles, and typically later rounded to 64-bit doubles.  This double
rounding causes small differences in the resulting pixel values
compared with other architectures, causing the image comparisons to
fail.

Patch by Mark H Weaver <mhw@netris.org>.

diff -ru libgd-2.2.3.orig/tests/gdimagecopyresampled/basic_alpha.c libgd-2.2.3/tests/gdimagecopyresampled/basic_alpha.c
--- libgd-2.2.3.orig/tests/gdimagecopyresampled/basic_alpha.c	2016-07-21 04:06:42.000000000 -0400
+++ libgd-2.2.3/tests/gdimagecopyresampled/basic_alpha.c	2016-07-29 13:50:56.214877446 -0400
@@ -1,5 +1,6 @@
 /* Testing basic gdImageCopyResampled() functionality with alpha channel */
 
+#include <float.h>
 #include "gd.h"
 #include "gdtest.h"
 
@@ -33,7 +34,8 @@
 	gdImageCopyResampled(copy, im, 0,0, 0,0, 200,200, 400,300);
 	gdImageDestroy(im);
 
-	gdAssertImageEqualsToFile("gdimagecopyresampled/basic_alpha_exp.png", copy);
+	if (FLT_EVAL_METHOD != 2)
+		gdAssertImageEqualsToFile("gdimagecopyresampled/basic_alpha_exp.png", copy);
 
 	gdImageDestroy(copy);
 	return gdNumFailures();
diff -ru libgd-2.2.3.orig/tests/gdimagecopyresampled/bug00201.c libgd-2.2.3/tests/gdimagecopyresampled/bug00201.c
--- libgd-2.2.3.orig/tests/gdimagecopyresampled/bug00201.c	2016-07-21 04:06:42.000000000 -0400
+++ libgd-2.2.3/tests/gdimagecopyresampled/bug00201.c	2016-07-29 13:50:30.638559003 -0400
@@ -1,3 +1,4 @@
+#include <float.h>
 #include "gd.h"
 #include "gdtest.h"
 
@@ -65,7 +66,8 @@
     gdImageDestroy(background);
     gdImageDestroy(scaled_logo);
 
-    gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img);
+    if (FLT_EVAL_METHOD != 2)
+        gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img);
     gdImageDestroy(img);
     return gdNumFailures();
 }
diff -ru libgd-2.2.3.orig/tests/gdimagerotate/bug00067.c libgd-2.2.3/tests/gdimagerotate/bug00067.c
--- libgd-2.2.3.orig/tests/gdimagerotate/bug00067.c	2016-06-18 05:42:16.000000000 -0400
+++ libgd-2.2.3/tests/gdimagerotate/bug00067.c	2016-07-29 13:50:07.566271765 -0400
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <float.h>
 #include "gd.h"
 
 #include "gdtest.h"
@@ -43,7 +44,7 @@
 
 		sprintf(filename, "bug00067_%03d_exp.png", angle);
 		path = gdTestFilePath2("gdimagerotate", filename);
-		if (!gdAssertImageEqualsToFile(path, exp)) {
+		if (FLT_EVAL_METHOD != 2 && !gdAssertImageEqualsToFile(path, exp)) {
 			gdTestErrorMsg("comparing rotated image to %s failed.\n", path);
 			error += 1;
 		}
diff --git a/tests/gdimagegrayscale/basic.c b/tests/gdimagegrayscale/basic.c
index 6b6b01c..321eb19 100644
--- a/tests/gdimagegrayscale/basic.c
+++ b/tests/gdimagegrayscale/basic.c
@@ -2,6 +2,7 @@
  * Basic test for gdImageGrayScale()
  */
 
+#include <float.h>
 #include "gd.h"
 #include "gdtest.h"
 
@@ -22,7 +23,8 @@ int main()
 	gdImageGrayScale(im);
 
 	path = gdTestFilePath2("gdimagegrayscale", "basic_exp.png");
-	gdAssertImageEqualsToFile(path, im);
+	if (FLT_EVAL_METHOD != 2)
+	     gdAssertImageEqualsToFile(path, im);
 	gdFree(path);
 
 	gdImageDestroy(im);

debug log:

solving 8675684198f ...
found 8675684198f in https://yhetil.org/guix-patches/1b02ee414266de5cca5bfbf5896231e8827a0794.1720444433.git.ludo@gnu.org/
found 7ec8e7fee96 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 7ec8e7fee96465ba564ecad6a32da1bd405fb1f1	gnu/packages/patches/gd-fix-tests-on-i686.patch

applying [1/1] https://yhetil.org/guix-patches/1b02ee414266de5cca5bfbf5896231e8827a0794.1720444433.git.ludo@gnu.org/
diff --git a/gnu/packages/patches/gd-fix-tests-on-i686.patch b/gnu/packages/patches/gd-fix-tests-on-i686.patch
index 7ec8e7fee96..8675684198f 100644

1:16: trailing whitespace.
 
1:20: trailing whitespace.
 
1:22: space before tab in indent.
 	gdImageGrayScale(im);
1:23: trailing whitespace.
 
1:24: space before tab in indent.
 	path = gdTestFilePath2("gdimagegrayscale", "basic_exp.png");
Checking patch gnu/packages/patches/gd-fix-tests-on-i686.patch...
Applied patch gnu/packages/patches/gd-fix-tests-on-i686.patch cleanly.
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

index at:
100644 8675684198f4912466c591991234711d0e61a8d7	gnu/packages/patches/gd-fix-tests-on-i686.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).