diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
commit | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch) | |
tree | e5435159cd1bf0519276363a6fe1663d1721bed3 /src/pal/tests/palsuite/c_runtime/_itow | |
parent | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff) | |
download | coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2 coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip |
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'src/pal/tests/palsuite/c_runtime/_itow')
-rw-r--r-- | src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_itow/test1/test1.c) | 13 | ||||
-rw-r--r-- | src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat | 6 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt index bd37f31216..2c5d57bd34 100644 --- a/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt +++ b/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(SOURCES - test1.c + test1.cpp ) add_executable(paltest_itow_test1 diff --git a/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp index 745ce4acaa..01f32f2520 100644 --- a/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.c +++ b/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp @@ -6,7 +6,7 @@ ** ** Source: test1.c ** -** Purpose: Tests the PAL implementation of the _itow function. +** Purpose: Tests the PAL implementation of the _itow_s function. ** Test a number of ints with different radix on each, ** to ensure that the string returned is correct. ** @@ -65,19 +65,18 @@ int __cdecl main(int argc, char **argv) for(i = 0; i < sizeof(testCases) / sizeof(struct testCase); i++) { - pResult = _itow(testCases[i].value,result,testCases[i].radix); + errno_t err = _itow_s(testCases[i].value, result, sizeof(result) / sizeof(result[0]), testCases[i].radix); - if(pResult != &result[0]) + if(err != 0) { - Fail("ERROR: _itow didn't return a correct pointer to the " - "newly formed string.\n"); + Fail("ERROR: _itow_s didn't return success, error code %d.\n", err); } - if (0 != wcscmp(testCases[i].CorrectResult,pResult)) + if (0 != wcscmp(testCases[i].CorrectResult, result)) { PrintResult = convertC(pResult); PrintCorrectResult = convertC(testCases[i].CorrectResult); - Fail("ERROR: _itow was called on %i, returning the string %s " + Fail("ERROR: _itow_s was called on %i, returning the string %s " "when it should have returned the string %s.\n" , testCases[i].value, PrintResult, PrintCorrectResult); } diff --git a/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat index 394c34dff3..91f0e62e09 100644 --- a/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat +++ b/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat @@ -4,12 +4,12 @@ Version = 1.0 Section = C Runtime -Function = _itow -Name = Positive Test for _itow +Function = _itow_s +Name = Positive Test for _itow_s TYPE = DEFAULT EXE1 = test1 Description -= Tests the PAL implementation of the _itow function. += Tests the PAL implementation of the _itow_s function. = Test a number of ints with different radix on each, to ensure that the = string returned is correct. |