From 40ed240f046290527d11acc1e16aaff2f71eebe4 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 16 Jul 2019 19:54:54 -0700 Subject: [PATCH] Delete PAL tests for GetDateFormat and GetCalendarInfo (dotnet/coreclr#25675) These APIs do not exist in the CoreCLR PAL anymore. Commit migrated from https://github.com/dotnet/coreclr/commit/208f92b807e5fa1c267d02f9070a0b589da2ac4f --- .../src/pal/tests/palsuite/DisabledTests.txt | 34 ------ .../GetCalendarInfoW/CMakeLists.txt | 5 - .../GetCalendarInfoW/test1/CMakeLists.txt | 17 --- .../test1/GetCalendarInfoW.cpp | 57 ---------- .../GetCalendarInfoW/test1/testinfo.dat | 14 --- .../GetCalendarInfoW/test2/CMakeLists.txt | 17 --- .../test2/GetCalendarInfoW.cpp | 79 -------------- .../GetCalendarInfoW/test2/testinfo.dat | 11 -- .../GetDateFormatW/CMakeLists.txt | 6 -- .../GetDateFormatW_neg1/CMakeLists.txt | 17 --- .../GetDateFormatW_neg.cpp | 85 --------------- .../GetDateFormatW_neg1/testinfo.dat | 8 -- .../GetDateFormatW_neg2/CMakeLists.txt | 17 --- .../GetDateFormatW_neg.cpp | 98 ----------------- .../GetDateFormatW_neg2/testinfo.dat | 9 -- .../GetDateFormatW/test1/CMakeLists.txt | 17 --- .../GetDateFormatW/test1/GetDateFormatW.cpp | 100 ------------------ .../GetDateFormatW/test1/testinfo.dat | 9 -- .../palsuite/paltestlist_to_be_reviewed.txt | 7 -- 19 files changed, 607 deletions(-) delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/CMakeLists.txt delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.cpp delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/testinfo.dat delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.cpp delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/testinfo.dat delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/CMakeLists.txt delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/testinfo.dat delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/testinfo.dat delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp delete mode 100644 src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/testinfo.dat diff --git a/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt b/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt index 36c09d2d9ec..e0667e62643 100644 --- a/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt +++ b/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt @@ -48,40 +48,6 @@ This test will be useful in future versions for testing various languages (code pages). Currently only U.S. English (tested by - test1) is supported. -miscellaneous/getcalendarinfow/test2: -======================================= -Currently the only calendars that are supported are CAL_GREGORIAN -and CAL_GREGORIAN_US, which are tested by test1. This test will -be useful when full calendar support is implemented. - -miscellaneous/getdateformatw/test1: -=================================== -Currently the only calendars that are supported are CAL_GREGORIAN -and CAL_GREGORIAN_US. The GetDateFormatW function will only be -called when the calendar is CAL_TAIWAN. Since this calendar is not -currently supported in this release of the PAL, the GetDateFormatW -function is not implemented except to return an error. This test -will be useful when full calendar support is implemented. - -miscellaneous/getdateformatw/getdateformatw_neg1: -================================================ -Currently the only calendars that are supported are CAL_GREGORIAN -and CAL_GREGORIAN_US. The GetDateFormatW function will only be -called when the calendar is CAL_TAIWAN. Since this calendar is not -currently supported in this release of the PAL, the GetDateFormatW -function is not implemented except to return an error. This test -will be useful when full calendar support is implemented. - -miscellaneous/getdateformatw/getdateformatw_neg2: -================================================ -Currently the only calendars that are supported are CAL_GREGORIAN -and CAL_GREGORIAN_US. The GetDateFormatW function will only be -called when the calendar is CAL_TAIWAN. Since this calendar is not -currently supported in this release of the PAL, the GetDateFormatW -function is not implemented except to return an error. This test -will be useful when full calendar support is implemented. - - pal_specific/pal_get_stdin/test1 : ======================================= This test case should be run manually. Requires user input. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/CMakeLists.txt deleted file mode 100644 index ef14ea53524..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt deleted file mode 100644 index 11c278015c5..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - GetCalendarInfoW.cpp -) - -add_executable(paltest_getcalendarinfow_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcalendarinfow_test1 coreclrpal) - -target_link_libraries(paltest_getcalendarinfow_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.cpp deleted file mode 100644 index 4876fe180f1..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.cpp +++ /dev/null @@ -1,57 +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: GetCalendarInfoW.c -** -** Purpose: Positive test the GetCalendarInfoW API. -** Call GetCalendarInfoW to retrieve the information of a -** calendar -** -** -**============================================================*/ -#define UNICODE -#include - -int __cdecl main(int argc, char *argv[]) -{ - int err; - LCID Locale = LOCALE_USER_DEFAULT; - CALTYPE CalType = CAL_ITWODIGITYEARMAX|CAL_RETURN_NUMBER; - DWORD dwValue; - - /*Initialize the PAL environment*/ - err = PAL_Initialize(argc, argv); - if(0 != err) - { - return FAIL; - } - - err = GetCalendarInfoW(Locale,/*locale idendifier*/ - CAL_GREGORIAN, /*calendar identifier*/ - CalType, /*calendar tyope*/ - NULL, /*buffer to store the retrieve info*/ - 0, /*alwayse zero*/ - &dwValue);/*to store the requrest data*/ - if (0 == err) - { - Fail("GetCalendarInfoW failed for CAL_GREGORIAN!\n"); - } - - err = GetCalendarInfoW(Locale,/*locale idendifier*/ - CAL_GREGORIAN_US, /*calendar identifier*/ - CalType, /*calendar tyope*/ - NULL, /*buffer to store the retreive info*/ - 0, /*alwayse zero*/ - &dwValue);/*to store the requrest data*/ - if (0 == err) - { - Fail("GetCalendarInfoW failed for CAL_GREGORIAN_US!\n"); - } - - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/testinfo.dat deleted file mode 100644 index 59c806c22af..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/testinfo.dat +++ /dev/null @@ -1,14 +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 = miscellaneous -Function = GetCalendarInfoW -Name = Positive test for GetCalendarInfoW API to retrieve the info of a calendar -TYPE = DEFAULT -EXE1 = getcalendarinfow -Description -= Test the GetCalendarInfoW to retrieve the information of a calendar -= This test for US English - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt deleted file mode 100644 index 2abf2901c0e..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - GetCalendarInfoW.cpp -) - -add_executable(paltest_getcalendarinfow_test2 - ${SOURCES} -) - -add_dependencies(paltest_getcalendarinfow_test2 coreclrpal) - -target_link_libraries(paltest_getcalendarinfow_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.cpp deleted file mode 100644 index d8a59a0fc0b..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.cpp +++ /dev/null @@ -1,79 +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: GetCalendarInfoW.c -** -** Purpose: Positive test the GetCalendarInfoW API. -** Call GetCalendarInfoW to retrieve the information of all -** calendars -** -** -**============================================================*/ -#define UNICODE -#include - -int __cdecl main(int argc, char *argv[]) -{ - int err; - int index = 0; - LCID Locale = LOCALE_USER_DEFAULT; - CALID Calendar; - CALTYPE CalType = CAL_ITWODIGITYEARMAX|CAL_RETURN_NUMBER; - DWORD dwValue; - char *CalendarID[]={"CAL_GREGORIAN", - "CAL_GREGORIAN_US", - "CAL_JAPAN", - "CAL_TAIWAN", - "CAL_KOREA", - "CAL_HIJRI", - "CAL_THAI", - "CAL_HEBREW", - "CAL_GREGORIAN_ME_FRENCH", - "CAL_GREGORIAN_ARABIC", - "CAL_GREGORIAN_XLIT_ENGLISH", - "CAL_GREGORIAN_XLIT_FRENCH", - "CAL_JULIAN"}; - - char errBuffer[1024]; - - - /*Initialize the PAL environment*/ - err = PAL_Initialize(argc, argv); - if(0 != err) - { - return FAIL; - } - - memset(errBuffer, 0, 1024); - - for(index=0; index<13; index++) - { - Calendar = index + 1; - /*retrieve the specified calendar info*/ - err = GetCalendarInfoW(Locale,/*locale idendifier*/ - Calendar, /*calendar identifier*/ - CalType, /*calendar tyope*/ - NULL, /*buffer to store the retreive info*/ - 0, /*alwayse zero*/ - &dwValue);/*to store the requrest data*/ - if(0 == err) - { - strcat(errBuffer, CalendarID[index]); - strcat(errBuffer, ", "); - } - } - - - if(strlen(errBuffer) > 0) - { - Fail("\nFailed to call GetCalendarInfoW API by passing %s" - " Calendar identifier(s)\n",errBuffer); - } - - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/testinfo.dat deleted file mode 100644 index ea85e99a30e..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -Version = 1.0 -Section = miscellaneous -Function = GetCalendarInfoW -Name = Positive test #2 for GetCalendarInfoW API to retrieve the info of a -calendar -TYPE = DEFAULT -EXE1 = getcalendarinfow -Description -= Test the GetCalendarInfoW to retrieve the information of all calendars -= but US English - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/CMakeLists.txt deleted file mode 100644 index 80b6a0d41d4..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(GetDateFormatW_neg1) -add_subdirectory(GetDateFormatW_neg2) -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt deleted file mode 100644 index 9d9512ce783..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - GetDateFormatW_neg.cpp -) - -add_executable(paltest_getdateformatw_getdateformatw_neg1 - ${SOURCES} -) - -add_dependencies(paltest_getdateformatw_getdateformatw_neg1 coreclrpal) - -target_link_libraries(paltest_getdateformatw_getdateformatw_neg1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp deleted file mode 100644 index 96a481167fe..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp +++ /dev/null @@ -1,85 +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: GetDateFormatW_neg.c -** -** Purpose: Negative test the GetDateFormatW API. -** Call GetDateFormatW by passing an invalid parameter -** -** -**============================================================*/ -#define UNICODE -#include - -int __cdecl main(int argc, char *argv[]) -{ - int err; - WCHAR *wpFormat; - LPCSTR lpString = "gg"; - CONST SYSTEMTIME *lpDate = NULL; - LCID DefaultLocale; - DWORD dwFlags; - int DateSize; - WCHAR *wpBuffer = NULL; - - /*Initialize the PAL environment*/ - err = PAL_Initialize(argc, argv); - if(0 != err) - { - return FAIL; - } - - /*convert to a wide character string*/ - wpFormat = convert((char *)lpString); - - dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/ - - - DateSize = 0; - - /*retrieve the buffer size*/ - DateSize = GetDateFormatW( - DefaultLocale, /*system default locale*/ - dwFlags, /*function option*/ - (SYSTEMTIME *)lpDate, /*always is NULL*/ - wpFormat, /*pointer to a picture string*/ - wpBuffer, /*out buffer*/ - DateSize); /*buffer size*/ - - if(DateSize <= 0) - { - free(wpFormat); - Fail("\nRetrieved an invalid buffer size\n"); - } - - wpBuffer = (WCHAR*)malloc((DateSize + 1)*sizeof(WCHAR)); - if(NULL == wpBuffer) - { - free(wpFormat); - Fail("\nFailed to allocate memory to store the formatted string\n"); - } - - /*format a date by passing an invalid locale indentifier*/ - err = GetDateFormatW( - -1, /*invalid locale identifier*/ - dwFlags, /*function option*/ - (SYSTEMTIME *)lpDate, /*always is NULL, or use system date*/ - wpFormat, /*pointer to a picture string*/ - wpBuffer, /*out buffer*/ - DateSize); /*buffer size*/ - - free(wpBuffer); - free(wpFormat); - - if(0 != err || GetLastError() != ERROR_INVALID_PARAMETER) - { - Fail("\nFailed to call GetDateFormatW for a negative test by " - "passing an invalid parameter, error code=%d\n", GetLastError()); - } - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/testinfo.dat deleted file mode 100644 index f02271650c9..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/testinfo.dat +++ /dev/null @@ -1,8 +0,0 @@ -Version = 1.0 -Section = miscellaneous -Function = GetDateFormatW -Name = Negative test for GetDateFormatW by passing an invlid locale identifier -TYPE = DEFAULT -EXE1 = getdateformatw_neg -Description -=negative test GetDateFormatW by passing an invalid locale identifier diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt deleted file mode 100644 index dc4215ea578..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - GetDateFormatW_neg.cpp -) - -add_executable(paltest_getdateformatw_getdateformatw_neg2 - ${SOURCES} -) - -add_dependencies(paltest_getdateformatw_getdateformatw_neg2 coreclrpal) - -target_link_libraries(paltest_getdateformatw_getdateformatw_neg2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp deleted file mode 100644 index 43f32cf69e3..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp +++ /dev/null @@ -1,98 +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: GetDateFormatW_neg.c -** -** Purpose: Negative test the GetDateFormatW API. -** Call GetDateFormatW by passing an invalid flag -** -** -**============================================================*/ -#define UNICODE -#include - -int __cdecl main(int argc, char *argv[]) -{ - int err; - WCHAR *wpFormat; - LPCSTR lpString = "gg"; - CONST SYSTEMTIME *lpDate = NULL; - LCID DefaultLocale; - DWORD dwFlags; - int DateSize; - WCHAR *wpBuffer = NULL; - - /*Initialize the PAL environment*/ - err = PAL_Initialize(argc, argv); - if(0 != err) - { - return FAIL; - } - - /*convert to a wide character string*/ - wpFormat = convert((char *)lpString); - - /* - DefaultLocale = GetSystemDefaultLCID() which is not defined in PAL; - - LOCALE_SYSTEM_DEFAULT = MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) - - LANG_SYSTEM_DEFAULT = MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT); - SUBLANG_SYS_DEFAULT is not defined in PAL, here use hardcoding, - the value is from winnt.h - */ - - DefaultLocale = MAKELCID(MAKELANGID(LANG_NEUTRAL, 0x02), SORT_DEFAULT); - - dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/ - - - DateSize = 0; - - /*retrieve the buffer size*/ - DateSize = GetDateFormatW( - DefaultLocale, /*system default locale*/ - dwFlags, /*function option*/ - (SYSTEMTIME *)lpDate, /*always is NULL*/ - wpFormat, /*pointer to a picture string*/ - wpBuffer, /*out buffer*/ - DateSize); /*buffer size*/ - - if(DateSize <= 0) - { - free(wpFormat); - Fail("\nRetrieved an invalid buffer size\n"); - } - - wpBuffer = (WCHAR*)malloc((DateSize + 1)*sizeof(WCHAR)); - if(NULL == wpBuffer) - { - free(wpFormat); - Fail("\nFailed to allocate memory to store the formatted string\n"); - } - - err = GetDateFormatW( - DefaultLocale, /*system default locale*/ - 0x00000001|0x00000008,/*DATE_SHORTDATE|DATE_YEARMONTH */ - /*an invalid flag*/ - (SYSTEMTIME *)lpDate, /*always is NULL, or use system date*/ - wpFormat, /*pointer to a picture string*/ - wpBuffer, /*out buffer*/ - DateSize); /*buffer size*/ - - free(wpBuffer); - free(wpFormat); - - if(0 != err || GetLastError() != ERROR_INVALID_FLAGS) - { - Fail("\nFailed to call GetDateFormatW for a negative test by " - "passing an invalid flag, error code=%d\n", GetLastError()); - } - - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/testinfo.dat deleted file mode 100644 index fe5bc9b06ed..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/testinfo.dat +++ /dev/null @@ -1,9 +0,0 @@ -Version = 1.0 -Section = miscellaneous -Function = GetDateFormatW -Name = Negative test for GetDateFormatW by passing an invalid flag -TYPE = DEFAULT -EXE1 = getdateformatw_neg -Description -=test for GetDateFormatW by passing an invalid flag which is not -=supported diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt deleted file mode 100644 index b392d02ca49..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - GetDateFormatW.cpp -) - -add_executable(paltest_getdateformatw_test1 - ${SOURCES} -) - -add_dependencies(paltest_getdateformatw_test1 coreclrpal) - -target_link_libraries(paltest_getdateformatw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp deleted file mode 100644 index 6e3c3b4894e..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp +++ /dev/null @@ -1,100 +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: GetDateFormatW.c -** -** Purpose: Positive test the GetDateFormatW API. -** Call GetDateFormatW to format a date string for -** a specified locale -** -** -**============================================================*/ -#define UNICODE -#include - -int __cdecl main(int argc, char *argv[]) -{ - int err; - WCHAR *wpFormat; - LPCSTR lpString = "gg"; - CONST SYSTEMTIME *lpDate = NULL; - LCID DefaultLocale; - DWORD dwFlags; - int DateSize; - WCHAR *wpBuffer = NULL; - - /*Initialize the PAL environment*/ - err = PAL_Initialize(argc, argv); - if(0 != err) - { - return FAIL; - } - - /*convert to a wide character string*/ - wpFormat = convert((char *)lpString); - - /* - DefaultLocale = GetSystemDefaultLCID() which is not defined in PAL; - - LOCALE_SYSTEM_DEFAULT = MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) - - LANG_SYSTEM_DEFAULT = MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT); - SUBLANG_SYS_DEFAULT is not defined in PAL, here use hardcoding, - the value is from winnt.h - */ - DefaultLocale = MAKELCID(MAKELANGID(LANG_NEUTRAL, 0x02), SORT_DEFAULT); - - dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/ - - - DateSize = 0; - - /*retrieve the buffer size*/ - DateSize = GetDateFormatW( - DefaultLocale, /*system default locale*/ - dwFlags, /*function option*/ - (SYSTEMTIME *)lpDate, /*always is NULL*/ - wpFormat, /*pointer to a picture string*/ - wpBuffer, /*out buffer*/ - DateSize); /*buffer size*/ - - if(DateSize <= 0) - { - free(wpFormat); - Fail("\nRetrieved an invalid buffer size\n"); - } - - - wpBuffer = (WCHAR*)malloc((DateSize+1)*sizeof(WCHAR)); - if(NULL == wpBuffer) - { - free(wpFormat); - Fail("\nFailed to allocate memory to store a formatted string\n"); - } - - /*retrieve the formatted string for a specified locale*/ - err = GetDateFormatW( - DefaultLocale, /*system default locale*/ - dwFlags, /*function option*/ - (SYSTEMTIME *)lpDate, /*always is NULL*/ - wpFormat, /*pointer to a picture string*/ - wpBuffer, /*out buffer*/ - DateSize); /*buffer size*/ - - if(0 == err) - { - free(wpBuffer); - free(wpFormat); - Fail("\nFailed to call GetDateFormatW to format a system data " - "as a data string for system default locale!\n"); - } - - free(wpBuffer); - free(wpFormat); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/testinfo.dat deleted file mode 100644 index 6ed9ee7cefc..00000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/testinfo.dat +++ /dev/null @@ -1,9 +0,0 @@ -Version = 1.0 -Section = miscellaneous -Function = GetDateFormatW -Name = Positive test for GetDateFormatW to format a date as a date string -TYPE = DEFAULT -EXE1 = getdateformatw -Description -=test for GetDateFormatW to format a date as a date string -=for a specified locale diff --git a/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt b/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt index 39370261be3..67ff16b02de 100644 --- a/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt +++ b/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt @@ -126,11 +126,6 @@ locale_info/WideCharToMultiByte/test4/paltest_widechartomultibyte_test4 miscellaneous/FormatMessageW/test4/paltest_formatmessagew_test4 miscellaneous/FormatMessageW/test5/paltest_formatmessagew_test5 miscellaneous/FormatMessageW/test6/paltest_formatmessagew_test6 -miscellaneous/GetCalendarInfoW/test1/paltest_getcalendarinfow_test1 -miscellaneous/GetCalendarInfoW/test2/paltest_getcalendarinfow_test2 -miscellaneous/GetDateFormatW/GetDateFormatW_neg1/paltest_getdateformatw_getdateformatw_neg1 -miscellaneous/GetDateFormatW/GetDateFormatW_neg2/paltest_getdateformatw_getdateformatw_neg2 -miscellaneous/GetDateFormatW/test1/paltest_getdateformatw_test1 miscellaneous/InterLockedExchangeAdd/test1/paltest_interlockedexchangeadd_test1 miscellaneous/IsBadCodePtr/test1/paltest_isbadcodeptr_test1 miscellaneous/IsBadReadPtr/test1/paltest_isbadreadptr_test1 @@ -141,9 +136,7 @@ miscellaneous/MessageBoxW/test1/paltest_messageboxw_test1 miscellaneous/MessageBoxW/test2/paltest_messageboxw_test2 miscellaneous/wsprintfW/test2/paltest_wsprintfw_test2 miscellaneous/wsprintfW/test7/paltest_wsprintfw_test7 -pal_specific/PAL_GetMachineConfigurationDirectoryW/test1/paltest_pal_getmachineconfigurationdirectoryw_test1 pal_specific/PAL_GetPALDirectoryW/test1/paltest_pal_getpaldirectoryw_test1 -pal_specific/PAL_GetUserConfigurationDirectoryW/test1/paltest_pal_getuserconfigurationdirectoryw_test1 pal_specific/PAL_GetUserTempDirectoryW/test1/paltest_pal_getusertempdirectoryw_test1 pal_specific/PAL_get_stderr/test1/paltest_pal_get_stderr_test1 pal_specific/PAL_get_stdin/test1/paltest_pal_get_stdin_test1 -- 2.34.1