cvs: gd /libgd gd.c /libgd/tests CMakeLists.txt /libgd/tests/gdimagearc CMakeLists.txt bug00079.c bug00079_exp.png
[email protected] ("Pierre-Alain Joye")
| Newsgroups | php.gd.cvs |
|---|---|
| Message-ID | <cvspajoye1178533604@cvsserver> |
pajoye Mon May 7 10:26:44 2007 UTC
Modified files:
/gd/libgd gd.c
/gd/libgd/tests/gdimagearc bug00079.c CMakeLists.txt
bug00079_exp.png
/gd/libgd/tests CMakeLists.txt
Log:
- #79, MFB:
- fix hline and vline calls
- add test case
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.56&r2=1.57&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.56 gd/libgd/gd.c:1.57
--- gd/libgd/gd.c:1.56 Sun May 6 19:53:05 2007
+++ gd/libgd/gd.c Mon May 7 10:26:44 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.56 2007/05/06 19:53:05 pajoye Exp $ */
+/* $Id: gd.c,v 1.57 2007/05/07 10:26:44 pajoye Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -1610,6 +1610,7 @@
{
e += 360;
}
+
for (i = s; (i <= e); i++)
{
int x, y;
@@ -3456,10 +3457,10 @@
/* Axis aligned lines */
if (dx == 0) {
- gdImageHLine(im, y1, x1, x2, col);
+ gdImageVLine(im, x1, y1, y2, col);
return;
} else if (dy == 0) {
- gdImageVLine(im, x1, y1, y2, col);
+ gdImageHLine(im, y1, x1, x2, col);
return;
}
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagearc/bug00079.c?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/gdimagearc/bug00079.c
diff -u /dev/null gd/libgd/tests/gdimagearc/bug00079.c:1.2
--- /dev/null Mon May 7 10:26:44 2007
+++ gd/libgd/tests/gdimagearc/bug00079.c Mon May 7 10:26:44 2007
@@ -0,0 +1,26 @@
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+ gdImagePtr im;
+ FILE *fp;
+ int error = 0;
+ char path[1024];
+
+
+ im = gdImageCreateTrueColor(300, 300);
+ gdImageFilledRectangle(im, 0,0, 299,299, 0xFFFFFF);
+
+ gdImageSetAntiAliased(im, 0x000000);
+ gdImageArc(im, 300, 300, 600,600, 0, 360, gdAntiAliased);
+
+ sprintf(path, "%s/gdimagearc/bug00079_exp.png", GDTEST_TOP_DIR);
+ if (!gdAssertImageEqualsToFile(path, im)) {
+ printf("%s failed\n", path);
+ error = 1;
+ }
+
+ gdImageDestroy(im);
+ return error;
+}
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagearc/CMakeLists.txt?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/gdimagearc/CMakeLists.txt
diff -u /dev/null gd/libgd/tests/gdimagearc/CMakeLists.txt:1.2
--- /dev/null Mon May 7 10:26:44 2007
+++ gd/libgd/tests/gdimagearc/CMakeLists.txt Mon May 7 10:26:44 2007
@@ -0,0 +1,9 @@
+SET(TESTS_FILES
+ bug00079
+)
+
+FOREACH(test_name ${TESTS_FILES})
+ add_executable(${test_name} "${test_name}.c")
+ target_link_libraries (${test_name} gdTest ${GD_LIB})
+ ADD_TEST(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
+ENDFOREACH(test_name)
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagearc/bug00079_exp.png?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/gdimagearc/bug00079_exp.png
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/CMakeLists.txt?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/CMakeLists.txt
diff -u gd/libgd/tests/CMakeLists.txt:1.1 gd/libgd/tests/CMakeLists.txt:1.2
--- gd/libgd/tests/CMakeLists.txt:1.1 Tue Jan 23 23:55:00 2007
+++ gd/libgd/tests/CMakeLists.txt Mon May 7 10:26:44 2007
@@ -28,6 +28,7 @@
SET(TESTS_DIRS
gdtest
+ gdimagearc
gdimagecolorclosest
gdimagecolorexact
gdimagecolorresolve
@@ -50,4 +51,4 @@
FOREACH(test_dir ${TESTS_DIRS})
add_subdirectory (${test_dir})
ENDFOREACH(test_dir)
-endif (BUILD_TEST)
\ No newline at end of file
+endif (BUILD_TEST)