From 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Wed, 23 Nov 2016 19:09:09 +0900 Subject: Imported Upstream version 1.1.0 --- .../c_runtime/swscanf/test17/CMakeLists.txt | 19 +++++++++++ .../palsuite/c_runtime/swscanf/test17/test17.c | 37 ++++++++++++++++++++++ .../palsuite/c_runtime/swscanf/test17/testinfo.dat | 12 +++++++ 3 files changed, 68 insertions(+) create mode 100644 src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt create mode 100644 src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.c create mode 100644 src/pal/tests/palsuite/c_runtime/swscanf/test17/testinfo.dat (limited to 'src/pal/tests/palsuite/c_runtime/swscanf/test17') diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt new file mode 100644 index 0000000000..c224f5d9a6 --- /dev/null +++ b/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 2.8.12.2) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(SOURCES + test17.c +) + +add_executable(paltest_swscanf_test17 + ${SOURCES} +) + +add_dependencies(paltest_swscanf_test17 coreclrpal) + +target_link_libraries(paltest_swscanf_test17 + pthread + m + coreclrpal +) diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.c new file mode 100644 index 0000000000..9023f7020a --- /dev/null +++ b/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.c @@ -0,0 +1,37 @@ +// 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: test17.c +** +** Purpose: Tests swscanf with floats (compact notation, uppercase) +** +** +**==========================================================================*/ + + + +#include +#include "../swscanf.h" + +int __cdecl main(int argc, char *argv[]) +{ + if (PAL_Initialize(argc, argv)) + { + return FAIL; + } + + DoFloatTest(convert("123.0"), convert("%G"), 123.0f); + DoFloatTest(convert("123.0"), convert("%2G"), 12.0f); + DoFloatTest(convert("10E1"), convert("%G"), 100.0f); + DoFloatTest(convert("-12.01e-2"), convert("%G"), -0.1201f); + DoFloatTest(convert("+12.01e-2"), convert("%G"), 0.1201f); + DoFloatTest(convert("-12.01e+2"), convert("%G"), -1201.0f); + DoFloatTest(convert("+12.01e+2"), convert("%G"), 1201.0f); + DoFloatTest(convert("1234567890.0123456789f"), convert("%G"), 1234567936); + + PAL_Terminate(); + return PASS; +} diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/swscanf/test17/testinfo.dat new file mode 100644 index 0000000000..f0489dfa41 --- /dev/null +++ b/src/pal/tests/palsuite/c_runtime/swscanf/test17/testinfo.dat @@ -0,0 +1,12 @@ +# 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 = swscanf +Name = Positive Test for swscanf +TYPE = DEFAULT +EXE1 = test17 +Description += Tests swscanf with floats (compact notation, uppercase) -- cgit v1.2.3