about summary refs log tree commit diff
path: root/REORG.TODO/libio/tst_wscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/libio/tst_wscanf.c')
-rw-r--r--REORG.TODO/libio/tst_wscanf.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/REORG.TODO/libio/tst_wscanf.c b/REORG.TODO/libio/tst_wscanf.c
new file mode 100644
index 0000000000..df209838c2
--- /dev/null
+++ b/REORG.TODO/libio/tst_wscanf.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+
+int
+main (int argc, char *argv[])
+{
+  int n;
+  int result = 0;
+  char buf1[20];
+  wchar_t wbuf2[20];
+  char c3;
+  wchar_t wc4;
+  int d;
+
+  puts ("Test 1");
+
+  n = wscanf (L"%s %S %c%C %d", buf1, wbuf2, &c3, &wc4, &d);
+
+  if (n != 5 || strcmp (buf1, "Hello") != 0 || wcscmp (wbuf2, L"World") != 0
+      || c3 != '!' || wc4 != L'!' || d != 42)
+    {
+      printf ("*** FAILED, n = %d, buf1 = \"%s\", wbuf2 = L\"%S\", c3 = '%c', wc4 = L'%C', d = %d\n",
+	      n, buf1, wbuf2, c3, (wint_t) wc4, d);
+      result = 1;
+    }
+
+  return result;
+}