diff options
Diffstat (limited to 'tests/gdimagestring16')
-rw-r--r-- | tests/gdimagestring16/.gitignore | 1 | ||||
-rw-r--r-- | tests/gdimagestring16/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/gdimagestring16/Makemodule.am | 8 | ||||
-rw-r--r-- | tests/gdimagestring16/gdimagestring16.c | 30 | ||||
-rw-r--r-- | tests/gdimagestring16/gdimagestring16_exp.png | bin | 0 -> 118 bytes |
5 files changed, 46 insertions, 0 deletions
diff --git a/tests/gdimagestring16/.gitignore b/tests/gdimagestring16/.gitignore new file mode 100644 index 0000000..5ebaa0b --- /dev/null +++ b/tests/gdimagestring16/.gitignore @@ -0,0 +1 @@ +/gdimagestring16 diff --git a/tests/gdimagestring16/CMakeLists.txt b/tests/gdimagestring16/CMakeLists.txt new file mode 100644 index 0000000..e85db9b --- /dev/null +++ b/tests/gdimagestring16/CMakeLists.txt @@ -0,0 +1,7 @@ +IF(PNG_FOUND) +LIST(APPEND TESTS_FILES + gdimagestring16 +) +ENDIF(PNG_FOUND) + +ADD_GD_TESTS() diff --git a/tests/gdimagestring16/Makemodule.am b/tests/gdimagestring16/Makemodule.am new file mode 100644 index 0000000..84b6b5f --- /dev/null +++ b/tests/gdimagestring16/Makemodule.am @@ -0,0 +1,8 @@ +if HAVE_LIBPNG +libgd_test_programs += \ + gdimagestring16/gdimagestring16 +endif + +EXTRA_DIST += \ + gdimagestring16/CMakeLists.txt \ + gdimagestring16/gdimagestring16_exp.png diff --git a/tests/gdimagestring16/gdimagestring16.c b/tests/gdimagestring16/gdimagestring16.c new file mode 100644 index 0000000..0ca0668 --- /dev/null +++ b/tests/gdimagestring16/gdimagestring16.c @@ -0,0 +1,30 @@ +/** + * Base test for gdImageString16() + */ +#include <gd.h> +#include <gdfontl.h> +#include "gdtest.h" + +int main() +{ + /* Declare the image */ + gdImagePtr im = NULL; + unsigned short s[2] = {'H', 0}; + int foreground; + int errorcode = 0; + gdFontPtr fontptr = gdFontGetLarge(); + + im = gdImageCreate(20, 20); + gdImageColorAllocate(im, 255, 255, 255); + foreground = gdImageColorAllocate(im, 22, 4, 238); + + gdImageString16(im, fontptr, 2, 2, s, foreground); + + if (!gdAssertImageEqualsToFile("gdimagestring16/gdimagestring16_exp.png", im)) + errorcode = 1; + + /* Destroy the image in memory */ + gdImageDestroy(im); + + return errorcode; +} diff --git a/tests/gdimagestring16/gdimagestring16_exp.png b/tests/gdimagestring16/gdimagestring16_exp.png Binary files differnew file mode 100644 index 0000000..5700578 --- /dev/null +++ b/tests/gdimagestring16/gdimagestring16_exp.png |