source: trunk/src/libctests/glibc/libio/tst_wscanf.c@ 2036

Last change on this file since 2036 was 2036, checked in by bird, 20 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 598 bytes
Line 
1#include <stdio.h>
2#include <string.h>
3#include <wchar.h>
4
5int
6main (int argc, char *argv[])
7{
8 int n;
9 int result = 0;
10 char buf1[20];
11 wchar_t wbuf2[20];
12 char c3;
13 wchar_t wc4;
14 int d;
15
16 puts ("Test 1");
17
18 n = wscanf (L"%s %S %c%C %d", buf1, wbuf2, &c3, &wc4, &d);
19
20 if (n != 5 || strcmp (buf1, "Hello") != 0 || wcscmp (wbuf2, L"World") != 0
21 || c3 != '!' || wc4 != L'!' || d != 42)
22 {
23 printf ("*** FAILED, n = %d, buf1 = \"%s\", wbuf2 = L\"%S\", c3 = '%c', wc4 = L'%C', d = %d\n",
24 n, buf1, wbuf2, c3, (wint_t) wc4, d);
25 result = 1;
26 }
27
28 return result;
29}
Note: See TracBrowser for help on using the repository browser.