Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/testsuite/newlib.wctype/twctrans.c')
-rw-r--r--newlib/testsuite/newlib.wctype/twctrans.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/newlib/testsuite/newlib.wctype/twctrans.c b/newlib/testsuite/newlib.wctype/twctrans.c
new file mode 100644
index 000000000..a70e00175
--- /dev/null
+++ b/newlib/testsuite/newlib.wctype/twctrans.c
@@ -0,0 +1,23 @@
+#include <wctype.h>
+#include <newlib.h>
+#include "check.h"
+
+int main()
+{
+ wctrans_t x;
+
+ x = wctrans ("tolower");
+ CHECK (x != 0);
+ CHECK (towctrans (L'A', x) == tolower ('A'));
+ CHECK (towctrans (L'5', x) == tolower ('5'));
+
+ x = wctrans ("toupper");
+ CHECK (x != 0);
+ CHECK (towctrans (L'c', x) == toupper ('c'));
+ CHECK (towctrans (L'9', x) == toupper ('9'));
+
+ x = wctrans ("unknown");
+ CHECK (x == 0);
+
+ exit (0);
+}