From 79512135c177ef39bfcf5c61276596d3d5086b7b Mon Sep 17 00:00:00 2001 From: mazong1123 Date: Mon, 24 Jul 2017 17:15:26 +1200 Subject: [PATCH] Removed _ecvt tests. Fix #10651 --- src/classlibnative/bcltype/number.cpp | 2 +- src/pal/inc/pal.h | 1 - .../tests/palsuite/c_runtime/CMakeLists.txt | 1 - .../palsuite/c_runtime/_ecvt/CMakeLists.txt | 4 - .../c_runtime/_ecvt/test1/CMakeLists.txt | 17 --- .../palsuite/c_runtime/_ecvt/test1/test1.cpp | 136 ------------------ .../c_runtime/_ecvt/test1/testinfo.dat | 14 -- .../palsuite/paltestlist_to_be_reviewed.txt | 1 - src/pal/tests/palsuite/palverify.dat | 1 - 9 files changed, 1 insertion(+), 176 deletions(-) delete mode 100644 src/pal/tests/palsuite/c_runtime/_ecvt/CMakeLists.txt delete mode 100644 src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt delete mode 100644 src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.cpp delete mode 100644 src/pal/tests/palsuite/c_runtime/_ecvt/test1/testinfo.dat diff --git a/src/classlibnative/bcltype/number.cpp b/src/classlibnative/bcltype/number.cpp index 24873d085f3c..df7919484e73 100644 --- a/src/classlibnative/bcltype/number.cpp +++ b/src/classlibnative/bcltype/number.cpp @@ -158,7 +158,7 @@ void ecvt( double value, int count, int* dec, int* sign, wchar_t* digits ) _ASSERTE(dec != nullptr && sign != nullptr && digits != nullptr); - // The caller of _ecvt should already checked the Infinity and NAN values. + // The caller of ecvt should already checked the Infinity and NAN values. _ASSERTE(((FPDOUBLE*)&value)->exp != 0x7ff); // Shortcut for zero. diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index a07d665b1f7f..04a257d261ca 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -5287,7 +5287,6 @@ PALIMPORT char * __cdecl _strlwr(char *); PALIMPORT int __cdecl _stricmp(const char *, const char *); PALIMPORT int __cdecl vsprintf_s(char *, size_t, const char *, va_list); PALIMPORT char * __cdecl _gcvt_s(char *, int, double, int); -PALIMPORT char * __cdecl _ecvt(double, int, int *, int *); PALIMPORT int __cdecl __iscsym(int); PALIMPORT unsigned char * __cdecl _mbsinc(const unsigned char *); PALIMPORT unsigned char * __cdecl _mbsninc(const unsigned char *, size_t); diff --git a/src/pal/tests/palsuite/c_runtime/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/CMakeLists.txt index 7a6b2cd9194f..64ac174a9774 100644 --- a/src/pal/tests/palsuite/c_runtime/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/CMakeLists.txt @@ -139,7 +139,6 @@ add_subdirectory(wcstol) add_subdirectory(wcstoul) add_subdirectory(wprintf) add_subdirectory(_alloca) -add_subdirectory(_ecvt) add_subdirectory(_fdopen) add_subdirectory(_finite) add_subdirectory(_finitef) diff --git a/src/pal/tests/palsuite/c_runtime/_ecvt/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_ecvt/CMakeLists.txt deleted file mode 100644 index f6aa0cb2d9da..000000000000 --- a/src/pal/tests/palsuite/c_runtime/_ecvt/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) - diff --git a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt deleted file mode 100644 index 152271cf5989..000000000000 --- a/src/pal/tests/palsuite/c_runtime/_ecvt/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 - test1.cpp -) - -add_executable(paltest_ecvt_test1 - ${SOURCES} -) - -add_dependencies(paltest_ecvt_test1 coreclrpal) - -target_link_libraries(paltest_ecvt_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.cpp deleted file mode 100644 index b36a83b29d98..000000000000 --- a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.cpp +++ /dev/null @@ -1,136 +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: c_runtime/_ecvt/test1/test1.c -** -** Purpose: Call the _ecvt function on a number of cases. Check that it -** handles negatives, positives and double bounds correctly. Also check that -** the 'digit' specification works. -** -** -**===================================================================*/ - -#include - -#define INT64_TO_DOUBLE(a) (*(double*)&a) - -INT64 NaN = 0x7ff8000000000000; -INT64 NegativeInfinity = 0xfff0000000000000; -INT64 NegativeSmall = 0x8000000000000001; -INT64 PositiveInfinity = 0x7ff0000000000000; -INT64 PositiveSmall = 0x0000000000000001; - -struct testCase -{ - double value; /* number to be converted */ - int precision; /* number of digits to be stored */ - int decimal; /* (expected) decimal point position for stored - * number */ - int sign; /* (expected) return value */ - char expResult[256]; /* (expected) character array to be returned - * NOTE: this necessarily limits precision - * to a value between 0 and 255 */ - char bsdExpResult[256]; /* (expected) character array to be returned - * NOTE: this necessarily limits precision - * to a value between 0 and 255 */ -}; - -int __cdecl main(int argc, char **argv) -{ - char *result; - int testDecimal; - int testSign; - int i=0; - - struct testCase testCases[] = - { - /* odd ball values */ - {INT64_TO_DOUBLE(NaN), 7, 1, 0, "1#QNAN0" }, - /* positive values */ - {0, 0, 0, 0, ""}, - {INT64_TO_DOUBLE(PositiveSmall), 17, -323, 0, - "49406564584124654"}, - {.00123, 3, -2, 0, "123"}, - {.123, 3, 0, 0, "123"}, - {123, 3, 3, 0, "123"}, - {3.1415926535, 9, 1, 0, "314159265"}, - {3.1415926535, 10, 1, 0, "3141592654"}, - {3.1415926535, 11, 1, 0, "31415926535"}, - {3.1415926535, 12, 1, 0, "314159265350"}, - {184467444073709570000.0, 21, 21, 0, "184467444073709570000", - "184467444073709568000" }, - {184467444073709570000.0, 22, 21, 0, "1844674440737095700000", - "1844674440737095680000" }, - {INT64_TO_DOUBLE(PositiveInfinity), 7, 1, 0, "1#INF00" }, - /* negative values */ - {-0, 0, 0, 0, ""}, - {INT64_TO_DOUBLE(NegativeSmall), 17, -323, 1, - "49406564584124654"}, - {-.00123, 3, -2, 1, "123"}, - {-.123, 3, 0, 1, "123"}, - {-123, 3, 3, 1, "123"}, - {-3.1415926535, 9, 1, 1, "314159265"}, - {-3.1415926535, 10, 1, 1, "3141592654"}, - {-3.1415926535, 11, 1, 1, "31415926535"}, - {-3.1415926535, 12, 1, 1, "314159265350"}, - {-184467444073709570000.0, 21, 21, 1, "184467444073709570000", - "184467444073709568000" }, - {-184467444073709570000.0, 22, 21, 1, "1844674440737095700000", - "1844674440737095680000" }, - {INT64_TO_DOUBLE(NegativeInfinity), 7, 1, 1, "1#INF00"} - - }; - - if (0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* Loop through each case. Call _ecvt on each test case and check the - result. - */ - - // Disabled the tests as we have a new implementation of ecvt. - /*for(i = 0; i < sizeof(testCases) / sizeof(struct testCase); i++) - { - result = _ecvt(testCases[i].value, - testCases[i].precision, - &testDecimal, - &testSign); - - if (( strcmp(testCases[i].expResult, result) != 0 && - strcmp(testCases[i].bsdExpResult, result) != 0 ) || - - ( testCases[i].sign != testSign ) || - ( testCases[i].decimal != testDecimal )) - - { - Fail("PALSUITE ERROR: Test %d\n" - "-----------------------\n" - "testCases[i].value = '%f'\n" - "testCases[i].precision = '%d'\n" - "testCases[i].decimal = '%d'\n" - "testCases[i].sign = '%d'\n" - "testCases[i].expResult = '%s'\n" - "result = '%s'\n" - "testDecimal = '%d'\n" - "testSign = '%d'\n\n", - i, - testCases[i].value, - testCases[i].precision, - testCases[i].decimal, - testCases[i].sign, - testCases[i].expResult, - result, - testDecimal, - testSign); - } - - }*/ - - PAL_Terminate(); - return PASS; -} diff --git a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_ecvt/test1/testinfo.dat deleted file mode 100644 index 12e7292ec77b..000000000000 --- a/src/pal/tests/palsuite/c_runtime/_ecvt/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 = C Runtime -Function = _ecvt -Name = Call _ecvt on normal values, negatives, exponents and hex digits. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the _ecvt function on a number of cases. Check that it -= handles negatives, positives and double bounds correctly. Also check that -= the 'digit' specification works. diff --git a/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt b/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt index 3f9469d2546d..e0baef1fc2a7 100644 --- a/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt +++ b/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt @@ -22,7 +22,6 @@ c_runtime/vprintf/test1/paltest_vprintf_test1 c_runtime/vswprintf/test2/paltest_vswprintf_test2 c_runtime/vswprintf/test7/paltest_vswprintf_test7 c_runtime/wprintf/test2/paltest_wprintf_test2 -c_runtime/_ecvt/test1/paltest_ecvt_test1 c_runtime/_gcvt/test1/paltest_gcvt_test1 c_runtime/_gcvt/test2/paltest_gcvt_test2 c_runtime/_getw/test1/paltest_getw_test1 diff --git a/src/pal/tests/palsuite/palverify.dat b/src/pal/tests/palsuite/palverify.dat index d4cb3110100b..6be37ae27562 100644 --- a/src/pal/tests/palsuite/palverify.dat +++ b/src/pal/tests/palsuite/palverify.dat @@ -4,7 +4,6 @@ c_runtime/__iscsym/test1,1 c_runtime/_alloca/test1,1 -c_runtime/_ecvt/test1,1 c_runtime/_fdopen/test1,1 c_runtime/_finite/test1,1 c_runtime/_finitef/test1,1