diff options
Diffstat (limited to 'src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c')
-rw-r--r-- | src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c new file mode 100644 index 0000000000..3a758de39b --- /dev/null +++ b/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c @@ -0,0 +1,50 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +/*============================================================================ +** +** Source: test1.c +** +** Purpose: Using memcmp to check the result, convert a wide character string +** with capitals, to all lowercase using this function. Test #1 for the +** wcslwr function +** +** +**==========================================================================*/ + +#include <palsuite.h> + +/* uses memcmp,wcslen */ + +int __cdecl main(int argc, char *argv[]) +{ + WCHAR *test_str = NULL; + WCHAR *expect_str = NULL; + WCHAR *result_str = NULL; + + /* + * Initialize the PAL and return FAIL if this fails + */ + if (0 != (PAL_Initialize(argc, argv))) + { + return FAIL; + } + + test_str = convert("aSdF 1#"); + expect_str = convert("asdf 1#"); + + result_str = _wcslwr(test_str); + if (memcmp(result_str, expect_str, wcslen(expect_str)*2 + 2) != 0) + { + Fail ("ERROR: Expected to get \"%s\", got \"%s\".\n", + convertC(expect_str), convertC(result_str)); + } + + free(result_str); + free(expect_str); + + PAL_Terminate(); + return PASS; +} + |