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 #2 for the wcstoul function |
10 | ** |
11 | ** |
12 | **==========================================================================*/ |
13 | #include <palsuite.h> |
14 | |
15 | /* |
16 | * Notes: wcstoul should depend on the current locale's LC_NUMERIC category, |
17 | * this is not currently tested. |
18 | */ |
19 | |
20 | |
21 | int __cdecl main(int argc, char *argv[]) |
22 | { |
23 | WCHAR teststr[] = {'1','2','3','4','5',0}; |
24 | WCHAR *end; |
25 | ULONG result = 12345; |
26 | ULONG l; |
27 | |
28 | if (0 != PAL_Initialize(argc, argv)) |
29 | { |
30 | return FAIL; |
31 | } |
32 | |
33 | |
34 | l = wcstoul((wchar_t*)teststr, &end, 10); |
35 | |
36 | if (l != result) |
37 | { |
38 | Fail("ERROR: Expected wcstoul to return %u, got %u\n" , result, l); |
39 | } |
40 | |
41 | if (end != teststr + 5) |
42 | { |
43 | Fail("ERROR: Expected wcstoul to give an end value of %p, got %p\n" , |
44 | teststr + 5, end); |
45 | } |
46 | |
47 | PAL_Terminate(); |
48 | return PASS; |
49 | } |
50 | |