diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-04-10 03:40:48 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-04-10 03:40:48 +0000 |
commit | 503c0227622254c0ae3209a1fa72bcb68bb450bc (patch) | |
tree | 48df20533f300f819504c15af33cdc03fc386a93 /Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c | |
parent | a9d86b73ecf95b83666e16c4d90e348c4958a63b (diff) |
libgd 2.3.0
git-svn-id: svn://tug.org/texlive/trunk@54636 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c')
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c b/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c new file mode 100644 index 00000000000..719d155e0ba --- /dev/null +++ b/Build/source/libs/gd/libgd-src/tests/gdimageline/bug00315.c @@ -0,0 +1,37 @@ +/** + * Regression test for <https://github.com/libgd/libgd/issues/315> + * + * We're testing that a single-pointed gdImageAALine() is drawn as a single + * non-antialized pixel, according to (two-pointed) vertical and horizontal + * lines. + */ + +#include "gd.h" +#include "gdtest.h" + +int main() +{ + gdImagePtr im; + int white, black; + char *path; + + im = gdImageCreateTrueColor(6, 6); + white = gdImageColorAllocate(im, 255, 255, 255); + black = gdImageColorAllocate(im, 0, 0, 0); + gdImageFilledRectangle(im, 0,0, 5,5, white); + + gdImageLine(im, 4,4, 4,4, black); + gdImageLine(im, 1,4, 2,4, black); + gdImageLine(im, 4,1, 4,2, black); + + gdImageSetAntiAliased(im, black); + gdImageLine(im, 1,1, 1,1, gdAntiAliased); + + path = gdTestFilePath2("gdimageline", "bug00315_exp.png"); + gdAssertImageEqualsToFile(path, im); + gdFree(path); + + gdImageDestroy(im); + + return gdNumFailures(); +} |