From 4b11dc566a5bbfa1378d6266525c281b028abcc8 Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Fri, 10 Feb 2017 20:35:12 +0900 Subject: Imported Upstream version 1.0.0.9910 --- .../palsuite/c_runtime/swprintf/CMakeLists.txt | 1 - .../tests/palsuite/c_runtime/swprintf/swprintf.h | 60 ++++--------------- .../c_runtime/swprintf/test1/CMakeLists.txt | 4 +- .../palsuite/c_runtime/swprintf/test1/test1.cpp | 2 +- .../c_runtime/swprintf/test10/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test11/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test12/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test13/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test14/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test15/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test16/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test17/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test18/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test19/CMakeLists.txt | 4 +- .../palsuite/c_runtime/swprintf/test19/test19.cpp | 8 --- .../c_runtime/swprintf/test2/CMakeLists.txt | 4 +- .../palsuite/c_runtime/swprintf/test2/test2.cpp | 6 ++ .../c_runtime/swprintf/test3/CMakeLists.txt | 4 +- .../palsuite/c_runtime/swprintf/test3/test3.cpp | 6 ++ .../c_runtime/swprintf/test4/CMakeLists.txt | 4 +- .../palsuite/c_runtime/swprintf/test4/test4.cpp | 2 +- .../c_runtime/swprintf/test5/CMakeLists.txt | 19 ------ .../palsuite/c_runtime/swprintf/test5/test5.cpp | 67 ---------------------- .../palsuite/c_runtime/swprintf/test5/testinfo.dat | 12 ---- .../c_runtime/swprintf/test6/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test7/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test8/CMakeLists.txt | 4 +- .../c_runtime/swprintf/test9/CMakeLists.txt | 4 +- 28 files changed, 42 insertions(+), 213 deletions(-) delete mode 100644 src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt delete mode 100644 src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp delete mode 100644 src/pal/tests/palsuite/c_runtime/swprintf/test5/testinfo.dat (limited to 'src/pal/tests/palsuite/c_runtime/swprintf') diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt index cafb9536b0..8fe1cb60ac 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt @@ -14,7 +14,6 @@ add_subdirectory(test19) add_subdirectory(test2) add_subdirectory(test3) add_subdirectory(test4) -add_subdirectory(test5) add_subdirectory(test6) add_subdirectory(test7) add_subdirectory(test8) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h b/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h index 6f4c914a82..210b12ec7a 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h +++ b/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h @@ -18,7 +18,7 @@ void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, param); + swprintf_s(buf, _countof(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0) { @@ -33,7 +33,7 @@ void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, param); + swprintf_s(buf, _countof(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0) { @@ -48,7 +48,7 @@ void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, param); + swprintf_s(buf, _countof(buf), formatstr, param); if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0) { Fail("ERROR: failed to insert pointer to %#p into \"%s\"\n" @@ -57,51 +57,11 @@ void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) } } -void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) -{ - WCHAR buf[512] = { 0 }; - int n = -1; - - swprintf(buf, formatstr, &n); - - if (n != param) - { - Fail("ERROR: Expected count parameter to resolve to %d, got %d\n", - param, n); - } - - if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0) - { - Fail("ERROR: Expected \"%s\" got \"%s\".\n", - convertC(checkstr), convertC(buf)); - } -} - -void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) -{ - WCHAR buf[256] = { 0 }; - short int n = -1; - - swprintf(buf, formatstr, &n); - - if (n != param) - { - Fail("ERROR: Expected count parameter to resolve to %d, got %d\n", - param, n); - } - - if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0) - { - Fail("ERROR: Expected \"%s\" got \"%s\".\n", - convertC(checkstr), convertC(buf)); - } -} - void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, param); + swprintf_s(buf, _countof(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0) { Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n" @@ -114,7 +74,7 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, param); + swprintf_s(buf, _countof(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0) { Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n" @@ -127,7 +87,7 @@ void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, value); + swprintf_s(buf, _countof(buf), formatstr, value); if (memcmp(buf, checkstr, wcslen(checkstr)* 2 + 2) != 0) { Fail("ERROR: failed to insert %#x into \"%s\"\n" @@ -141,7 +101,7 @@ void DoI64Test(const WCHAR *formatstr, INT64 param, char *paramdesc, { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, param); + swprintf_s(buf, _countof(buf), formatstr, param); if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" @@ -155,7 +115,7 @@ void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, { WCHAR buf[256] = { 0 }; - swprintf(buf, formatstr, value); + swprintf_s(buf, _countof(buf), formatstr, value); if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2)*2 + 2) != 0) { @@ -171,7 +131,7 @@ void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, { WCHAR buf[256]; - swprintf(buf, formatstr, precision, param); + swprintf_s(buf, _countof(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0) { @@ -187,7 +147,7 @@ void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double para { WCHAR buf[256]; - swprintf(buf, formatstr, precision, param); + swprintf_s(buf, _countof(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0) { diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt index c9be8c3347..f89cfb6fd6 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test1 add_dependencies(paltest_swprintf_test1 coreclrpal) target_link_libraries(paltest_swprintf_test1 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp index 626040d9f7..c47d7d5202 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp @@ -31,7 +31,7 @@ int __cdecl main(int argc, char *argv[]) } checkstr = convert("hello world"); - swprintf(buf, convert("hello world")); + swprintf_s(buf, _countof(buf), convert("hello world")); if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0) { diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt index 222108393b..70581d16a9 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test10 add_dependencies(paltest_swprintf_test10 coreclrpal) target_link_libraries(paltest_swprintf_test10 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt index 96222a5b2a..4d51917540 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test11 add_dependencies(paltest_swprintf_test11 coreclrpal) target_link_libraries(paltest_swprintf_test11 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt index 1ffe620fed..57cce1679a 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test12 add_dependencies(paltest_swprintf_test12 coreclrpal) target_link_libraries(paltest_swprintf_test12 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt index 8699589ec9..5b6c635858 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test13 add_dependencies(paltest_swprintf_test13 coreclrpal) target_link_libraries(paltest_swprintf_test13 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt index 2a4b84805c..88334d67a5 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test14 add_dependencies(paltest_swprintf_test14 coreclrpal) target_link_libraries(paltest_swprintf_test14 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt index 22382bce5f..5387060b2d 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test15 add_dependencies(paltest_swprintf_test15 coreclrpal) target_link_libraries(paltest_swprintf_test15 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt index 462f0806cd..4f66beaa24 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test16 add_dependencies(paltest_swprintf_test16 coreclrpal) target_link_libraries(paltest_swprintf_test16 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt index c5b4d44593..ace16a18f1 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test17 add_dependencies(paltest_swprintf_test17 coreclrpal) target_link_libraries(paltest_swprintf_test17 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt index 6cdf576966..ddce256260 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test18 add_dependencies(paltest_swprintf_test18 coreclrpal) target_link_libraries(paltest_swprintf_test18 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt index 334b7b4fa1..8d48ce438c 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test19 add_dependencies(paltest_swprintf_test19 coreclrpal) target_link_libraries(paltest_swprintf_test19 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp index c0346036cd..0967bc8f4b 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp @@ -33,14 +33,6 @@ int __cdecl main(int argc, char *argv[]) convert("ba"), convert("ba")); DoArgumentPrecTest(convert("%.*S"), 2, (void*)"bar", "bar", convert("ba"), convert("ba")); - DoArgumentPrecTest(convert("%.*n"), 3, (void*)&n, "pointer to int", convert(""), - convert("")); - if (n != 0) - { - Fail("ERROR: Expected count parameter to resolve to %d, got %X\n", - 0, n); - } - DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', "a", convert("a"), convert("a")); DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', "a", convert("a"), diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt index af2b13e4c7..fcf7136797 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test2 add_dependencies(paltest_swprintf_test2 coreclrpal) target_link_libraries(paltest_swprintf_test2 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp index deffd3edd7..1c2f420fe9 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp @@ -40,6 +40,12 @@ int __cdecl main(int argc, char *argv[]) DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba")); DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar ")); DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar")); + DoWStrTest(convert("foo %s"), NULL, convert("foo (null)")); + DoStrTest(convert("foo %hs"), NULL, convert("foo (null)")); + DoWStrTest(convert("foo %ls"), NULL, convert("foo (null)")); + DoWStrTest(convert("foo %ws"), NULL, convert("foo (null)")); + DoWStrTest(convert("foo %Ls"), NULL, convert("foo (null)")); + DoWStrTest(convert("foo %I64s"), NULL, convert("foo (null)")); PAL_Terminate(); return PASS; diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt index 14b81f4ac8..cc79c2d1d1 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test3 add_dependencies(paltest_swprintf_test3 coreclrpal) target_link_libraries(paltest_swprintf_test3 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp index 42875c0640..8c6c38c96b 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp @@ -38,6 +38,12 @@ int __cdecl main(int argc, char *argv[]) DoStrTest(convert("foo %5.2S"),"bar", convert("foo ba")); DoStrTest(convert("foo %-5S"), "bar", convert("foo bar ")); DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar")); + DoStrTest(convert("foo %S"), NULL, convert("foo (null)")); + DoStrTest(convert("foo %hS"), NULL, convert("foo (null)")); + DoWStrTest(convert("foo %lS"), NULL, convert("foo (null)")); + DoWStrTest(convert("foo %wS"), NULL, convert("foo (null)")); + DoStrTest(convert("foo %LS"), NULL, convert("foo (null)")); + DoStrTest(convert("foo %I64S"), NULL, convert("foo (null)")); PAL_Terminate(); return PASS; } diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt index e153e6b02f..c5d92462a6 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test4 add_dependencies(paltest_swprintf_test4 coreclrpal) target_link_libraries(paltest_swprintf_test4 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp index 02cc3f9005..9a68bdaac3 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp @@ -33,7 +33,7 @@ int __cdecl main(int argc, char *argv[]) /* ** Run only on 64 bit platforms */ -#if defined(BIT64) && defined(PLATFORM_UNIX) +#if defined(BIT64) Trace("Testing for 64 Bit Platforms \n"); DoPointerTest(convert("%p"), NULL, convert("0000000000000000")); DoPointerTest(convert("%p"), ptr, convert("0000000000123456")); diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt deleted file mode 100644 index 967ccbb992..0000000000 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test5.cpp -) - -add_executable(paltest_swprintf_test5 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test5 coreclrpal) - -target_link_libraries(paltest_swprintf_test5 - pthread - m - coreclrpal -) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp deleted file mode 100644 index e85adc120e..0000000000 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// 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: test5.c -** -** Purpose:Tests swprintf with the count specifier -** -** -**==========================================================================*/ - - - -#include -#include "../swprintf.h" - -/* - * Uses memcmp & wcslen - */ - -int __cdecl main(int argc, char *argv[]) -{ - WCHAR *longStr; - WCHAR *longResult; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - longStr = - convert("really-long-string-that-just-keeps-going-on-and-on-and-on.." - "..................useless-filler.................................." - "..................useless-filler.................................." - "..................useless-filler.................................." - "%n bar"); - longResult = - convert("really-long-string-that-just-keeps-going-on-and-on-and-on.." - "..................useless-filler.................................." - "..................useless-filler.................................." - "..................useless-filler.................................." - " bar"); - - DoCountTest(convert("foo %n bar"), 4, convert("foo bar")); - DoCountTest(longStr, 257, longResult); - DoCountTest(convert("fo%n bar"), 2, convert("fo bar")); - DoCountTest(convert("%n"), 0, convert("")); - DoCountTest(convert("foo %#n bar"), 4, convert("foo bar")); - DoCountTest(convert("foo % n bar"), 4, convert("foo bar")); - DoCountTest(convert("foo %+n bar"), 4, convert("foo bar")); - DoCountTest(convert("foo %-n bar"), 4, convert("foo bar")); - DoCountTest(convert("foo %0n bar"), 4, convert("foo bar")); - DoShortCountTest(convert("foo %hn bar"), 4, convert("foo bar")); - DoCountTest(convert("foo %ln bar"), 4, convert("foo bar")); - DoCountTest(convert("foo %Ln bar"), 4, convert("foo bar")); - DoCountTest(convert("foo %I64n bar"), 4, convert("foo bar")); - DoCountTest(convert("foo %20.3n bar"), 4, convert("foo bar")); - - PAL_Terminate(); - - free(longStr); - free(longResult); - - return PASS; -} diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/swprintf/test5/testinfo.dat deleted file mode 100644 index ef1f1ffc5a..0000000000 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test5/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# 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. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests swprintf with the count specifier diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt index 806211a992..044029dd62 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test6 add_dependencies(paltest_swprintf_test6 coreclrpal) target_link_libraries(paltest_swprintf_test6 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt index cf563799d9..3ee7139ec7 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test7 add_dependencies(paltest_swprintf_test7 coreclrpal) target_link_libraries(paltest_swprintf_test7 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt index e8fcf66157..55ac85c164 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test8 add_dependencies(paltest_swprintf_test8 coreclrpal) target_link_libraries(paltest_swprintf_test8 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt index c616348766..7d7f524f65 100644 --- a/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt @@ -13,7 +13,5 @@ add_executable(paltest_swprintf_test9 add_dependencies(paltest_swprintf_test9 coreclrpal) target_link_libraries(paltest_swprintf_test9 - pthread - m - coreclrpal + ${COMMON_TEST_LIBRARIES} ) -- cgit v1.2.3