cvs: gd(GD_2_0) /libgd/tests/gd2 gd2_empty_file.c gd2_read.c /libgd/tests/gdimagecopyrotated bug00020.c /libgd/tests/gdimagefill bug00002_1.c bug00002_2.c bug00002_3.c bug00002_4.c /libgd/tests/gdimagefilledellipse bug00010.c /libgd/tests/gdimageline gdimageline_aa.c /libgd/tests/gdtest CMakeLists.txt gdtest.c /libgd/tests/gif CMakeLists.txt bug00005.c bug00060.c bug00060.gif /libgd/tests/jpeg jpeg_empty_file.c jpeg_read.c /libgd/tests/png bug00011.c bug00033.c

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1175456924@cvsserver>
pajoye		Sun Apr  1 19:48:44 2007 UTC

  Added files:                 (Branch: GD_2_0)
    /gd/libgd/tests/gif	bug00060.c bug00060.gif 

  Modified files:              
    /gd/libgd/tests/gd2	gd2_empty_file.c gd2_read.c 
    /gd/libgd/tests/gdimagecopyrotated	bug00020.c 
    /gd/libgd/tests/gdimagefill	bug00002_1.c bug00002_2.c bug00002_3.c 
                               	bug00002_4.c 
    /gd/libgd/tests/gdimagefilledellipse	bug00010.c 
    /gd/libgd/tests/gdimageline	gdimageline_aa.c 
    /gd/libgd/tests/gdtest	CMakeLists.txt gdtest.c 
    /gd/libgd/tests/gif	CMakeLists.txt bug00005.c 
    /gd/libgd/tests/jpeg	jpeg_empty_file.c jpeg_read.c 
    /gd/libgd/tests/png	bug00011.c bug00033.c 
  Log:
  - allow tests to be launched outside the src tree
  - #60, add test case for #60
pajoye-20070401194844.txt (text/plain, 16.6 KB)
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gd2/gd2_empty_file.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gd2/gd2_empty_file.c
diff -u gd/libgd/tests/gd2/gd2_empty_file.c:1.1 gd/libgd/tests/gd2/gd2_empty_file.c:1.1.2.1
--- gd/libgd/tests/gd2/gd2_empty_file.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gd2/gd2_empty_file.c	Sun Apr  1 19:48:43 2007
@@ -1,4 +1,4 @@
-/* $Id: gd2_empty_file.c,v 1.1 2007/01/23 23:57:53 pajoye Exp $ */
+/* $Id: gd2_empty_file.c,v 1.1.2.1 2007/04/01 19:48:43 pajoye Exp $ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -8,10 +8,13 @@
 {
  	gdImagePtr im;
 	FILE *fp;
+	char path[1024];
 
-	fp = fopen("empty.gd2", "rb");
+	sprintf(path, "%s/gd2/empty.gd2", gdTestGetTopDir());
+
+	fp = fopen(path, "rb");
 	if (!fp) {
-		printf("failed, cannot open file\n");
+		printf("failed, cannot open file (%s)\n", path);
 		return 1;
 	}
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gd2/gd2_read.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gd2/gd2_read.c
diff -u gd/libgd/tests/gd2/gd2_read.c:1.1 gd/libgd/tests/gd2/gd2_read.c:1.1.2.1
--- gd/libgd/tests/gd2/gd2_read.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gd2/gd2_read.c	Sun Apr  1 19:48:43 2007
@@ -1,4 +1,4 @@
-/* $Id: gd2_read.c,v 1.1 2007/01/23 23:57:53 pajoye Exp $ */
+/* $Id: gd2_read.c,v 1.1.2.1 2007/04/01 19:48:43 pajoye Exp $ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -9,8 +9,11 @@
 	int error;
  	gdImagePtr im;
 	FILE *fp;
+	char path[1024];
 
-	fp = fopen("conv_test.gd2", "rb");
+	sprintf(path, "%s/gd2/conv_test.gd2", gdTestGetTopDir());
+
+	fp = fopen(path, "rb");
 	if (!fp) {
 		printf("failed, cannot open file\n");
 		return 1;
@@ -19,7 +22,8 @@
 	im = gdImageCreateFromGd2(fp);
 	fclose(fp);
 
-	if (!gdAssertImageEqualsToFile("conv_test_exp.png", im)) {
+	sprintf(path, "%s/gd2/conv_test_exp.png", gdTestGetTopDir());
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 		gdImageDestroy(im);
 	} else {
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagecopyrotated/bug00020.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdimagecopyrotated/bug00020.c
diff -u gd/libgd/tests/gdimagecopyrotated/bug00020.c:1.1 gd/libgd/tests/gdimagecopyrotated/bug00020.c:1.1.2.1
--- gd/libgd/tests/gdimagecopyrotated/bug00020.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gdimagecopyrotated/bug00020.c	Sun Apr  1 19:48:43 2007
@@ -1,14 +1,16 @@
-/* $Id: bug00020.c,v 1.1 2007/01/23 23:57:53 pajoye Exp $ */
+/* $Id: bug00020.c,v 1.1.2.1 2007/04/01 19:48:43 pajoye Exp $ */
 #include "gd.h"
 #include "gdtest.h"
 
