diff options
author | Jim Ma <mazong1123@gmail.com> | 2017-08-08 04:25:25 +1200 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-08-07 09:25:25 -0700 |
commit | c56a6108fc4a06b214ecf1be8b9f1fc9d477dde7 (patch) | |
tree | 05194d410147bab96a18425e282d921f6e7963b8 | |
parent | 606fc4aae2fc2246a4c72db74d4862e57392a376 (diff) | |
download | coreclr-c56a6108fc4a06b214ecf1be8b9f1fc9d477dde7.tar.gz coreclr-c56a6108fc4a06b214ecf1be8b9f1fc9d477dde7.tar.bz2 coreclr-c56a6108fc4a06b214ecf1be8b9f1fc9d477dde7.zip |
Enable string format tests on Linux. (#13191)
Modified string format tests so that it can be supported on Linux.
Fix #11655
9 files changed, 26 insertions, 34 deletions
diff --git a/tests/src/CoreMangLib/cti/system/byte/bytetostring3.cs b/tests/src/CoreMangLib/cti/system/byte/bytetostring3.cs index 7418dc927f..28fde5c6ab 100644 --- a/tests/src/CoreMangLib/cti/system/byte/bytetostring3.cs +++ b/tests/src/CoreMangLib/cti/system/byte/bytetostring3.cs @@ -89,8 +89,8 @@ public class ByteToString3 TestLibrary.Utilities.CurrentCulture = CustomCulture; retVal &= VerifyToString("PostTest3", 128, "C", "1.28,000USD"); - retVal &= VerifyToString("PostTest4, default", 128, "E", TestLibrary.Utilities.IsWindows ? "1,280000E++002" : "1,280000E2"); - retVal &= VerifyToString("PostTest4, 4digits", 128, "E4", TestLibrary.Utilities.IsWindows ? "1,2800E++002" : "1,2800E2"); + retVal &= VerifyToString("PostTest4, default", 128, "E", "1,280000E++002"); + retVal &= VerifyToString("PostTest4, 4digits", 128, "E4", "1,2800E++002"); retVal &= VerifyToString("PostTest5", 128, "F", "128,000"); retVal &= VerifyToString("PostTest6", 128, "N", "1#28,000"); diff --git a/tests/src/CoreMangLib/cti/system/double/doubletostring3.cs b/tests/src/CoreMangLib/cti/system/double/doubletostring3.cs index f62253a0ff..9df90c9c22 100644 --- a/tests/src/CoreMangLib/cti/system/double/doubletostring3.cs +++ b/tests/src/CoreMangLib/cti/system/double/doubletostring3.cs @@ -77,14 +77,14 @@ public class DoubleToString3 retVal &= VerifyToString("PostTestG4", 0.123456789123000009123D, "G", "0,123456789123"); retVal &= VerifyToString("PostTestR1", Double.NaN, "R", "NaN"); - retVal &= VerifyToString("PostTestR2", 0.123456789123456789123D, "R", TestLibrary.Utilities.IsWindows ? "0,12345678912345678" : "0,123456789123457"); - retVal &= VerifyToString("PostTestR3", 0.123456789123459789D, "R", TestLibrary.Utilities.IsWindows ? "0,1234567891234598" : "0,12345678912346"); - retVal &= VerifyToString("PostTestR4", 0.123456789123000009123D, "R", TestLibrary.Utilities.IsWindows ? "0,12345678912300001" : "0,123456789123"); + retVal &= VerifyToString("PostTestR2", 0.123456789123456789123D, "R", "0,12345678912345678"); + retVal &= VerifyToString("PostTestR3", 0.123456789123459789D, "R", "0,1234567891234598"); + retVal &= VerifyToString("PostTestR4", 0.123456789123000009123D, "R", "0,12345678912300001"); retVal &= VerifyToString("PostTestE1", Double.NaN, "E", "NaN"); - retVal &= VerifyToString("PostTestE2", 0.123456789123456789123D, "E", TestLibrary.Utilities.IsWindows ? "1,234568E@001" : "1,234568E@1"); - retVal &= VerifyToString("PostTestE3", 0.123456789123459789D, "E", TestLibrary.Utilities.IsWindows ? "1,234568E@001" : "1,234568E@1"); - retVal &= VerifyToString("PostTestE4", 0.123456789123000009123D, "E", TestLibrary.Utilities.IsWindows ? "1,234568E@001" : "1,234568E@1"); + retVal &= VerifyToString("PostTestE2", 0.123456789123456789123D, "E", "1,234568E@001"); + retVal &= VerifyToString("PostTestE3", 0.123456789123459789D, "E", "1,234568E@001"); + retVal &= VerifyToString("PostTestE4", 0.123456789123000009123D, "E", "1,234568E@001"); TestLibrary.Utilities.CurrentCulture = CurrentCulture; diff --git a/tests/src/CoreMangLib/cti/system/double/doubletostring4.cs b/tests/src/CoreMangLib/cti/system/double/doubletostring4.cs index b32f3273d5..45df986cf8 100644 --- a/tests/src/CoreMangLib/cti/system/double/doubletostring4.cs +++ b/tests/src/CoreMangLib/cti/system/double/doubletostring4.cs @@ -73,14 +73,14 @@ public class DoubleToString3 retVal &= VerifyToString("PostTestG4", 0.123456789123000009123D, "G", "0,123456789123"); retVal &= VerifyToString("PostTestR1", Double.NaN, "R", "NaN"); - retVal &= VerifyToString("PostTestR2", 0.123456789123456789123D, "R", TestLibrary.Utilities.IsWindows ? "0,12345678912345678" : "0,123456789123457"); - retVal &= VerifyToString("PostTestR3", 0.123456789123459789D, "R", TestLibrary.Utilities.IsWindows ? "0,1234567891234598" : "0,12345678912346"); - retVal &= VerifyToString("PostTestR4", 0.123456789123000009123D, "R", TestLibrary.Utilities.IsWindows ? "0,12345678912300001" : "0,123456789123"); + retVal &= VerifyToString("PostTestR2", 0.123456789123456789123D, "R", "0,12345678912345678"); + retVal &= VerifyToString("PostTestR3", 0.123456789123459789D, "R", "0,1234567891234598"); + retVal &= VerifyToString("PostTestR4", 0.123456789123000009123D, "R", "0,12345678912300001"); retVal &= VerifyToString("PostTestE1", Double.NaN, "E", "NaN"); - retVal &= VerifyToString("PostTestE2", 0.123456789123456789123D, "E", TestLibrary.Utilities.IsWindows ? "1,234568E@001" : "1,234568E@1"); - retVal &= VerifyToString("PostTestE3", 0.123456789123459789D, "E", TestLibrary.Utilities.IsWindows ? "1,234568E@001" : "1,234568E@1"); - retVal &= VerifyToString("PostTestE4", 0.123456789123000009123D, "E", TestLibrary.Utilities.IsWindows ? "1,234568E@001" : "1,234568E@1"); + retVal &= VerifyToString("PostTestE2", 0.123456789123456789123D, "E", "1,234568E@001"); + retVal &= VerifyToString("PostTestE3", 0.123456789123459789D, "E", "1,234568E@001"); + retVal &= VerifyToString("PostTestE4", 0.123456789123000009123D, "E", "1,234568E@001"); TestLibrary.TestFramework.LogInformation("[Negative]"); retVal &= NegTest1(); diff --git a/tests/src/CoreMangLib/cti/system/int/int32tostring3.cs b/tests/src/CoreMangLib/cti/system/int/int32tostring3.cs index 436a520310..2e65962e36 100644 --- a/tests/src/CoreMangLib/cti/system/int/int32tostring3.cs +++ b/tests/src/CoreMangLib/cti/system/int/int32tostring3.cs @@ -114,7 +114,7 @@ public class Int32ToString3 retVal &= VerifyToString("PostTest4", -1, "d", "@1"); retVal &= VerifyToString("PostTest5", -00000765, "f", "@765,000"); retVal &= VerifyToString("PostTest6", -76500, "c", "USD@7.65.00,000"); - retVal &= VerifyToString("PostTest7", -1800000000, "e", TestLibrary.Utilities.IsWindows ? "@1,800000e++009" : "@1,800000e9"); + retVal &= VerifyToString("PostTest7", -1800000000, "e", "@1,800000e++009"); retVal &= VerifyToString("PostTest8", 1886000000, "n", "18#86#00#00#00,000"); retVal &= VerifyToString("PostTest9", -1987, "p", "@~198,700,0000"); diff --git a/tests/src/CoreMangLib/cti/system/int64/int64tostring3.cs b/tests/src/CoreMangLib/cti/system/int64/int64tostring3.cs index e4868254bf..f3e0cfd5a4 100644 --- a/tests/src/CoreMangLib/cti/system/int64/int64tostring3.cs +++ b/tests/src/CoreMangLib/cti/system/int64/int64tostring3.cs @@ -37,17 +37,17 @@ public class Int64ToString3 retVal &= PosTest(3, Int64.MaxValue, "Int64.MaxValue", "g", "9223372036854775807"); retVal &= PosTest(4, Int64.MaxValue, "Int64.MaxValue", "x", "7fffffffffffffff"); retVal &= PosTest(5, Int64.MaxValue, "Int64.MaxValue", "f", "9223372036854775807,000"); - retVal &= PosTest(6, Int64.MaxValue, "Int64.MaxValue", "E", TestLibrary.Utilities.IsWindows ? "9,223372E++018" : "9,223372E18"); + retVal &= PosTest(6, Int64.MaxValue, "Int64.MaxValue", "E", "9,223372E++018"); retVal &= PosTest(7, Int64.MaxValue, "Int64.MaxValue", "N", "9#22#33#72#03#68#54#77#58#07,000"); retVal &= PosTest(8, Int64.MaxValue, "Int64.MaxValue", "P", "922,337,203,685,477,580,700,0000~"); retVal &= PosTest(9, Int64.MaxValue, "Int64.MaxValue", "D", "9223372036854775807"); retVal &= PosTest(10, 00065536, "00065536", "G", "65536"); retVal &= PosTest(11, 00065536, "00065536", "P", "6,553,600,0000~"); - retVal &= PosTest(12, 00065536, "00065536", "E", TestLibrary.Utilities.IsWindows ? "6,553600E++004" : "6,553600E4"); + retVal &= PosTest(12, 00065536, "00065536", "E", "6,553600E++004"); retVal &= PosTest(13, 00065536, "00065536", string.Empty, "65536"); retVal &= PosTest(14, 00065536, "00065536", null, "65536"); retVal &= PosTest(15, -00065536, "-00065536", "P", "@~6,553,600,0000"); - retVal &= PosTest(16, -00065536, "-00065536", "E", TestLibrary.Utilities.IsWindows ? "@6,553600E++004" : "@6,553600E4"); + retVal &= PosTest(16, -00065536, "-00065536", "E", "@6,553600E++004"); TestLibrary.Utilities.CurrentCulture = CurrentCulture; diff --git a/tests/src/CoreMangLib/cti/system/uint16/uint16tostring3.cs b/tests/src/CoreMangLib/cti/system/uint16/uint16tostring3.cs index 80b1778c7a..fca5e5cd0f 100644 --- a/tests/src/CoreMangLib/cti/system/uint16/uint16tostring3.cs +++ b/tests/src/CoreMangLib/cti/system/uint16/uint16tostring3.cs @@ -56,9 +56,9 @@ public class UInt16ToString retVal &= DoPosTest("PosTest11: Value is UInt16.MaxValue integer, format is decimal \"D\".", "PosTest11", UInt16.MaxValue, "D", "65535"); retVal &= DoPosTest("PosTest12: Value is UInt16.MinValue integer, format is decimal \"D\".", "PosTest12", UInt16.MinValue, "D", "0"); - retVal &= DoPosTest("PosTest13: Value is UInt16 integer, format is decimal \"E\".", "PosTest13", 2351, "E", TestLibrary.Utilities.IsWindows ? "2,351000E++003" : "2,351000E3"); - retVal &= DoPosTest("PosTest14: Value is UInt16.MaxValue integer, format is decimal \"E\".", "PosTest14", UInt16.MaxValue, "E", TestLibrary.Utilities.IsWindows ? "6,553500E++004" : "6,553500E4"); - retVal &= DoPosTest("PosTest15: Value is UInt16.MinValue integer, format is decimal \"E\".", "PosTest15", UInt16.MinValue, "E", TestLibrary.Utilities.IsWindows ? "0,000000E++000" : "0,000000E0"); + retVal &= DoPosTest("PosTest13: Value is UInt16 integer, format is decimal \"E\".", "PosTest13", 2351, "E", "2,351000E++003"); + retVal &= DoPosTest("PosTest14: Value is UInt16.MaxValue integer, format is decimal \"E\".", "PosTest14", UInt16.MaxValue, "E", "6,553500E++004"); + retVal &= DoPosTest("PosTest15: Value is UInt16.MinValue integer, format is decimal \"E\".", "PosTest15", UInt16.MinValue, "E", "0,000000E++000"); retVal &= DoPosTest("PosTest16: Value is UInt16 integer, format is decimal \"F\".", "PosTest16", 2341, "F", "2341,000"); diff --git a/tests/src/CoreMangLib/cti/system/uint16/uint16tostring4.cs b/tests/src/CoreMangLib/cti/system/uint16/uint16tostring4.cs index 964a0be1fd..2a2a2c033b 100644 --- a/tests/src/CoreMangLib/cti/system/uint16/uint16tostring4.cs +++ b/tests/src/CoreMangLib/cti/system/uint16/uint16tostring4.cs @@ -54,9 +54,9 @@ public class UInt16ToString retVal &= DoPosTest("PosTest11: Value is UInt16.MaxValue integer, format is decimal \"D\".", "PosTest11", UInt16.MaxValue, "D", "65535", CustomNFI); retVal &= DoPosTest("PosTest12: Value is UInt16.MinValue integer, format is decimal \"D\".", "PosTest12", UInt16.MinValue, "D", "0", CustomNFI); - retVal &= DoPosTest("PosTest13: Value is UInt16 integer, format is decimal \"E\".", "PosTest13", 2351, "E", TestLibrary.Utilities.IsWindows ? "2,351000E++003" : "2,351000E3", CustomNFI); - retVal &= DoPosTest("PosTest14: Value is UInt16.MaxValue integer, format is decimal \"E\".", "PosTest14", UInt16.MaxValue, "E", TestLibrary.Utilities.IsWindows ? "6,553500E++004" : "6,553500E4", CustomNFI); - retVal &= DoPosTest("PosTest15: Value is UInt16.MinValue integer, format is decimal \"E\".", "PosTest15", UInt16.MinValue, "E", TestLibrary.Utilities.IsWindows ? "0,000000E++000" : "0,000000E0", CustomNFI); + retVal &= DoPosTest("PosTest13: Value is UInt16 integer, format is decimal \"E\".", "PosTest13", 2351, "E", "2,351000E++003", CustomNFI); + retVal &= DoPosTest("PosTest14: Value is UInt16.MaxValue integer, format is decimal \"E\".", "PosTest14", UInt16.MaxValue, "E", "6,553500E++004", CustomNFI); + retVal &= DoPosTest("PosTest15: Value is UInt16.MinValue integer, format is decimal \"E\".", "PosTest15", UInt16.MinValue, "E", "0,000000E++000", CustomNFI); retVal &= DoPosTest("PosTest16: Value is UInt16 integer, format is decimal \"F\".", "PosTest16", 2341, "F", "2341,000", CustomNFI); diff --git a/tests/src/CoreMangLib/cti/system/uint32/uint32tostring2.cs b/tests/src/CoreMangLib/cti/system/uint32/uint32tostring2.cs index e0ab4934f9..a60a999f4f 100644 --- a/tests/src/CoreMangLib/cti/system/uint32/uint32tostring2.cs +++ b/tests/src/CoreMangLib/cti/system/uint32/uint32tostring2.cs @@ -136,13 +136,13 @@ public class UInt32ToString2 retVal &= VerifyToString("PostTest3", UInt32.MinValue, "f", "0,000"); retVal &= VerifyToString("PostTest4", UInt32.MaxValue, "G", "4294967295"); retVal &= VerifyToString("PostTest5", UInt32.MaxValue, "f", "4294967295,000"); - retVal &= VerifyToString("PostTest6", UInt32.MaxValue, "E", TestLibrary.Utilities.IsWindows? "4,294967E++009" : "4,294967E9"); + retVal &= VerifyToString("PostTest6", UInt32.MaxValue, "E", "4,294967E++009"); retVal &= VerifyToString("PostTest7", UInt32.MaxValue, "N", "42#94#96#72#95,000"); retVal &= VerifyToString("PostTest8", UInt32.MaxValue, "P", "429,496,729,500,0000~"); retVal &= VerifyToString("PostTest9", UInt32.MaxValue, "D", "4294967295"); retVal &= VerifyToString("PostTest10", 00065536, "G", "65536"); retVal &= VerifyToString("PostTest11", 00065536, "P", "6,553,600,0000~"); - retVal &= VerifyToString("PostTest12", 00065536, "E", TestLibrary.Utilities.IsWindows? "6,553600E++004" : "6,553600E4"); + retVal &= VerifyToString("PostTest12", 00065536, "E", "6,553600E++004"); retVal &= VerifyToString("PostTest13", 00065536, String.Empty, "65536"); retVal &= VerifyToString("PostTest14", 00065536, null, "65536"); diff --git a/tests/testsUnsupportedOutsideWindows.txt b/tests/testsUnsupportedOutsideWindows.txt index 86fb31b929..8b4c3f8d36 100644 --- a/tests/testsUnsupportedOutsideWindows.txt +++ b/tests/testsUnsupportedOutsideWindows.txt @@ -114,23 +114,15 @@ baseservices/threading/waithandle/waitone/waitoneex1/waitoneex1.sh baseservices/threading/waithandle/waitone/waitoneex2/waitoneex2.sh baseservices/threading/waithandle/waitone/waitoneex3/waitoneex3.sh baseservices/threading/waithandle/waitone/waitoneex4/waitoneex4.sh -CoreMangLib/cti/system/byte/ByteToString3/ByteToString3.sh CoreMangLib/cti/system/convert/ConvertToInt32_4/ConvertToInt32_4.sh CoreMangLib/cti/system/datetime/DateTimeParseExact1/DateTimeParseExact1.sh CoreMangLib/cti/system/datetime/DateTimeParseExact2/DateTimeParseExact2.sh CoreMangLib/cti/system/datetime/DateTimeParseExact3/DateTimeParseExact3.sh CoreMangLib/cti/system/decimal/DecimalToInt32/DecimalToInt32.sh -CoreMangLib/cti/system/double/DoubleToString3/DoubleToString3.sh -CoreMangLib/cti/system/double/DoubleToString4/DoubleToString4.sh -CoreMangLib/cti/system/int/Int32ToString3/Int32ToString3.sh -CoreMangLib/cti/system/int64/Int64ToString3/Int64ToString3.sh CoreMangLib/cti/system/reflection/emit/DynMethodJumpStubTests/DynMethodJumpStubTests/DynMethodJumpStubTests.sh CoreMangLib/cti/system/string/StringCompare1/StringCompare1.sh CoreMangLib/cti/system/string/StringCompare15/StringCompare15.sh CoreMangLib/cti/system/string/StringCompare2/StringCompare2.sh -CoreMangLib/cti/system/uint16/UInt16ToString3/UInt16ToString3.sh -CoreMangLib/cti/system/uint16/UInt16ToString4/UInt16ToString4.sh -CoreMangLib/cti/system/uint32/UInt32ToString2/UInt32ToString2.sh CoreMangLib/system/collections/generic/hashset/Regression_Dev10_609271/Regression_Dev10_609271.sh CoreMangLib/system/collections/generic/hashset/Regression_Dev10_624201/Regression_Dev10_624201.sh Interop/MarshalAPI/GetNativeVariantForObject/GetNativeVariantForObject/GetNativeVariantForObject.sh |