Преглед изворни кода

2002-02-28 Nick Drochak <[email protected]>

	* MemoryStreamTest.cs
	* StreamWriterTest.cs
	* StringReaderTest.cs: Fix test bugs found by running against mscorlib.
	AssertEquals() requires the expected and atual values to be the same
	type if they are to be considered equal.

svn path=/trunk/mcs/; revision=2726
Nick Drochak пре 24 година
родитељ
комит
f4a9f41299

+ 8 - 0
mcs/class/corlib/Test/System.IO/ChangeLog

@@ -1,3 +1,11 @@
+2002-02-28  Nick Drochak  <[email protected]>
+
+	* MemoryStreamTest.cs 
+	* StreamWriterTest.cs 
+	* StringReaderTest.cs: Fix test bugs found by running against mscorlib.
+	AssertEquals() requires the expected and atual values to be the same
+	type if they are to be considered equal.
+
 2002-02-05  Duncan Mak  <[email protected]>
 
 	* FileTest.cs: Added to CVS. However, this portion of the code

+ 5 - 5
mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs

@@ -64,14 +64,14 @@ public class MemoryStreamTest : TestCase {
 	public void TestConstructors() {
                 MemoryStream ms = new MemoryStream();
 
-                AssertEquals( 0, ms.Length );
-                AssertEquals( 0, ms.Capacity );
-                AssertEquals( true, ms.CanWrite );
+                AssertEquals("A1", 0L, ms.Length );
+                AssertEquals("A2", 0, ms.Capacity );
+                AssertEquals("A3", true, ms.CanWrite );
                 
                 ms = new MemoryStream( 10 );
 
-                AssertEquals( 0, ms.Length );
-                AssertEquals( 10, ms.Capacity );
+                AssertEquals("A4", 0L, ms.Length );
+                AssertEquals("A5", 10, ms.Capacity );
         }
 
         public void TestRead() {

+ 6 - 6
mcs/class/corlib/Test/System.IO/StreamWriterTest.cs

@@ -225,10 +225,10 @@ public class StreamWriterTest : TestCase
 			w.Write(3);
 			w.Write(4);
 			AssertEquals("Should be nothing before flush",
-				     0, m.Length);
+				     0L, m.Length);
 			w.Flush();
 			AssertEquals("Should be something after flush",
-				     4, m.Length);
+				     4L, m.Length);
 		}		
 		{
 			MemoryStream m = new MemoryStream();
@@ -239,10 +239,10 @@ public class StreamWriterTest : TestCase
 			w.Write(3);
 			w.Write(4);
 			AssertEquals("Should be something before flush",
-				     4, m.Length);
+				     4L, m.Length);
 			w.Flush();
 			AssertEquals("Should be something after flush",
-				     4, m.Length);
+				     4L, m.Length);
 		}		
 	}
 
@@ -307,10 +307,10 @@ public class StreamWriterTest : TestCase
 			w.Write(3);
 			w.Write(4);
 			AssertEquals("Should be nothing before flush",
-				     0, m.Length);
+				     0L, m.Length);
 			w.Flush();
 			AssertEquals("Should be something after flush",
-				     4, m.Length);
+				     4L, m.Length);
 		}		
 	}
 

+ 6 - 6
mcs/class/corlib/Test/System.IO/StringReaderTest.cs

@@ -28,16 +28,16 @@ public class StringReaderTest : TestCase {
 	public void TestPeekRead() {
 		StringReader reader = new StringReader( "Test String" );
 
-		int c = reader.Peek();
-		AssertEquals( c, 'T' );
+		char c = (char)reader.Peek();
+		AssertEquals("A1", 'T', c );
 
-		int read = reader.Read();
+		char read = (char)reader.Read();
 
-		AssertEquals( read, 'T' );
+		AssertEquals("A2", 'T', read );
 		
-		c = reader.Peek();
+		c = (char)reader.Peek();
 
-		AssertEquals( c, 'e' );
+		AssertEquals("A3", 'e', c );
 	}
 
 	public void TestRead() {