* ByteTest.cs, Int32Test.cs, Int64Test, SingleFormatterTest.cs, UInt16Test.cs, UInt32...
authorLluis Sanchez <lluis@novell.com>
Tue, 23 Mar 2004 18:30:34 +0000 (18:30 -0000)
committerLluis Sanchez <lluis@novell.com>
Tue, 23 Mar 2004 18:30:34 +0000 (18:30 -0000)
svn path=/trunk/mcs/; revision=24481

mcs/class/corlib/Test/System/ByteTest.cs
mcs/class/corlib/Test/System/ChangeLog
mcs/class/corlib/Test/System/Int32Test.cs
mcs/class/corlib/Test/System/Int64Test.cs
mcs/class/corlib/Test/System/SingleFormatterTest.cs
mcs/class/corlib/Test/System/UInt16Test.cs
mcs/class/corlib/Test/System/UInt32Test.cs
mcs/class/corlib/Test/System/UInt64Test.cs

index 75329dce2d2f0b84a35dc1caefac3e489692edf0..ab909c0161a631efee6f270bc11b10f0dec68ed8 100644 (file)
@@ -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()
index 2a994ff04ef8322e366751947471c0e62c01ed0e..89598241e3c1ae6b5d288f80ec0af4ddbcfc0013 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-23  Lluis Sanchez Gual  <lluis@ximian.com>
+
+       * 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  <dick@ximian.com>
 
        * DateTimeTest.cs (System): Test the MM-dd-yyyy date parse format.
index a71ac21114cb5f78110da70f83eed73d9453e686..fd0c4a89492dfcbe2bb15c938b7ff0a134ae4b5a 100644 (file)
@@ -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()
index 0ba833039c4af8e8be6b743fc98d346d4d9eca35..77e7d225364659936834a21aae20a139985b725a 100644 (file)
@@ -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 = ":";
index 8995823e83d69e5e028240e900d82918efffc4f7..66a064d783ffe96415d847526f76666a8cd1e141 100644 (file)
@@ -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"));  
                }
        }
 }
index bea67cd7c7ccf05e140ce8407ebaa5372351dcf8..c060783f6308df574eef39fb6b618b262315ed59 100644 (file)
@@ -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]));
                }
index a9ce9cd35a65b57a40cd9f8788673e42732fcaf5..f6e1d0e860a78ba8389c5f0853884cab766988eb 100644 (file)
@@ -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()
index c524b7f7973ce32b6375c2a44f8cc10fe6b6893b..b47225ca61891fbbefbfbbaee5fe4a006fa69e20 100644 (file)
@@ -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()