summaryrefslogtreecommitdiff
path: root/tests/gdimagestring16/gdimagestring16.c
diff options
context:
space:
mode:
authorAdam Silverstein <adamjs@google.com>2021-05-05 09:30:02 -0600
committerAdam Silverstein <adamjs@google.com>2021-05-05 09:30:02 -0600
commita2b3ba08ef945e472de9ceeef2b748eb4028cf7a (patch)
tree9ef6e2ddfe95b2ed9267965df2dcca4beb72755e /tests/gdimagestring16/gdimagestring16.c
parent3826c44e52b4d2e4c06eae3aca908246465b6968 (diff)
parent82d260950589563a1af9c56f4ce5fde843a695ae (diff)
downloadlibgd-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.c30
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;
+}