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: Tests that wcscmp correctly compares two strings with
10** case sensitivity.
11**
12**
13**==========================================================================*/
14
15#include <palsuite.h>
16
17
18int __cdecl main(int argc, char *argv[])
19{
20 WCHAR str1[] = {'f','o','o',0};
21 WCHAR str2[] = {'f','o','o','x',0};
22 WCHAR str3[] = {'f','O','o',0};
23 char cstr1[] = "foo";
24 char cstr2[] = "foox";
25 char cstr3[] = "fOo";
26
27 if (PAL_Initialize(argc, argv))
28 {
29 return FAIL;
30 }
31
32
33
34 if (wcscmp(str1, str2) >= 0)
35 {
36 Fail("ERROR: wcscmp(\"%s\", \"%s\") returned >= 0\n", cstr1, cstr2);
37 }
38
39 if (wcscmp(str2, str1) <= 0)
40 {
41 Fail("ERROR: wcscmp(\"%s\", \"%s\") returned <= 0\n", cstr2, cstr1);
42 }
43
44 if (wcscmp(str1, str3) <= 0)
45 {
46 Fail("ERROR: wcscmp(\"%s\", \"%s\") returned >= 0\n", cstr1, cstr3);
47 }
48
49 if (wcscmp(str3, str1) >= 0)
50 {
51 Fail("ERROR: wcscmp(\"%s\", \"%s\") returned >= 0\n", cstr3, cstr1);
52 }
53
54 PAL_Terminate();
55
56 return PASS;
57}
58