diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/tests/gdimagestring16')
4 files changed, 47 insertions, 0 deletions
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagestring16/CMakeLists.txt b/Build/source/libs/gd/libgd-src/tests/gdimagestring16/CMakeLists.txt new file mode 100644 index 00000000000..e85db9b587c --- /dev/null +++ b/Build/source/libs/gd/libgd-src/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/Build/source/libs/gd/libgd-src/tests/gdimagestring16/Makemodule.am b/Build/source/libs/gd/libgd-src/tests/gdimagestring16/Makemodule.am new file mode 100644 index 00000000000..84b6b5fd2fe --- /dev/null +++ b/Build/source/libs/gd/libgd-src/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/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c b/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c new file mode 100644 index 00000000000..57eae978c36 --- /dev/null +++ b/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16.c @@ -0,0 +1,32 @@ +/** + * Base test for gdImageString16() + */ +#include <gd.h> +#include <gdfontl.h> +#include "gdtest.h" + +int main() +{ + /* Declare the image */ + gdImagePtr im = NULL; + wchar_t *wchr = L"H"; + unsigned short *sptr; + sptr = (unsigned short *)wchr; + 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, sptr, foreground); + + if (!gdAssertImageEqualsToFile("gdimagestring16/gdimagestring16_exp.png", im)) + errorcode = 1; + + /* Destroy the image in memory */ + gdImageDestroy(im); + + return errorcode; +} diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png Binary files differnew file mode 100644 index 00000000000..5700578b0e2 --- /dev/null +++ b/Build/source/libs/gd/libgd-src/tests/gdimagestring16/gdimagestring16_exp.png |