2001-11-28 Nick Drochak <ndrochak@gol.com>
authorNick Drochak <nickd@mono-cvs.ximian.com>
Tue, 27 Nov 2001 19:34:13 +0000 (19:34 -0000)
committerNick Drochak <nickd@mono-cvs.ximian.com>
Tue, 27 Nov 2001 19:34:13 +0000 (19:34 -0000)
        * Int16Test.cs Int32Test.cs SByteTest.cs: Surgically removed tests that
rely on culture of system.  These need to be crafted a bit differently.

svn path=/trunk/mcs/; revision=1451

mcs/class/corlib/Test/System/ChangeLog
mcs/class/corlib/Test/System/Int16Test.cs
mcs/class/corlib/Test/System/Int32Test.cs
mcs/class/corlib/Test/System/SByteTest.cs

index 72398e01fe82b9bb7a33e7573dc455839aeeb916..cc4961777e9a87408de879521f6fd9ecbf547f43 100644 (file)
@@ -1,3 +1,7 @@
+2001-11-28  Nick Drochak <ndrochak@gol.com>\r
+\r
+       * Int16Test.cs Int32Test.cs SByteTest.cs: Surgically removed tests that rely on culture of system.  These need to be crafted a bit differently.\r
+\r
 2001-11-27  Nick Drochak  <ndrochak@gol.com>\r
 \r
        * SByteTest.cs: Add messages to Assert()'s so we can tell where the tests fail.\r
index 7766375cc443af453148606635b416dc35d08230..eb8fe935a20481de5836d7f461f29226848a8528 100644 (file)
@@ -150,14 +150,18 @@ public class Int16Test : TestCase
                Assert(String.Compare(MyString2, MyInt16_2.ToString()) == 0);
                Assert(String.Compare(MyString3, MyInt16_3.ToString()) == 0);
                //test ToString(string format)
+               /*
+               TODO: These tests are culture sensitive.  Need to find a way to determine the culture
+                       of the system to decide the correct expected result.
                for (int i=0; i < Formats1.Length; i++) {
                        Assert(String.Compare(Results1[i], MyInt16_2.ToString(Formats1[i])) == 0);
                        Assert(String.Compare(Results2[i], MyInt16_3.ToString(Formats2[i])) == 0);
                }
+               */
                //test ToString(string format, IFormatProvider provider);
                for (int i=0; i < Formats1.Length; i++) {
-                       Assert(String.Compare(ResultsNfi1[i], MyInt16_2.ToString(Formats1[i], Nfi)) == 0);
-                       Assert(String.Compare(ResultsNfi2[i], MyInt16_3.ToString(Formats2[i], Nfi)) == 0);
+                       Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MyInt16_2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MyInt16_2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MyInt16_2.ToString(Formats1[i], Nfi)) == 0);
+                       Assert("i="+i+", ResultsNfi2[i]="+ResultsNfi2[i]+", MyInt16_3.ToString(Formats2[i]="+Formats2[i]+"): Expected "+ResultsNfi2[i]+" but got "+MyInt16_3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MyInt16_3.ToString(Formats2[i], Nfi)) == 0);
                }
                try {
                        MyInt16_1.ToString("z");
index ae5bf28801831cb953ee12f9f060b0a84c9abb07..6b77ccda2d4f72995ed64c8129f8b14d6728e8b2 100644 (file)
@@ -53,16 +53,16 @@ public class Int32Test : TestCase
        
        public void TestCompareTo()
        {
-               Assert(MyInt32_3.CompareTo(MyInt32_2) > 0);
-               Assert(MyInt32_2.CompareTo(MyInt32_2) == 0);
-               Assert(MyInt32_1.CompareTo((Int32)(-42)) == 0);
-               Assert(MyInt32_2.CompareTo(MyInt32_3) < 0);
+               Assert("MyInt32_3.CompareTo(MyInt32_2) > 0", MyInt32_3.CompareTo(MyInt32_2) > 0);
+               Assert("MyInt32_2.CompareTo(MyInt32_2) == 0", MyInt32_2.CompareTo(MyInt32_2) == 0);
+               Assert("MyInt32_1.CompareTo((Int32)(-42)) == 0", MyInt32_1.CompareTo((Int32)(-42)) == 0);
+               Assert("MyInt32_2.CompareTo(MyInt32_3) < 0", MyInt32_2.CompareTo(MyInt32_3) < 0);
                try {
                        MyInt32_2.CompareTo((Int16)100);
                        Fail("Should raise a System.ArgumentException");
                }
                catch (Exception e) {
-                       Assert(typeof(ArgumentException) == e.GetType());
+                       Assert("typeof(ArgumentException) == e.GetType()", typeof(ArgumentException) == e.GetType());
                }
        }
 
@@ -150,10 +150,14 @@ public class Int32Test : TestCase
                Assert(String.Compare(MyString2, MyInt32_2.ToString()) == 0);
                Assert(String.Compare(MyString3, MyInt32_3.ToString()) == 0);
                //test ToString(string format)
+               /*
+               TODO: These tests are culture sensitive.  Need to find a way to determine the culture
+                       of the system to decide the correct expected result.
                for (int i=0; i < Formats1.Length; i++) {
                        Assert(String.Compare(Results1[i], MyInt32_2.ToString(Formats1[i])) == 0);
                        Assert(String.Compare(Results2[i], MyInt32_3.ToString(Formats2[i])) == 0);
                }
+               */
                //test ToString(string format, IFormatProvider provider);
                for (int i=0; i < Formats1.Length; i++) {
                        Assert(String.Compare(ResultsNfi1[i], MyInt32_2.ToString(Formats1[i], Nfi)) == 0);
index 0938a523f5080c8bbd9185a4b26b1f6c7a27c365..c56179abf2b320ebe0113a05c0a95ff6faded382 100644 (file)
@@ -149,10 +149,14 @@ public class SByteTest : TestCase
                Assert("MyString2, MySByte2.ToString()", String.Compare(MyString2, MySByte2.ToString()) == 0);
                Assert("MyString3, MySByte3.ToString()", String.Compare(MyString3, MySByte3.ToString()) == 0);
                //test ToString(string format)
+               /*
+               TODO: These tests depend on the culture of the system running the test.
+                       So, this needs to be tested in a different way.
                for (int i=0; i < Formats1.Length; i++) {
-                       Assert("Results1[i], MySByte2.ToString(Formats1[i])", String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
+                       Assert("i="+i+", Results1[i]="+Results1[i]+", MySByte2.ToString(Formats1[i])="+MySByte2.ToString(Formats1[i]), String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
                        Assert("Results2[i], MySByte3.ToString(Formats2[i])", String.Compare(Results2[i], MySByte3.ToString(Formats2[i])) == 0);
                }
+               */
                //test ToString(string format, IFormatProvider provider);
                for (int i=0; i < Formats1.Length; i++) {
                        Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MySByte2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MySByte2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MySByte2.ToString(Formats1[i], Nfi)) == 0);