-#define exp_img "bug00020_exp.png"
 #define width 50
 
 int main()
 {
  	gdImagePtr im, im2;
  	int error = 0;
+	char path[1024];
+
+	sprintf(path, "%s/gdimagecopyrotated/bug00020_exp.png", gdTestGetTopDir());
 
 	im = gdImageCreateTrueColor(width, width);
 	gdImageFilledRectangle(im, 0,0, width, width, 0xFF0000);
@@ -20,7 +22,7 @@
 
 	gdImageCopyRotated(im2, im, width / 2, width / 2, 0,0, width, width, 60);
 
-	if (!gdAssertImageEqualsToFile(exp_img, im2)) {
+	if (!gdAssertImageEqualsToFile(path, im2)) {
 		error = 1;
 	}
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagefill/bug00002_1.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdimagefill/bug00002_1.c
diff -u gd/libgd/tests/gdimagefill/bug00002_1.c:1.1 gd/libgd/tests/gdimagefill/bug00002_1.c:1.1.2.1
--- gd/libgd/tests/gdimagefill/bug00002_1.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gdimagefill/bug00002_1.c	Sun Apr  1 19:48:43 2007
@@ -7,6 +7,7 @@
 	gdImagePtr im;
 	int error = 0;
 	FILE *fp;
+	char path[1024];
 
 	fputs("flag 0\n", stdout);
 	im = gdImageCreateTrueColor(100, 100);
@@ -22,7 +23,9 @@
  	gdImagePng(im,fp);
 	fclose(fp);
 
-	if (!gdAssertImageEqualsToFile("bug00002_1_exp.png", im)) {
+
+	sprintf(path, "%s/gdimagefill/bug00002_1_exp.png", gdTestGetTopDir());
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagefill/bug00002_2.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdimagefill/bug00002_2.c
diff -u gd/libgd/tests/gdimagefill/bug00002_2.c:1.1 gd/libgd/tests/gdimagefill/bug00002_2.c:1.1.2.1
--- gd/libgd/tests/gdimagefill/bug00002_2.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gdimagefill/bug00002_2.c	Sun Apr  1 19:48:43 2007
@@ -8,6 +8,7 @@
 	int im_white, im_black, tile_white, tile_black;
 	int x,y, error = 0;
 	FILE *fp;
+	const char path[1024];
 
 	fputs("flag 0\n", stdout);
 	im = gdImageCreate(150, 150);
@@ -37,7 +38,9 @@
 	gdImageFill(im, 0, 0, 0xffffff);
 	fputs("flag 2\n", stdout);
 
-	if (!gdAssertImageEqualsToFile("bug00002_2_exp.png", im)) {
+
+	sprintf(path, "%s/gdimagefill/bug00002_2_exp.png", gdTestGetTopDir());
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagefill/bug00002_3.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdimagefill/bug00002_3.c
diff -u gd/libgd/tests/gdimagefill/bug00002_3.c:1.1 gd/libgd/tests/gdimagefill/bug00002_3.c:1.1.2.1
--- gd/libgd/tests/gdimagefill/bug00002_3.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gdimagefill/bug00002_3.c	Sun Apr  1 19:48:43 2007
@@ -1,4 +1,4 @@
-/* $Id: bug00002_3.c,v 1.1 2007/01/23 23:57:53 pajoye Exp $ */
+/* $Id: bug00002_3.c,v 1.1.2.1 2007/04/01 19:48:43 pajoye Exp $ */
 #include <gd.h>
 #include <stdio.h>
 #include "gdtest.h"
@@ -9,6 +9,7 @@
 	int im_white, im_black, tile_white, tile_black;
 	int x,y, error = 0;
 	FILE *fp;
+	const char path[1024];
 
 	fputs("flag 0\n", stdout);
 	im = gdImageCreate(150, 150);
@@ -44,7 +45,8 @@
 	gdImageFill(im, 0, 0, 0xffffff);
 	fputs("flag 3\n", stdout);
 
-	if (!gdAssertImageEqualsToFile("bug00002_3_exp.png", im)) {
+	sprintf(path, "%s/gdimagefill/bug00002_3_exp.png", gdTestGetTopDir());
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagefill/bug00002_4.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdimagefill/bug00002_4.c
diff -u gd/libgd/tests/gdimagefill/bug00002_4.c:1.1 gd/libgd/tests/gdimagefill/bug00002_4.c:1.1.2.1
--- gd/libgd/tests/gdimagefill/bug00002_4.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gdimagefill/bug00002_4.c	Sun Apr  1 19:48:43 2007
@@ -8,6 +8,7 @@
  	gdImagePtr im;
 	FILE *fp;
 	int red, blue, white, black, error = 0;
+	const char path[1024];
 
 	im = gdImageCreate(50,100);
 	red = gdImageColorAllocate(im, 255, 0, 0);
@@ -29,7 +30,8 @@
 	gdImageFill(im, 100,69, red);
 	gdImageFill(im, 100,21, white);
 
-	if (!gdAssertImageEqualsToFile("bug00002_4_exp.png", im)) {
+	sprintf(path, "%s/gdimagefill/bug00002_4_exp.png", gdTestGetTopDir());
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagefilledellipse/bug00010.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdimagefilledellipse/bug00010.c
diff -u gd/libgd/tests/gdimagefilledellipse/bug00010.c:1.1 gd/libgd/tests/gdimagefilledellipse/bug00010.c:1.1.2.1
--- gd/libgd/tests/gdimagefilledellipse/bug00010.c:1.1	Tue Jan 23 23:57:53 2007
+++ gd/libgd/tests/gdimagefilledellipse/bug00010.c	Sun Apr  1 19:48:43 2007
@@ -1,17 +1,18 @@
-/* $Id: bug00010.c,v 1.1 2007/01/23 23:57:53 pajoye Exp $ */
+/* $Id: bug00010.c,v 1.1.2.1 2007/04/01 19:48:43 pajoye Exp $ */
 #include "gd.h"
 #include "gdtest.h"
 
-#define exp_img "bug00010_exp.png"
-
 int main()
 {
  	gdImagePtr im;
  	int error = 0;
+	char path[1024];
 
 	im = gdImageCreateTrueColor(100,100);
 	gdImageFilledEllipse(im, 50,50, 70, 90, 0x50FFFFFF);
-	if (!gdAssertImageEqualsToFile(exp_img, im)) {
+
+	sprintf(path, "%s/gdimagefilledellipse/bug00010_exp.png", gdTestGetTopDir());
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	}
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimageline/gdimageline_aa.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdimageline/gdimageline_aa.c
diff -u gd/libgd/tests/gdimageline/gdimageline_aa.c:1.1 gd/libgd/tests/gdimageline/gdimageline_aa.c:1.1.2.1
--- gd/libgd/tests/gdimageline/gdimageline_aa.c:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/gdimageline/gdimageline_aa.c	Sun Apr  1 19:48:43 2007
@@ -45,19 +45,28 @@
 {
 	int i;
 	int error = 0;
+	const char path[1024];
 
-	error |= gen_image("gdimageline_aa_a_0_exp.png",0,1,10,100, 1);
-	error |= gen_image("gdimageline_aa_a_1_exp.png",1,1,10,100, 2);
-
-	error |= gen_image("gdimageline_aa_b_0_exp.png",2,-1,10,100, 1);
-	error |= gen_image("gdimageline_aa_b_1_exp.png",1,-1,10,100, 2);
-
-
-	error |= gen_image("gdimageline_aa_c_0_exp.png",0,1,100,10, 1);
-	error |= gen_image("gdimageline_aa_c_1_exp.png",1,1,100,10, 2);
-
-	error |= gen_image("gdimageline_aa_d_0_exp.png",2,-1,100,10, 1);
-	error |= gen_image("gdimageline_aa_d_1_exp.png",1,-1,100,10, 2);
+	sprintf(path, "%s/gdimageline/gdimageline_aa_a_0_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,0,1,10,100, 1);
+	sprintf(path, "%s/gdimageline/gdimageline_aa_a_1_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,1,1,10,100, 2);
+
+	sprintf(path, "%s/gdimageline/gdimageline_aa_b_0_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,2,-1,10,100, 1);
+	sprintf(path, "%s/gdimageline/gdimageline_aa_b_1_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,1,-1,10,100, 2);
+
+
+	sprintf(path, "%s/gdimageline/gdimageline_aa_c_0_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,0,1,100,10, 1);
+	sprintf(path, "%s/gdimageline/gdimageline_aa_c_1_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,1,1,100,10, 2);
+
+	sprintf(path, "%s/gdimageline/gdimageline_aa_d_0_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,2,-1,100,10, 1);
+	sprintf(path, "%s/gdimageline/gdimageline_aa_d_1_exp.png", gdTestGetTopDir());
+	error |= gen_image(path,1,-1,100,10, 2);
 
    return error;
 }
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdtest/CMakeLists.txt?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdtest/CMakeLists.txt
diff -u gd/libgd/tests/gdtest/CMakeLists.txt:1.1 gd/libgd/tests/gdtest/CMakeLists.txt:1.1.2.1
--- gd/libgd/tests/gdtest/CMakeLists.txt:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/gdtest/CMakeLists.txt	Sun Apr  1 19:48:43 2007
@@ -1,2 +1,3 @@
-include_directories (${GDTEST_SOURCE_DIR}/cutest)
-add_library (gdTest gdtest.c)
+SET(GDTEST_TOP_DIR "${GD_SOURCE_DIR}/tests")
+CONFIGURE_FILE(test_config.h.cmake test_config.h ESCAPE_QUOTES)
+add_library (gdTest gdtest.c)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdtest/gdtest.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gdtest/gdtest.c
diff -u gd/libgd/tests/gdtest/gdtest.c:1.1 gd/libgd/tests/gdtest/gdtest.c:1.1.2.1
--- gd/libgd/tests/gdtest/gdtest.c:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/gdtest/gdtest.c	Sun Apr  1 19:48:43 2007
@@ -7,6 +7,12 @@
 #include <gd.h>
 
 #include "gdtest.h"
+#include "test_config.h"
+
+const char * gdTestGetTopDir()
+{
+	return GDTEST_TOP_DIR;
+}
 
 gdImagePtr gdTestImageFromPng(const char *filename)
 {
@@ -114,6 +120,11 @@
 	gdImagePtr surface_diff = NULL;
 	CuTestImageResult result;
 
+	if (!actual) {
+		fprintf(stderr, "Image is NULL\n");
+		goto fail;
+	}
+
 	width_a  = gdImageSX(expected);
 	height_a = gdImageSY(expected);
 	width_b  = gdImageSX(actual);
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gif/CMakeLists.txt?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/gif/CMakeLists.txt
diff -u gd/libgd/tests/gif/CMakeLists.txt:1.1 gd/libgd/tests/gif/CMakeLists.txt:1.1.2.1
--- gd/libgd/tests/gif/CMakeLists.txt:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/gif/CMakeLists.txt	Sun Apr  1 19:48:43 2007
@@ -3,6 +3,7 @@
 	bug00005
 	bug00005_2
 	bug00006
+	bug00060
 )
 
 FOREACH(test_name ${TESTS_FILES})
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gif/bug00005.c?r1=1.2&r2=1.2.2.1&diff_format=u
Index: gd/libgd/tests/gif/bug00005.c
diff -u gd/libgd/tests/gif/bug00005.c:1.2 gd/libgd/tests/gif/bug00005.c:1.2.2.1
--- gd/libgd/tests/gif/bug00005.c:1.2	Wed Jan 24 23:06:44 2007
+++ gd/libgd/tests/gif/bug00005.c	Sun Apr  1 19:48:43 2007
@@ -6,15 +6,18 @@
 {
  	gdImagePtr im;
 	char * giffiles[4] = {"bug00005_0.gif", "bug00005_1.gif", "bug00005_2.gif", "bug00005_3.gif"};
-	int valid[4]       = {0, 0, 1, 0};
+	int valid[4]       = {0, 0, 0, 0};
 	char *exp[4] = {NULL, NULL, "bug00005_2_exp.png", NULL};
 	const int files_cnt = 4;
 	FILE *fp;
 	int i = 0;
 	int error = 0;
+	char path[1024];
 
 	for (i=0; i < files_cnt; i++) {
-		fp = fopen(giffiles[i], "rb");
+		sprintf(path, "%s/gif/%s", gdTestGetTopDir(), giffiles[i]);
+
+		fp = fopen(path, "rb");
 		if (!fp) {
 			gdTestErrorMsg("Input file does not exist!\n");
 			return 1;
@@ -24,10 +27,15 @@
 		fclose(fp);
 
 		if (valid[i]) {
-			if (!gdAssertImageEqualsToFile(exp[i], im)) {
+			if (!im) {
 				error = 1;
+			} else {
+				sprintf(path, "%s/gif/%s", gdTestGetTopDir(), exp[i]);
+				if (!gdAssertImageEqualsToFile(path, im)) {
+					error = 1;
+				}
+				gdImageDestroy(im);
 			}
-			gdImageDestroy(im);
 		} else {
 			if (!gdTestAssert(im == NULL)) {
 				error = 1;
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/jpeg/jpeg_empty_file.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/jpeg/jpeg_empty_file.c
diff -u gd/libgd/tests/jpeg/jpeg_empty_file.c:1.1 gd/libgd/tests/jpeg/jpeg_empty_file.c:1.1.2.1
--- gd/libgd/tests/jpeg/jpeg_empty_file.c:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/jpeg/jpeg_empty_file.c	Sun Apr  1 19:48:44 2007
@@ -1,4 +1,4 @@
-/* $Id: jpeg_empty_file.c,v 1.1 2007/01/23 23:57:54 pajoye Exp $ */
+/* $Id: jpeg_empty_file.c,v 1.1.2.1 2007/04/01 19:48:44 pajoye Exp $ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -8,8 +8,10 @@
 {
  	gdImagePtr im;
 	FILE *fp;
+	const char path[1024];
 
-	fp = fopen("empty.jpeg", "rb");
+	sprintf(path, "%s/jpeg/empty.jpeg", gdTestGetTopDir());
+	fp = fopen(path, "rb");
 	if (!fp) {
 		printf("failed, cannot open file\n");
 		return 1;
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/jpeg/jpeg_read.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/jpeg/jpeg_read.c
diff -u gd/libgd/tests/jpeg/jpeg_read.c:1.1 gd/libgd/tests/jpeg/jpeg_read.c:1.1.2.1
--- gd/libgd/tests/jpeg/jpeg_read.c:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/jpeg/jpeg_read.c	Sun Apr  1 19:48:44 2007
@@ -1,4 +1,4 @@
-/* $Id: jpeg_read.c,v 1.1 2007/01/23 23:57:54 pajoye Exp $ */
+/* $Id: jpeg_read.c,v 1.1.2.1 2007/04/01 19:48:44 pajoye Exp $ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -9,8 +9,10 @@
 	int error;
  	gdImagePtr im;
 	FILE *fp;
+	const char path[1024];
 
-	fp = fopen("conv_test.jpeg", "rb");
+	sprintf(path, "%s/jpeg/conv_test.jpeg", gdTestGetTopDir());
+	fp = fopen(path, "rb");
 	if (!fp) {
 		printf("failed, cannot open file\n");
 		return 1;
@@ -19,7 +21,8 @@
 	im = gdImageCreateFromJpeg(fp);
 	fclose(fp);
 
-	if (!gdAssertImageEqualsToFile("conv_test_exp.png", im)) {
+	sprintf(path, "%s/jpeg/conv_test_exp.png", gdTestGetTopDir());
+	if (!gdAssertImageEqualsToFile(path, im)) {
 		error = 1;
 	} else {
 		if (im) {
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/png/bug00011.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/png/bug00011.c
diff -u gd/libgd/tests/png/bug00011.c:1.1 gd/libgd/tests/png/bug00011.c:1.1.2.1
--- gd/libgd/tests/png/bug00011.c:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/png/bug00011.c	Sun Apr  1 19:48:44 2007
@@ -1,4 +1,4 @@
-/* $Id: bug00011.c,v 1.1 2007/01/23 23:57:54 pajoye Exp $ */
+/* $Id: bug00011.c,v 1.1.2.1 2007/04/01 19:48:44 pajoye Exp $ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -8,10 +8,14 @@
 {
  	gdImagePtr im;
 	FILE *fp;
+	char path[2048];
 
-	fp = fopen("emptyfile", "rb");
+	sprintf(path, "%s/png/emptyfile", gdTestGetTopDir());
+	printf("opening %s\n", path);
+	fp = fopen(path, "rb");
 	if (!fp) {
 		printf("failed, cannot open file\n");
+		return 1;
 	}
 	im = gdImageCreateFromPng(fp);
 	fclose(fp);
@@ -21,5 +25,4 @@
 	} else {
 		return 1;
 	}
-	//CuAssertTrue(tc, NULL==im);
 }
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/png/bug00033.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: gd/libgd/tests/png/bug00033.c
diff -u gd/libgd/tests/png/bug00033.c:1.1 gd/libgd/tests/png/bug00033.c:1.1.2.1
--- gd/libgd/tests/png/bug00033.c:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/png/bug00033.c	Sun Apr  1 19:48:44 2007
@@ -1,4 +1,4 @@
-/* $Id: bug00033.c,v 1.1 2007/01/23 23:57:54 pajoye Exp $ */
+/* $Id: bug00033.c,v 1.1.2.1 2007/04/01 19:48:44 pajoye Exp $ */
 #include "gd.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -8,10 +8,12 @@
 {
  	gdImagePtr im;
 	FILE *fp;
+	const char path[1024];
 
-	fp = fopen("bug00033.png", "rb");
+	sprintf(path, "%s/png/bug00033.png", gdTestGetTopDir());
+	fp = fopen(path, "rb");
 	if (!fp) {
-		printf("failed, cannot open file <bug00033.png>\n");
+		printf("failed, cannot open file <%s>\n", path);
 		return 1;
 	}
 

http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gif/bug00060.c?view=markup&rev=1.1
Index: gd/libgd/tests/gif/bug00060.c
+++ gd/libgd/tests/gif/bug00060.c
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.