From 7b84b60a8e89388b1cc54f63267b34091a4346f7 Mon Sep 17 00:00:00 2001 From: Lluis Sanchez Date: Tue, 23 Mar 2004 18:30:34 +0000 Subject: [PATCH] * ByteTest.cs, Int32Test.cs, Int64Test, SingleFormatterTest.cs, UInt16Test.cs, UInt32Test.cs, UInt64Test.cs: Made some tests depend on the current culture. svn path=/trunk/mcs/; revision=24481 --- mcs/class/corlib/Test/System/ByteTest.cs | 13 ++- mcs/class/corlib/Test/System/ChangeLog | 6 + mcs/class/corlib/Test/System/Int32Test.cs | 9 ++ mcs/class/corlib/Test/System/Int64Test.cs | 10 ++ .../corlib/Test/System/SingleFormatterTest.cs | 107 ++++++++++-------- mcs/class/corlib/Test/System/UInt16Test.cs | 13 ++- mcs/class/corlib/Test/System/UInt32Test.cs | 13 ++- mcs/class/corlib/Test/System/UInt64Test.cs | 13 ++- 8 files changed, 126 insertions(+), 58 deletions(-) diff --git a/mcs/class/corlib/Test/System/ByteTest.cs b/mcs/class/corlib/Test/System/ByteTest.cs index 75329dce2d2..ab909c0161a 100644 --- a/mcs/class/corlib/Test/System/ByteTest.cs +++ b/mcs/class/corlib/Test/System/ByteTest.cs @@ -69,17 +69,22 @@ public class ByteTest : Assertion Results2[0] = "255" + sep + "00000 " + csym; break; } + sep = NumberFormatInfo.CurrentInfo.NumberDecimalSeparator; + string decimals = new String ('0', NumberFormatInfo.CurrentInfo.NumberDecimalDigits); + string perPattern = new string[] {"n %","n%","%n"} [NumberFormatInfo.CurrentInfo.PercentPositivePattern]; + Results1[2] = "0" + sep + "000000e+000"; - Results1[3] = "0" + sep + "00"; - Results1[5] = "0" + sep + "00"; - Results1[6] = "0" + sep + "00 %"; + Results1[3] = "0" + sep + decimals; + Results1[5] = "0" + sep + decimals; + Results1[6] = perPattern.Replace ("n","0" + sep + "00"); + Results2[2] = "2" + sep + "55000e+002"; Results2[3] = "255" + sep + "00000"; Results2[3] = "255" + sep + "00000"; Results2[5] = "255" + sep + "00000"; string gsep = NumberFormatInfo.CurrentInfo.NumberGroupSeparator; - Results2[6] = "25" + gsep + "500" + sep + "00000 %"; + Results2[6] = perPattern.Replace ("n","25" + gsep + "500" + sep + "00000"); } public void TestMinMax() diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog index 2a994ff04ef..89598241e3c 100644 --- a/mcs/class/corlib/Test/System/ChangeLog +++ b/mcs/class/corlib/Test/System/ChangeLog @@ -1,3 +1,9 @@ +2004-03-23 Lluis Sanchez Gual + + * ByteTest.cs, Int32Test.cs, Int64Test, SingleFormatterTest.cs, + UInt16Test.cs, UInt32Test.cs, UInt64Test.cs: Made some tests depend on the + current culture. + 2004-03-22 Dick Porter * DateTimeTest.cs (System): Test the MM-dd-yyyy date parse format. diff --git a/mcs/class/corlib/Test/System/Int32Test.cs b/mcs/class/corlib/Test/System/Int32Test.cs index a71ac21114c..fd0c4a89492 100644 --- a/mcs/class/corlib/Test/System/Int32Test.cs +++ b/mcs/class/corlib/Test/System/Int32Test.cs @@ -49,8 +49,17 @@ public class Int32Test : TestCase Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false); // We can't initialize this until we set the culture. + + string decimals = new String ('0', NumberFormatInfo.CurrentInfo.NumberDecimalDigits); + string perPattern = new string[] {"n %","n%","%n"} [NumberFormatInfo.CurrentInfo.PercentPositivePattern]; + Results1 [0] = "("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,648.00)"; + Results1 [3] = "-2147483648." + decimals; + Results1 [5] = "-2,147,483,648." + decimals; + Results1 [6] = perPattern.Replace ("n","-214,748,364,800.00"); + Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,647.00000"; + Results2 [6] = perPattern.Replace ("n","214,748,364,700.00000"); } protected override void TearDown() diff --git a/mcs/class/corlib/Test/System/Int64Test.cs b/mcs/class/corlib/Test/System/Int64Test.cs index 0ba833039c4..77e7d225364 100644 --- a/mcs/class/corlib/Test/System/Int64Test.cs +++ b/mcs/class/corlib/Test/System/Int64Test.cs @@ -74,8 +74,18 @@ public class Int64Test : TestCase int cdd = NumberFormatInfo.CurrentInfo.CurrencyDecimalDigits; string csym = NumberFormatInfo.CurrentInfo.CurrencySymbol; string csuffix = (cdd > 0 ? "." : "").PadRight(cdd + (cdd > 0 ? 1 : 0), '0'); + + string decimals = new String ('0', NumberFormatInfo.CurrentInfo.NumberDecimalDigits); + string perPattern = new string[] {"n %","n%","%n"} [NumberFormatInfo.CurrentInfo.PercentPositivePattern]; + Results1[0] = "(" + csym + "9,223,372,036,854,775,808" + csuffix + ")"; + Results1[3] = "-9223372036854775808." + decimals; + Results1[5] = "-9,223,372,036,854,775,808." + decimals; + Results1[6] = perPattern.Replace ("n","-922,337,203,685,477,580,800.00"); + Results2[0] = csym + "9,223,372,036,854,775,807.00000"; + Results2[6] = perPattern.Replace ("n","922,337,203,685,477,580,700.00000"); + NfiUser = new NumberFormatInfo(); NfiUser.CurrencyDecimalDigits = 3; NfiUser.CurrencyDecimalSeparator = ":"; diff --git a/mcs/class/corlib/Test/System/SingleFormatterTest.cs b/mcs/class/corlib/Test/System/SingleFormatterTest.cs index 8995823e83d..66a064d783f 100644 --- a/mcs/class/corlib/Test/System/SingleFormatterTest.cs +++ b/mcs/class/corlib/Test/System/SingleFormatterTest.cs @@ -24,6 +24,8 @@ namespace MonoTests.System { EnUs.NumberFormat.CurrencyDecimalSeparator = "."; EnUs.NumberFormat.NumberGroupSeparator = ","; EnUs.NumberFormat.NumberNegativePattern = 1; // -1 = -1 + EnUs.NumberFormat.NumberDecimalDigits = 2; + //Set this culture for the current thread. Thread.CurrentThread.CurrentCulture = EnUs; @@ -61,6 +63,15 @@ namespace MonoTests.System { Assertion.AssertEquals ("SngF #" + TestNumber, ExpectedResult, Number.ToString(Format)); } + string GetPercent (string s) + { + switch (NumberFormatInfo.CurrentInfo.PercentPositivePattern) { + case 0: return s + " %"; + case 1: return s + "%"; + default: return "%" + s; + } + } + [Test] public void TestFormatStrings() { @@ -124,18 +135,18 @@ namespace MonoTests.System { FormatStringTest (57, 121212F, "N8", "121,212.00000000"); FormatStringTest (58, 121212F, "N9", "121,212.000000000"); FormatStringTest (59, 121212F, "N67", "121,212.0000000000000000000000000000000000000000000000000000000000000000000"); - FormatStringTest (60, 121212F, "P", "12,121,200.00 %"); - FormatStringTest (61, 121212F, "P0", "12,121,200 %"); - FormatStringTest (62, 121212F, "P1", "12,121,200.0 %"); - FormatStringTest (63, 121212F, "P2", "12,121,200.00 %"); - FormatStringTest (64, 121212F, "P3", "12,121,200.000 %"); - FormatStringTest (65, 121212F, "P4", "12,121,200.0000 %"); - FormatStringTest (66, 121212F, "P5", "12,121,200.00000 %"); - FormatStringTest (67, 121212F, "P6", "12,121,200.000000 %"); - FormatStringTest (68, 121212F, "P7", "12,121,200.0000000 %"); - FormatStringTest (69, 121212F, "P8", "12,121,200.00000000 %"); - FormatStringTest (70, 121212F, "P9", "12,121,200.000000000 %"); - FormatStringTest (71, 121212F, "P67", "12,121,200.0000000000000000000000000000000000000000000000000000000000000000000 %"); + FormatStringTest (60, 121212F, "P", GetPercent ("12,121,200.00")); + FormatStringTest (61, 121212F, "P0", GetPercent ("12,121,200")); + FormatStringTest (62, 121212F, "P1", GetPercent ("12,121,200.0")); + FormatStringTest (63, 121212F, "P2", GetPercent ("12,121,200.00")); + FormatStringTest (64, 121212F, "P3", GetPercent ("12,121,200.000")); + FormatStringTest (65, 121212F, "P4", GetPercent ("12,121,200.0000")); + FormatStringTest (66, 121212F, "P5", GetPercent ("12,121,200.00000")); + FormatStringTest (67, 121212F, "P6", GetPercent ("12,121,200.000000")); + FormatStringTest (68, 121212F, "P7", GetPercent ("12,121,200.0000000")); + FormatStringTest (69, 121212F, "P8", GetPercent ("12,121,200.00000000")); + FormatStringTest (70, 121212F, "P9", GetPercent ("12,121,200.000000000")); + FormatStringTest (71, 121212F, "P67", GetPercent ("12,121,200.0000000000000000000000000000000000000000000000000000000000000000000")); FormatStringTest (72, 3.402823E+38F, "C", "$340,282,300,000,000,000,000,000,000,000,000,000,000.00"); FormatStringTest (73, 3.402823E+38F, "C0", "$340,282,300,000,000,000,000,000,000,000,000,000,000"); FormatStringTest (74, 3.402823E+38F, "C1", "$340,282,300,000,000,000,000,000,000,000,000,000,000.0"); @@ -196,18 +207,18 @@ namespace MonoTests.System { FormatStringTest (129, 3.402823E+38F, "N8", "340,282,300,000,000,000,000,000,000,000,000,000,000.00000000"); FormatStringTest (130, 3.402823E+38F, "N9", "340,282,300,000,000,000,000,000,000,000,000,000,000.000000000"); FormatStringTest (131, 3.402823E+38F, "N67", "340,282,300,000,000,000,000,000,000,000,000,000,000.0000000000000000000000000000000000000000000000000000000000000000000"); - FormatStringTest (132, 3.402823E+38F, "P", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.00 %"); - FormatStringTest (133, 3.402823E+38F, "P0", "34,028,230,000,000,000,000,000,000,000,000,000,000,000 %"); - FormatStringTest (134, 3.402823E+38F, "P1", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.0 %"); - FormatStringTest (135, 3.402823E+38F, "P2", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.00 %"); - FormatStringTest (136, 3.402823E+38F, "P3", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.000 %"); - FormatStringTest (137, 3.402823E+38F, "P4", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000 %"); - FormatStringTest (138, 3.402823E+38F, "P5", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000 %"); - FormatStringTest (139, 3.402823E+38F, "P6", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000 %"); - FormatStringTest (140, 3.402823E+38F, "P7", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000 %"); - FormatStringTest (141, 3.402823E+38F, "P8", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000000 %"); - FormatStringTest (142, 3.402823E+38F, "P9", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000000 %"); - FormatStringTest (143, 3.402823E+38F, "P67", "34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000000000000000000000000000000000000000000000000000000000000000 %"); + FormatStringTest (132, 3.402823E+38F, "P", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.00")); + FormatStringTest (133, 3.402823E+38F, "P0", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000")); + FormatStringTest (134, 3.402823E+38F, "P1", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.0")); + FormatStringTest (135, 3.402823E+38F, "P2", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.00")); + FormatStringTest (136, 3.402823E+38F, "P3", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.000")); + FormatStringTest (137, 3.402823E+38F, "P4", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000")); + FormatStringTest (138, 3.402823E+38F, "P5", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000")); + FormatStringTest (139, 3.402823E+38F, "P6", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000")); + FormatStringTest (140, 3.402823E+38F, "P7", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000")); + FormatStringTest (141, 3.402823E+38F, "P8", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000000")); + FormatStringTest (142, 3.402823E+38F, "P9", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000000")); + FormatStringTest (143, 3.402823E+38F, "P67", GetPercent ("34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000000000000000000000000000000000000000000000000000000000000000")); FormatStringTest (144, -3.402823E+38F, "C", "($340,282,300,000,000,000,000,000,000,000,000,000,000.00)"); FormatStringTest (145, -3.402823E+38F, "C0", "($340,282,300,000,000,000,000,000,000,000,000,000,000)"); FormatStringTest (146, -3.402823E+38F, "C1", "($340,282,300,000,000,000,000,000,000,000,000,000,000.0)"); @@ -268,18 +279,18 @@ namespace MonoTests.System { FormatStringTest (201, -3.402823E+38F, "N8", "-340,282,300,000,000,000,000,000,000,000,000,000,000.00000000"); FormatStringTest (202, -3.402823E+38F, "N9", "-340,282,300,000,000,000,000,000,000,000,000,000,000.000000000"); FormatStringTest (203, -3.402823E+38F, "N67", "-340,282,300,000,000,000,000,000,000,000,000,000,000.0000000000000000000000000000000000000000000000000000000000000000000"); - FormatStringTest (204, -3.402823E+38F, "P", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00 %"); - FormatStringTest (205, -3.402823E+38F, "P0", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000 %"); - FormatStringTest (206, -3.402823E+38F, "P1", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0 %"); - FormatStringTest (207, -3.402823E+38F, "P2", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00 %"); - FormatStringTest (208, -3.402823E+38F, "P3", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.000 %"); - FormatStringTest (209, -3.402823E+38F, "P4", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000 %"); - FormatStringTest (210, -3.402823E+38F, "P5", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000 %"); - FormatStringTest (211, -3.402823E+38F, "P6", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000 %"); - FormatStringTest (212, -3.402823E+38F, "P7", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000 %"); - FormatStringTest (213, -3.402823E+38F, "P8", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000000 %"); - FormatStringTest (214, -3.402823E+38F, "P9", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000000 %"); - FormatStringTest (215, -3.402823E+38F, "P67", "-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000000000000000000000000000000000000000000000000000000000000000 %"); + FormatStringTest (204, -3.402823E+38F, "P", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00")); + FormatStringTest (205, -3.402823E+38F, "P0", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000")); + FormatStringTest (206, -3.402823E+38F, "P1", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0")); + FormatStringTest (207, -3.402823E+38F, "P2", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00")); + FormatStringTest (208, -3.402823E+38F, "P3", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.000")); + FormatStringTest (209, -3.402823E+38F, "P4", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000")); + FormatStringTest (210, -3.402823E+38F, "P5", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000")); + FormatStringTest (211, -3.402823E+38F, "P6", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000")); + FormatStringTest (212, -3.402823E+38F, "P7", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000")); + FormatStringTest (213, -3.402823E+38F, "P8", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.00000000")); + FormatStringTest (214, -3.402823E+38F, "P9", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.000000000")); + FormatStringTest (215, -3.402823E+38F, "P67", GetPercent ("-34,028,230,000,000,000,000,000,000,000,000,000,000,000.0000000000000000000000000000000000000000000000000000000000000000000")); FormatStringTest (216, 1E-10F, "C", "$0.00"); FormatStringTest (217, 1E-10F, "C0", "$0"); FormatStringTest (218, 1E-10F, "C1", "$0.0"); @@ -340,18 +351,18 @@ namespace MonoTests.System { FormatStringTest (273, 1E-10F, "N8", "0.00000000"); FormatStringTest (274, 1E-10F, "N9", "0.000000000"); FormatStringTest (275, 1E-10F, "N67", "0.0000000001000000000000000000000000000000000000000000000000000000000"); - FormatStringTest (276, 1E-10F, "P", "0.00 %"); - FormatStringTest (277, 1E-10F, "P0", "0 %"); - FormatStringTest (278, 1E-10F, "P1", "0.0 %"); - FormatStringTest (279, 1E-10F, "P2", "0.00 %"); - FormatStringTest (280, 1E-10F, "P3", "0.000 %"); - FormatStringTest (281, 1E-10F, "P4", "0.0000 %"); - FormatStringTest (282, 1E-10F, "P5", "0.00000 %"); - FormatStringTest (283, 1E-10F, "P6", "0.000000 %"); - FormatStringTest (284, 1E-10F, "P7", "0.0000000 %"); - FormatStringTest (285, 1E-10F, "P8", "0.00000001 %"); - FormatStringTest (286, 1E-10F, "P9", "0.000000010 %"); - FormatStringTest (287, 1E-10F, "P67", "0.0000000100000000000000000000000000000000000000000000000000000000000 %"); + FormatStringTest (276, 1E-10F, "P", GetPercent ("0.00")); + FormatStringTest (277, 1E-10F, "P0", GetPercent ("0")); + FormatStringTest (278, 1E-10F, "P1", GetPercent ("0.0")); + FormatStringTest (279, 1E-10F, "P2", GetPercent ("0.00")); + FormatStringTest (280, 1E-10F, "P3", GetPercent ("0.000")); + FormatStringTest (281, 1E-10F, "P4", GetPercent ("0.0000")); + FormatStringTest (282, 1E-10F, "P5", GetPercent ("0.00000")); + FormatStringTest (283, 1E-10F, "P6", GetPercent ("0.000000")); + FormatStringTest (284, 1E-10F, "P7", GetPercent ("0.0000000")); + FormatStringTest (285, 1E-10F, "P8", GetPercent ("0.00000001")); + FormatStringTest (286, 1E-10F, "P9", GetPercent ("0.000000010")); + FormatStringTest (287, 1E-10F, "P67", GetPercent ("0.0000000100000000000000000000000000000000000000000000000000000000000")); } } } diff --git a/mcs/class/corlib/Test/System/UInt16Test.cs b/mcs/class/corlib/Test/System/UInt16Test.cs index bea67cd7c7c..c060783f630 100644 --- a/mcs/class/corlib/Test/System/UInt16Test.cs +++ b/mcs/class/corlib/Test/System/UInt16Test.cs @@ -49,8 +49,16 @@ public class UInt16Test : TestCase // Set culture to en-US and don't let the user override. Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false); - Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00"; - Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"65,535.00000"; + string decimals = new String ('0', NumberFormatInfo.CurrentInfo.NumberDecimalDigits); + string perPattern = new string[] {"n %","n%","%n"} [NumberFormatInfo.CurrentInfo.PercentPositivePattern]; + + Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol + "0.00"; + Results1 [3] = "0." + decimals; + Results1 [5] = "0." + decimals; + Results1 [6] = perPattern.Replace ("n","0.00"); + + Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol + "65,535.00000"; + Results2 [6] = perPattern.Replace ("n","6,553,500.00000"); } protected override void TearDown() @@ -165,6 +173,7 @@ public class UInt16Test : TestCase AssertEquals("A3", MyString3, MyUInt16_3.ToString()); //test ToString(string format) for (int i=0; i < Formats1.Length; i++) { + Console.WriteLine ("d:" + NumberFormatInfo.CurrentInfo.NumberDecimalDigits); AssertEquals("A4:"+i.ToString(), Results1[i], MyUInt16_2.ToString(Formats1[i])); AssertEquals("A5:"+i.ToString(), Results2[i], MyUInt16_3.ToString(Formats2[i])); } diff --git a/mcs/class/corlib/Test/System/UInt32Test.cs b/mcs/class/corlib/Test/System/UInt32Test.cs index a9ce9cd35a6..f6e1d0e860a 100644 --- a/mcs/class/corlib/Test/System/UInt32Test.cs +++ b/mcs/class/corlib/Test/System/UInt32Test.cs @@ -49,8 +49,17 @@ public class UInt32Test : TestCase Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false); // We can't initialize this until we set the culture. - Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00"; - Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"4,294,967,295.00000"; + + string decimals = new String ('0', NumberFormatInfo.CurrentInfo.NumberDecimalDigits); + string perPattern = new string[] {"n %","n%","%n"} [NumberFormatInfo.CurrentInfo.PercentPositivePattern]; + + Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol + "0.00"; + Results1 [3] = "0." + decimals; + Results1 [5] = "0." + decimals; + Results1 [6] = perPattern.Replace ("n","0.00"); + + Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol + "4,294,967,295.00000"; + Results2 [6] = perPattern.Replace ("n","429,496,729,500.00000"); } protected override void TearDown() diff --git a/mcs/class/corlib/Test/System/UInt64Test.cs b/mcs/class/corlib/Test/System/UInt64Test.cs index c524b7f7973..b47225ca618 100644 --- a/mcs/class/corlib/Test/System/UInt64Test.cs +++ b/mcs/class/corlib/Test/System/UInt64Test.cs @@ -52,8 +52,17 @@ public class UInt64Test : TestCase Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false); // We can't initialize this until we set the culture. - Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00"; - Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"18,446,744,073,709,551,615.00000"; + + string decimals = new String ('0', NumberFormatInfo.CurrentInfo.NumberDecimalDigits); + string perPattern = new string[] {"n %","n%","%n"} [NumberFormatInfo.CurrentInfo.PercentPositivePattern]; + + Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol + "0.00"; + Results1 [3] = "0." + decimals; + Results1 [5] = "0." + decimals; + Results1 [6] = perPattern.Replace ("n","0.00"); + + Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol + "18,446,744,073,709,551,615.00000"; + Results2 [6] = perPattern.Replace ("n","1,844,674,407,370,955,161,500.00000"); } protected override void TearDown() -- 2.25.1