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: test7.c
8**
9** Purpose: Test #6 for the swscanf function
10**
11**
12**==========================================================================*/
13
14
15
16#include <palsuite.h>
17#include "../swscanf.h"
18
19
20int __cdecl main(int argc, char *argv[])
21{
22 int n65535 = 65535; /* Walkaround compiler strictness */
23
24 if (PAL_Initialize(argc, argv))
25 {
26 return FAIL;
27 }
28
29 DoNumTest(convert("1234d"), convert("%x"), 0x1234d);
30 DoNumTest(convert("1234d"), convert("%2x"), 0x12);
31 DoNumTest(convert("-1"), convert("%x"), -1);
32 DoNumTest(convert("0x1234"), convert("%x"), 0x1234);
33 DoNumTest(convert("012"), convert("%x"), 0x12);
34 DoShortNumTest(convert("-1"), convert("%hx"), n65535);
35 DoShortNumTest(convert("10000"), convert("%hx"), 0);
36 DoNumTest(convert("-1"), convert("%lx"), -1);
37 DoNumTest(convert("10000"), convert("%lx"), 65536);
38 DoNumTest(convert("-1"), convert("%Lx"), -1);
39 DoNumTest(convert("10000"), convert("%Lx"), 65536);
40 DoI64NumTest(convert("100000000"), convert("%I64x"), I64(4294967296));
41
42 PAL_Terminate();
43 return PASS;
44}
45