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: test1.c
8**
9** Purpose:
10** Tests that wcslen correctly returns the length (in wide characters,
11** not byte) of a wide string
12**
13**
14**==========================================================================*/
15
16
17
18#include <palsuite.h>
19
20int __cdecl main(int argc, char *argv[])
21{
22 WCHAR str1[] = {'f','o','o',' ',0};
23 WCHAR str2[] = {0};
24 int ret;
25
26
27 if (PAL_Initialize(argc, argv))
28 {
29 return FAIL;
30 }
31
32
33 ret = wcslen(str1);
34 if (ret != 4)
35 {
36 Fail("ERROR: Expected wcslen of \"foo \" to be 4, got %d\n", ret);
37 }
38
39 ret = wcslen(str2);
40 if (ret != 0)
41 {
42 Fail("ERROR: Expected wcslen of \"\" to be 0, got %d\n", ret);
43 }
44
45
46 PAL_Terminate();
47 return PASS;
48}
49
50