diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gdimageconvolution/.gitignore | 1 | ||||
-rw-r--r-- | tests/gdimageconvolution/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/gdimageconvolution/Makemodule.am | 3 | ||||
-rw-r--r-- | tests/gdimageconvolution/bug00369.c | 28 |
4 files changed, 34 insertions, 0 deletions
diff --git a/tests/gdimageconvolution/.gitignore b/tests/gdimageconvolution/.gitignore index 1ffd796..6665df0 100644 --- a/tests/gdimageconvolution/.gitignore +++ b/tests/gdimageconvolution/.gitignore @@ -1 +1,2 @@ /basic +/bug00369 diff --git a/tests/gdimageconvolution/CMakeLists.txt b/tests/gdimageconvolution/CMakeLists.txt index 802c382..dc1fc51 100644 --- a/tests/gdimageconvolution/CMakeLists.txt +++ b/tests/gdimageconvolution/CMakeLists.txt @@ -1,3 +1,5 @@ +LIST(APPEND TESTS_FILES bug00369) + IF(PNG_FOUND) LIST(APPEND TESTS_FILES basic diff --git a/tests/gdimageconvolution/Makemodule.am b/tests/gdimageconvolution/Makemodule.am index 8f65b0f..df5249d 100644 --- a/tests/gdimageconvolution/Makemodule.am +++ b/tests/gdimageconvolution/Makemodule.am @@ -1,3 +1,6 @@ +libgd_test_programs += \ + gdimageconvolution/bug00369 + if HAVE_LIBPNG libgd_test_programs += \ gdimageconvolution/basic diff --git a/tests/gdimageconvolution/bug00369.c b/tests/gdimageconvolution/bug00369.c new file mode 100644 index 0000000..631cb7a --- /dev/null +++ b/tests/gdimageconvolution/bug00369.c @@ -0,0 +1,28 @@ +/** + * Test Issue #369 for gdImageConvolution() + */ + +#include "gd.h" +#include "gdtest.h" + +int main() +{ + gdImagePtr im; + float matrix[3][3] = { + {1, 0, 1}, + {0, 5, 0}, + {1, 0, 0} + }; + + im = gdImageCreateTrueColor(40, 40); + gdImageAlphaBlending(im, gdEffectReplace); + gdImageFilledRectangle(im, 0, 0, 39, 39, 0x7FFFFFFF); + gdImageFilledEllipse(im, 19, 19, 20, 20, 0x00FF00); + + gdImageConvolution(im, matrix, 9, 1); + gdTestAssert(0x7F010101 == gdImageGetPixel(im, 0, 0)); + + gdImageDestroy(im); + + return gdNumFailures(); +} |