From: Aaron Robinson Date: Tue, 31 Jan 2023 01:08:50 +0000 (-0800) Subject: Narrow PAL tests for _vsnprintf_s (#81381) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~4331 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b57ba8c685ec64d45ff3ebce91c3ee14c4bf779;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Narrow PAL tests for _vsnprintf_s (#81381) The .NET version of _vsnprintf_s defers to the system provided printf so reducing the cases to only what is needed for truncating validation. --- diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp index 608fde5..4249f6e 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp @@ -28,18 +28,7 @@ PALTEST(c_runtime__vsnprintf_s_test10_paltest_vsnprintf_test10, "c_runtime/_vsnp } DoNumTest("foo %o", pos, "foo 52"); - DoNumTest("foo %lo", 0xFFFF, "foo 177777"); - DoNumTest("foo %ho", 0xFFFF, "foo 177777"); - DoNumTest("foo %3o", pos, "foo 52"); - DoNumTest("foo %-3o", pos, "foo 52 "); - DoNumTest("foo %.1o", pos, "foo 52"); - DoNumTest("foo %.3o", pos, "foo 052"); - DoNumTest("foo %03o", pos, "foo 052"); - DoNumTest("foo %#o", pos, "foo 052"); - DoNumTest("foo %+o", pos, "foo 52"); - DoNumTest("foo % o", pos, "foo 52"); - DoNumTest("foo %+o", neg, "foo 37777777726"); - DoNumTest("foo % o", neg, "foo 37777777726"); + DoNumTest("foo %o", neg, "foo 37777777726"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp index 1b8ee73..da7aef5 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp @@ -28,18 +28,7 @@ PALTEST(c_runtime__vsnprintf_s_test11_paltest_vsnprintf_test11, "c_runtime/_vsnp } DoNumTest("foo %u", pos, "foo 42"); - DoNumTest("foo %lu", 0xFFFF, "foo 65535"); - DoNumTest("foo %hu", 0xFFFF, "foo 65535"); - DoNumTest("foo %3u", pos, "foo 42"); - DoNumTest("foo %-3u", pos, "foo 42 "); - DoNumTest("foo %.1u", pos, "foo 42"); - DoNumTest("foo %.3u", pos, "foo 042"); - DoNumTest("foo %03u", pos, "foo 042"); - DoNumTest("foo %#u", pos, "foo 42"); - DoNumTest("foo %+u", pos, "foo 42"); - DoNumTest("foo % u", pos, "foo 42"); - DoNumTest("foo %+u", neg, "foo 4294967254"); - DoNumTest("foo % u", neg, "foo 4294967254"); + DoNumTest("foo %u", neg, "foo 4294967254"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp index 5509667..c21519b 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp @@ -29,18 +29,7 @@ PALTEST(c_runtime__vsnprintf_s_test12_paltest_vsnprintf_test12, "c_runtime/_vsnp } DoNumTest("foo %x", pos, "foo 1234ab"); - DoNumTest("foo %lx", pos, "foo 1234ab"); - DoNumTest("foo %hx", pos, "foo 34ab"); - DoNumTest("foo %7x", pos, "foo 1234ab"); - DoNumTest("foo %-7x", pos, "foo 1234ab "); - DoNumTest("foo %.1x", pos, "foo 1234ab"); - DoNumTest("foo %.7x", pos, "foo 01234ab"); - DoNumTest("foo %07x", pos, "foo 01234ab"); - DoNumTest("foo %#x", pos, "foo 0x1234ab"); - DoNumTest("foo %+x", pos, "foo 1234ab"); - DoNumTest("foo % x", pos, "foo 1234ab"); - DoNumTest("foo %+x", neg, "foo ffffffd6"); - DoNumTest("foo % x", neg, "foo ffffffd6"); + DoNumTest("foo %x", neg, "foo ffffffd6"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp index f75b2b4..dfb1187 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp @@ -29,18 +29,7 @@ PALTEST(c_runtime__vsnprintf_s_test13_paltest_vsnprintf_test13, "c_runtime/_vsnp } DoNumTest("foo %X", pos, "foo 1234AB"); - DoNumTest("foo %lX", pos, "foo 1234AB"); - DoNumTest("foo %hX", pos, "foo 34AB"); - DoNumTest("foo %7X", pos, "foo 1234AB"); - DoNumTest("foo %-7X", pos, "foo 1234AB "); - DoNumTest("foo %.1X", pos, "foo 1234AB"); - DoNumTest("foo %.7X", pos, "foo 01234AB"); - DoNumTest("foo %07X", pos, "foo 01234AB"); - DoNumTest("foo %#X", pos, "foo 0X1234AB"); - DoNumTest("foo %+X", pos, "foo 1234AB"); - DoNumTest("foo % X", pos, "foo 1234AB"); - DoNumTest("foo %+X", neg, "foo FFFFFFD6"); - DoNumTest("foo % X", neg, "foo FFFFFFD6"); + DoNumTest("foo %X", neg, "foo FFFFFFD6"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp index b38bd6a..c0af8ce 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp @@ -29,18 +29,7 @@ PALTEST(c_runtime__vsnprintf_s_test14_paltest_vsnprintf_test14, "c_runtime/_vsnp } DoDoubleTest("foo %e", val, "foo 2.560000e+002", "foo 2.560000e+02"); - DoDoubleTest("foo %le", val, "foo 2.560000e+002", "foo 2.560000e+02"); - DoDoubleTest("foo %he", val, "foo 2.560000e+002", "foo 2.560000e+02"); - DoDoubleTest("foo %14e", val, "foo 2.560000e+002", "foo 2.560000e+02"); - DoDoubleTest("foo %-14e", val, "foo 2.560000e+002 ", "foo 2.560000e+02 "); - DoDoubleTest("foo %.1e", val, "foo 2.6e+002", "foo 2.6e+02"); - DoDoubleTest("foo %.8e", val, "foo 2.56000000e+002", "foo 2.56000000e+02"); - DoDoubleTest("foo %014e", val, "foo 02.560000e+002", "foo 002.560000e+02"); - DoDoubleTest("foo %#e", val, "foo 2.560000e+002", "foo 2.560000e+02"); - DoDoubleTest("foo %+e", val, "foo +2.560000e+002", "foo +2.560000e+02"); - DoDoubleTest("foo % e", val, "foo 2.560000e+002", "foo 2.560000e+02"); - DoDoubleTest("foo %+e", neg, "foo -2.560000e+002", "foo -2.560000e+02"); - DoDoubleTest("foo % e", neg, "foo -2.560000e+002", "foo -2.560000e+02"); + DoDoubleTest("foo %e", neg, "foo -2.560000e+002", "foo -2.560000e+02"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp index 641ccff..5611c7a 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp @@ -28,18 +28,8 @@ PALTEST(c_runtime__vsnprintf_s_test15_paltest_vsnprintf_test15, "c_runtime/_vsnp } DoDoubleTest("foo %E", val, "foo 2.560000E+002", "foo 2.560000E+02"); - DoDoubleTest("foo %lE", val, "foo 2.560000E+002", "foo 2.560000E+02"); - DoDoubleTest("foo %hE", val, "foo 2.560000E+002", "foo 2.560000E+02"); - DoDoubleTest("foo %14E", val, "foo 2.560000E+002", "foo 2.560000E+02"); - DoDoubleTest("foo %-14E", val, "foo 2.560000E+002 ", "foo 2.560000E+02 "); - DoDoubleTest("foo %.1E", val, "foo 2.6E+002", "foo 2.6E+02"); - DoDoubleTest("foo %.8E", val, "foo 2.56000000E+002", "foo 2.56000000E+02"); - DoDoubleTest("foo %014E", val, "foo 02.560000E+002", "foo 002.560000E+02"); - DoDoubleTest("foo %#E", val, "foo 2.560000E+002", "foo 2.560000E+02"); - DoDoubleTest("foo %+E", val, "foo +2.560000E+002", "foo +2.560000E+02"); - DoDoubleTest("foo % E", val, "foo 2.560000E+002", "foo 2.560000E+02"); - DoDoubleTest("foo %+E", neg, "foo -2.560000E+002", "foo -2.560000E+02"); - DoDoubleTest("foo % E", neg, "foo -2.560000E+002", "foo -2.560000E+02"); + DoDoubleTest("foo %E", neg, "foo -2.560000E+002", "foo -2.560000E+02"); + PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp index 6117d28..3f211b4 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp @@ -28,18 +28,8 @@ PALTEST(c_runtime__vsnprintf_s_test16_paltest_vsnprintf_test16, "c_runtime/_vsnp } DoDoubleTest("foo %f", val, "foo 2560.001000", "foo 2560.001000"); - DoDoubleTest("foo %lf", val, "foo 2560.001000", "foo 2560.001000"); - DoDoubleTest("foo %hf", val, "foo 2560.001000", "foo 2560.001000"); - DoDoubleTest("foo %12f", val, "foo 2560.001000", "foo 2560.001000"); - DoDoubleTest("foo %-12f", val, "foo 2560.001000 ", "foo 2560.001000 "); - DoDoubleTest("foo %.1f", val, "foo 2560.0", "foo 2560.0"); - DoDoubleTest("foo %.8f", val, "foo 2560.00100000", "foo 2560.00100000"); - DoDoubleTest("foo %012f", val, "foo 02560.001000", "foo 02560.001000"); - DoDoubleTest("foo %#f", val, "foo 2560.001000", "foo 2560.001000"); - DoDoubleTest("foo %+f", val, "foo +2560.001000", "foo +2560.001000"); - DoDoubleTest("foo % f", val, "foo 2560.001000", "foo 2560.001000"); - DoDoubleTest("foo %+f", neg, "foo -2560.001000", "foo -2560.001000"); - DoDoubleTest("foo % f", neg, "foo -2560.001000", "foo -2560.001000"); + DoDoubleTest("foo %f", neg, "foo -2560.001000", "foo -2560.001000"); + PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp index 6153a58..5510896 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp @@ -28,19 +28,7 @@ PALTEST(c_runtime__vsnprintf_s_test17_paltest_vsnprintf_test17, "c_runtime/_vsnp } DoDoubleTest("foo %g", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %lg", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %hg", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %5g", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %-5g", val, "foo 2560 ", "foo 2560 "); - DoDoubleTest("foo %.1g", val, "foo 3e+003", "foo 3e+03"); - DoDoubleTest("foo %.2g", val, "foo 2.6e+003", "foo 2.6e+03"); - DoDoubleTest("foo %.12g", val, "foo 2560.001", "foo 2560.001"); - DoDoubleTest("foo %06g", val, "foo 002560", "foo 002560"); - DoDoubleTest("foo %#g", val, "foo 2560.00", "foo 2560.00"); - DoDoubleTest("foo %+g", val, "foo +2560", "foo +2560"); - DoDoubleTest("foo % g", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %+g", neg, "foo -2560", "foo -2560"); - DoDoubleTest("foo % g", neg, "foo -2560", "foo -2560"); + DoDoubleTest("foo %g", neg, "foo -2560", "foo -2560"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp index 4ac3757..d6891f51 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp @@ -28,19 +28,7 @@ PALTEST(c_runtime__vsnprintf_s_test18_paltest_vsnprintf_test18, "c_runtime/_vsnp } DoDoubleTest("foo %G", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %lG", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %hG", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %5G", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %-5G", val, "foo 2560 ", "foo 2560 "); - DoDoubleTest("foo %.1G", val, "foo 3E+003", "foo 3E+03"); - DoDoubleTest("foo %.2G", val, "foo 2.6E+003", "foo 2.6E+03"); - DoDoubleTest("foo %.12G", val, "foo 2560.001", "foo 2560.001"); - DoDoubleTest("foo %06G", val, "foo 002560", "foo 002560"); - DoDoubleTest("foo %#G", val, "foo 2560.00", "foo 2560.00"); - DoDoubleTest("foo %+G", val, "foo +2560", "foo +2560"); - DoDoubleTest("foo % G", val, "foo 2560", "foo 2560"); - DoDoubleTest("foo %+G", neg, "foo -2560", "foo -2560"); - DoDoubleTest("foo % G", neg, "foo -2560", "foo -2560"); + DoDoubleTest("foo %G", neg, "foo -2560", "foo -2560"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp index 00d97df..d0c85ed 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp @@ -24,10 +24,6 @@ PALTEST(c_runtime__vsnprintf_s_test2_paltest_vsnprintf_test2, "c_runtime/_vsnpri } DoStrTest("foo %s", "bar", "foo bar"); - DoStrTest("foo %5s", "bar", "foo bar"); - DoStrTest("foo %.2s", "bar", "foo ba"); - DoStrTest("foo %5.2s", "bar", "foo ba"); - DoStrTest("foo %-5s", "bar", "foo bar "); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp index 9ebc6f1..5d8b570 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp @@ -25,13 +25,6 @@ PALTEST(c_runtime__vsnprintf_s_test6_paltest_vsnprintf_test6, "c_runtime/_vsnpri } DoCharTest("foo %c", 'b', "foo b"); - DoCharTest("foo %hc", 'b', "foo b"); - DoCharTest("foo %Lc", 'b', "foo b"); - DoCharTest("foo %5c", 'b', "foo b"); - DoCharTest("foo %.0c", 'b', "foo b"); - DoCharTest("foo %-5c", 'b', "foo b "); - DoCharTest("foo % c", 'b', "foo b"); - DoCharTest("foo %#c", 'b', "foo b"); PAL_Terminate(); return PASS; diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp index 7854c70..ff1bbfc 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp @@ -29,18 +29,7 @@ PALTEST(c_runtime__vsnprintf_s_test8_paltest_vsnprintf_test8, "c_runtime/_vsnpri } DoNumTest("foo %d", pos, "foo 42"); - DoNumTest("foo %ld", 0xFFFF, "foo 65535"); - DoNumTest("foo %hd", 0xFFFF, "foo -1"); - DoNumTest("foo %3d", pos, "foo 42"); - DoNumTest("foo %-3d", pos, "foo 42 "); - DoNumTest("foo %.1d", pos, "foo 42"); - DoNumTest("foo %.3d", pos, "foo 042"); - DoNumTest("foo %03d", pos, "foo 042"); - DoNumTest("foo %#d", pos, "foo 42"); - DoNumTest("foo %+d", pos, "foo +42"); - DoNumTest("foo % d", pos, "foo 42"); - DoNumTest("foo %+d", neg, "foo -42"); - DoNumTest("foo % d", neg, "foo -42"); + DoNumTest("foo %d", neg, "foo -42"); PAL_Terminate(); diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp index 7932557..173c16a 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp @@ -29,18 +29,7 @@ PALTEST(c_runtime__vsnprintf_s_test9_paltest_vsnprintf_test9, "c_runtime/_vsnpri } DoNumTest("foo %i", pos, "foo 42"); - DoNumTest("foo %li", 0xFFFF, "foo 65535"); - DoNumTest("foo %hi", 0xFFFF, "foo -1"); - DoNumTest("foo %3i", pos, "foo 42"); - DoNumTest("foo %-3i", pos, "foo 42 "); - DoNumTest("foo %.1i", pos, "foo 42"); - DoNumTest("foo %.3i", pos, "foo 042"); - DoNumTest("foo %03i", pos, "foo 042"); - DoNumTest("foo %#i", pos, "foo 42"); - DoNumTest("foo %+i", pos, "foo +42"); - DoNumTest("foo % i", pos, "foo 42"); - DoNumTest("foo %+i", neg, "foo -42"); - DoNumTest("foo % i", neg, "foo -42"); + DoNumTest("foo %i", neg, "foo -42"); PAL_Terminate(); return PASS;