summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-02-10 20:35:12 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-02-10 20:35:12 +0900
commit4b11dc566a5bbfa1378d6266525c281b028abcc8 (patch)
treeb48831a898906734f8884d08b6e18f1144ee2b82 /src/pal/tests/palsuite/c_runtime/_vsnprintf/test19
parentdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (diff)
downloadcoreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.gz
coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.bz2
coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.zip
Imported Upstream version 1.0.0.9910upstream/1.0.0.9910
Diffstat (limited to 'src/pal/tests/palsuite/c_runtime/_vsnprintf/test19')
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp103
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat14
3 files changed, 0 insertions, 136 deletions
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt
deleted file mode 100644
index 44b38902ef..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test19.cpp
-)
-
-add_executable(paltest_vsnprintf_test19
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnprintf_test19 coreclrpal)
-
-target_link_libraries(paltest_vsnprintf_test19
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp
deleted file mode 100644
index 211354bc3a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp
+++ /dev/null
@@ -1,103 +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: test19.c
-**
-** Purpose: Test #19 for the _vsnprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-#define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e)
-
-void DoArgumentPrecTest(char *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
-{
- char buf[256];
-
- Testvsnprintf(buf,256,formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- paramstr, formatstr, precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
-{
- char buf[256];
-
- Testvsnprintf(buf,256,formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- param, formatstr, precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
-
- DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat
deleted file mode 100644
index cda8966865..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/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 = _vsnprintf
-Name = Positive Test for _vsnprintf
-TYPE = DEFAULT
-EXE1 = test19
-Description
-= Tests the PAL implementation of the _vsnprintf function.
-= Tests _vsnprintf with argument specified precision.
-= This test is modeled after sprintf_s.