cvs: gd(GD_2_0) /libgd/tests/gdimageline gdimageline_aa.c /libgd/tests/gdtest gdtest.c /libgd/tests/gif bug00005.c

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1176127240@cvsserver>
pajoye		Mon Apr  9 14:00:40 2007 UTC

  Modified files:              (Branch: GD_2_0)
    /gd/libgd/tests/gdimageline	gdimageline_aa.c 
    /gd/libgd/tests/gdtest	gdtest.c 
    /gd/libgd/tests/gif	bug00005.c 
  Log:
  - always store image diff files in the build dir
  - store the output result as well
  - remove c++ comment
  - be more verbose in the error messages
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimageline/gdimageline_aa.c?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: gd/libgd/tests/gdimageline/gdimageline_aa.c
diff -u gd/libgd/tests/gdimageline/gdimageline_aa.c:1.1.2.1 gd/libgd/tests/gdimageline/gdimageline_aa.c:1.1.2.2
--- gd/libgd/tests/gdimageline/gdimageline_aa.c:1.1.2.1	Sun Apr  1 19:48:43 2007
+++ gd/libgd/tests/gdimageline/gdimageline_aa.c	Mon Apr  9 14:00:39 2007
@@ -19,8 +19,9 @@
 
    gdImageSetAntiAliased(im, gdTrueColorAlpha(0,0,0,0));
 
-   // test for potential segfault (introduced with AA improvements, fixed
-   // with the same patch - but I didn't notice it until later).
+   /*
+   test for potential segfault (introduced with AA improvements, fixed
+	with the same patch - but I didn't notice it until later).*/
    gdImageLine(im,-1,-1,-1,-1,gdAntiAliased);
 
 	x1 = floor(reverse_x * -width + 0.5);
@@ -32,9 +33,10 @@
    // draw an AA line
    gdImageLine(im, x1, y1, x2, y2, gdAntiAliased);
 
-	gdImageLine(im, 0,im->sy - 1, im->sx, im->sy - 1, 0x40FF0000);
+	gdImageLine(im, 0, im->sy - 1, im->sx, im->sy - 1, 0x40FF0000);
 
 	if (!gdAssertImageEqualsToFile(filename, im)) {
+		printf("%s failed\n", filename);
 		error = 1;
 	}
    gdImageDestroy(im);
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdtest/gdtest.c?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: gd/libgd/tests/gdtest/gdtest.c
diff -u gd/libgd/tests/gdtest/gdtest.c:1.1.2.1 gd/libgd/tests/gdtest/gdtest.c:1.1.2.2
--- gd/libgd/tests/gdtest/gdtest.c:1.1.2.1	Sun Apr  1 19:48:43 2007
+++ gd/libgd/tests/gdtest/gdtest.c	Mon Apr  9 14:00:39 2007
@@ -142,17 +142,35 @@
 
 	gdTestImageDiff(expected, actual, surface_diff, &result);
 	if (result.pixels_changed>0) {
+		char *filename;
 		char file_diff[255];
+		char file_out[1024];
 		FILE *fp;
+		int len, p;
 
 		sprintf(buf, "Total pixels changed: %d with a maximum channel difference of %d.\n",
 			result.pixels_changed,
 			result.max_diff
 		);
-		sprintf(file_diff, "%s_%u_diff.png", file, line);
+
+		p = len = strlen(file);
+		p--;
+
+		/* Use only the filename (and store it in the bld dir not the src dir
+		 */
+		while(p > 0 && (file[p] != '/' && file[p] != '\\')) {
+			p--;
+		}
+		sprintf(file_diff, "%s_%u_diff.png", file + p  + 1, line);
+		sprintf(file_out, "%s_%u_out.png", file + p  + 1, line);
+
 		fp = fopen(file_diff, "wb");
 		gdImagePng(surface_diff,fp);
 		fclose(fp);
+
+		fp = fopen(file_out, "wb");
+		gdImagePng(actual, fp);
+		fclose(fp);
 	} else {
 		if (surface_diff) {
 			gdImageDestroy(surface_diff);
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gif/bug00005.c?r1=1.2.2.1&r2=1.2.2.2&diff_format=u
Index: gd/libgd/tests/gif/bug00005.c
diff -u gd/libgd/tests/gif/bug00005.c:1.2.2.1 gd/libgd/tests/gif/bug00005.c:1.2.2.2
--- gd/libgd/tests/gif/bug00005.c:1.2.2.1	Sun Apr  1 19:48:43 2007
+++ gd/libgd/tests/gif/bug00005.c	Mon Apr  9 14:00:39 2007
@@ -19,7 +19,7 @@
 
 		fp = fopen(path, "rb");
 		if (!fp) {
-			gdTestErrorMsg("Input file does not exist!\n");
+			gdTestErrorMsg("<%s> Input file does not exist!\n", path);
 			return 1;
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.