|
Packit Service |
82fcde |
#include <stdio.h>
|
|
Packit Service |
82fcde |
#include <string.h>
|
|
Packit Service |
82fcde |
#include <wchar.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
int
|
|
Packit Service |
82fcde |
main (int argc, char *argv[])
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
int n;
|
|
Packit Service |
82fcde |
int result = 0;
|
|
Packit Service |
82fcde |
char buf1[20];
|
|
Packit Service |
82fcde |
wchar_t wbuf2[20];
|
|
Packit Service |
82fcde |
char c3;
|
|
Packit Service |
82fcde |
wchar_t wc4;
|
|
Packit Service |
82fcde |
int d;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
puts ("Test 1");
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
n = wscanf (L"%s %S %c%C %d", buf1, wbuf2, &c3, &wc4, &d);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
if (n != 5 || strcmp (buf1, "Hello") != 0 || wcscmp (wbuf2, L"World") != 0
|
|
Packit Service |
82fcde |
|| c3 != '!' || wc4 != L'!' || d != 42)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("*** FAILED, n = %d, buf1 = \"%s\", wbuf2 = L\"%S\", c3 = '%c', wc4 = L'%C', d = %d\n",
|
|
Packit Service |
82fcde |
n, buf1, wbuf2, c3, (wint_t) wc4, d);
|
|
Packit Service |
82fcde |
result = 1;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return result;
|
|
Packit Service |
82fcde |
}
|