summaryrefslogtreecommitdiff
path: root/tests/test_thstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_thstr.c')
-rw-r--r--tests/test_thstr.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_thstr.c b/tests/test_thstr.c
new file mode 100644
index 0000000..44ebe1f
--- /dev/null
+++ b/tests/test_thstr.c
@@ -0,0 +1,24 @@
+/*
+ * test_thstr.c : Test suite for <thai/thstr.h> functions
+ * Created: 2001-08-03
+ * Author: Theppitak Karoonboonyanan
+ */
+
+#include <thai/thstr.h>
+#include <string.h>
+
+int test_th_normalize()
+{
+ const thchar_t* test_str = (const thchar_t *)"¤Øس»èÙ«èèÙ«èèÒ";
+ const thchar_t* ans_str = (const thchar_t *)"¤Ø³»Ùè«Ùè«èÒ";
+ thchar_t resBuff[50];
+
+ th_normalize(resBuff, test_str, sizeof resBuff);
+ return (strcmp((const char *)resBuff, (const char *)ans_str) == 0) ? 0 : 1;
+}
+
+int main()
+{
+ return test_th_normalize();
+}
+