1 | // Licensed to the .NET Foundation under one or more agreements. |
2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | // See the LICENSE file in the project root for more information. |
4 | |
5 | /*============================================================================ |
6 | ** |
7 | ** Source: test2.c |
8 | ** |
9 | ** Purpose: Test to see if swscanf handles whitespace correctly |
10 | ** |
11 | ** |
12 | **==========================================================================*/ |
13 | |
14 | |
15 | |
16 | #include <palsuite.h> |
17 | #include "../swscanf.h" |
18 | |
19 | /* |
20 | * Tests out how it handles whitespace. Seems to accept anything that qualifies |
21 | * as isspace (space, tab, vertical tab, line feed, carriage return and form |
22 | * feed), even if it says it only wants spaces tabs and newlines. |
23 | */ |
24 | |
25 | int __cdecl main(int argc, char *argv[]) |
26 | { |
27 | |
28 | if (PAL_Initialize(argc, argv)) |
29 | { |
30 | return FAIL; |
31 | } |
32 | |
33 | DoStrTest(convert("foo bar" ), convert("foo %S" ), "bar" ); |
34 | DoStrTest(convert("foo\tbar" ), convert("foo %S" ), "bar" ); |
35 | DoStrTest(convert("foo\nbar" ), convert("foo %S" ), "bar" ); |
36 | DoStrTest(convert("foo\rbar" ), convert("foo %S" ), "bar" ); |
37 | DoStrTest(convert("foo\vbar" ), convert("foo %S" ), "bar" ); |
38 | DoStrTest(convert("foo\fbar" ), convert("foo %S" ), "bar" ); |
39 | DoStrTest(convert("foo \t\n\r\v\fbar" ), convert("foo %S" ), "bar" ); |
40 | |
41 | PAL_Terminate(); |
42 | return PASS; |
43 | } |
44 | |