1. libgd
  2. Untitled project
  3. gd-libgd

Commits

Ondřej Surý  committed b048158

Add test for bitbucket issue #5

  • Participants
  • Parent commits 9e32495
  • Branches master

Comments (0)

Files changed (2)

File tests/Makefile.am

View file
 	gdimageline/bug00072 \
 	gdimageline/bug00077 \
 	gdimageline/bug00111 \
+	gdimageline/gdimageline_bug5 \
 	gdimageopenpolygon/gdimageopenpolygon2 \
 	gdimageopenpolygon/gdimageopenpolygon1 \
 	gdimageopenpolygon/gdimageopenpolygon0 \
 	gdimageline/bug00072 \
 	gdimageline/bug00077 \
 	gdimageline/bug00111 \
+	gdimageline/gdimageline_bug5 \
 	gdimageopenpolygon/gdimageopenpolygon2 \
 	gdimageopenpolygon/gdimageopenpolygon1 \
 	gdimageopenpolygon/gdimageopenpolygon0 \

File tests/gdimageline/gdimageline_bug5.c

View file
+#include <stdio.h>
+#include "gd.h"
+#include "gdtest.h"
+
+int main() {
+	/* Declare the image */
+	gdImagePtr im;
+
+	/* Declare output files */
+	/* FILE *pngout; */
+	int black, white;
+
+	im = gdImageCreateTrueColor(63318, 771);
+
+	/* Allocate the color white (red, green and blue all maximum). */
+	white = gdImageColorAllocate(im, 255, 255, 255);
+	/* Allocate the color white (red, green and blue all maximum). */
+	black = gdImageColorAllocate(im, 0, 0, 0);
+
+	/* white background */
+	gdImageFill(im, 1, 1, white);
+
+	gdImageSetAntiAliased(im, black);
+
+	/* This line fails! */
+	gdImageLine(im, 28562, 631, 34266, 750, gdAntiAliased);
+
+	/* Open a file for writing. "wb" means "write binary", important under MSDOS, harmless under Unix. */
+	/* pngout = fopen("test.png", "wb"); */
+
+	/* Output the image to the disk file in PNG format. */
+	/* gdImagePng(im, pngout); */
+
+	/* Close the files. */
+	/* fclose(pngout); */
+
+	/* Destroy the image in memory. */
+	gdImageDestroy(im);
+}