Ver Fonte

2004-04-12 David Sheldon <[email protected]>

  * BinaryReaderTest.cs: Changed series of bytes in
  ReadDecimal to be a cleaner representation of a real
  decimal, as was not a technically correct decimal.

Do we need to add some more tests for what we do with values such as those
in the old test case? With the old code, you could get a single value that
was not equal to its lexical representation. Not ideal.

> d is -18295873486192640
> d != -18295873486192640

svn path=/trunk/mcs/; revision=25372
David Sheldon há 22 anos atrás
pai
commit
4819fbaeb7

+ 1 - 1
mcs/class/corlib/Test/System.IO/BinaryReaderTest.cs

@@ -971,7 +971,7 @@ namespace MonoTests.System.IO
 		MemoryStream stream = null;
 		BinaryReader reader = null;		
 		try {
-			stream = new MemoryStream (new byte [] {0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0 ,87, 98, 0, 0, 0, 0});
+			stream = new MemoryStream (new byte [] {0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0 ,128, 0, 0, 0, 0, 0});
 			reader = new BinaryReader (stream);		
 			AssertEquals ("test#01", -18295873486192640, reader.ReadDecimal ());
 		} finally {

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

@@ -1,3 +1,9 @@
+2004-04-12  David Sheldon <[email protected]>
+
+  * BinaryReaderTest.cs: Changed series of bytes in 
+  ReadDecimal to be a cleaner representation of a real 
+  decimal, as was not a technically correct decimal. 
+   
 2004-04-01  Lluis Sanchez Gual  <[email protected]>
 
 	* BufferedStreamTest.cs: Added test for Position.