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