Commits

Ondřej Surý committed fa035f9

Add test for gdImageAALine thickness greater than 1

Comments (0)

Files changed (3)

tests/Makefile.am

 	gdimageline/bug00077 \
 	gdimageline/bug00111 \
 	gdimageline/gdimageline_bug5 \
+	gdimageline/gdImageAALine_thickness \
 	gdimageopenpolygon/gdimageopenpolygon2 \
 	gdimageopenpolygon/gdimageopenpolygon1 \
 	gdimageopenpolygon/gdimageopenpolygon0 \
 	gdimageline/bug00077 \
 	gdimageline/bug00111 \
 	gdimageline/gdimageline_bug5 \
+	gdimageline/gdImageAALine_thickness \
 	gdimageopenpolygon/gdimageopenpolygon2 \
 	gdimageopenpolygon/gdimageopenpolygon1 \
 	gdimageopenpolygon/gdimageopenpolygon0 \

tests/gdimageline/gdImageAALine_thickness.c

+#include <stdio.h>
+#include "gd.h"
+#include "gdtest.h"
+
+int main(int argc, char **argv)
+{
+	gdImagePtr im;
+	char path[2048];
+	const char *file_exp = "gdimageline/gdImageAALine_thickness_exp.png";
+
+	im = gdImageCreateTrueColor(100, 100);
+	gdImageFilledRectangle(im, 0, 0, 99, 99,
+			       gdImageColorExactAlpha(im, 255, 255, 255, 0));
+
+	gdImageSetThickness(im, 5);
+	gdImageSetAntiAliased(im, gdImageColorExactAlpha(im, 0, 0, 0, 0));
+	gdImageLine(im, 0,0, 99, 99, gdAntiAliased);
+
+	sprintf(path, "%s/%s", GDTEST_TOP_DIR, file_exp);
+
+	if (!gdAssertImageEqualsToFile(path, im)) {
+		printf("comparing rotated image to %s failed.\n", path);
+		gdImageDestroy(im);
+		return 1;
+	}
+
+	gdImageDestroy(im);
+}

tests/gdimageline/gdImageAALine_thickness_exp.png

Added
New image