diff options
author | Adam Silverstein <adamjs@google.com> | 2021-05-05 09:30:02 -0600 |
---|---|---|
committer | Adam Silverstein <adamjs@google.com> | 2021-05-05 09:30:02 -0600 |
commit | a2b3ba08ef945e472de9ceeef2b748eb4028cf7a (patch) | |
tree | 9ef6e2ddfe95b2ed9267965df2dcca4beb72755e /tests/gdimagestring16/gdimagestring16.c | |
parent | 3826c44e52b4d2e4c06eae3aca908246465b6968 (diff) | |
parent | 82d260950589563a1af9c56f4ce5fde843a695ae (diff) | |
download | libgd-a2b3ba08ef945e472de9ceeef2b748eb4028cf7a.tar.gz |
Merge branch 'master' into webp-lossless
# Conflicts:
# tests/webp/.gitignore
# tests/webp/CMakeLists.txt
# tests/webp/Makemodule.am
Diffstat (limited to 'tests/gdimagestring16/gdimagestring16.c')
-rw-r--r-- | tests/gdimagestring16/gdimagestring16.c | 30 |
1 files changed, 30 insertions, 0 deletions
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; +} |