2007-03-22 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Thu, 22 Mar 2007 16:48:34 +0000 (16:48 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Thu, 22 Mar 2007 16:48:34 +0000 (16:48 -0000)
* CryptoStreamTest.cs: Fixed some test cases to work properly on MS
fx 2.0.

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

mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs

index 0d5c488aba363c45cd99c3c42b50b8b86db81ccc..58d153d80ae8432853a361231913ccb3b1177884 100644 (file)
@@ -1,7 +1,9 @@
-2007-03-22  Sebastien Pouliot  <sebastien@ximian.com>
+2007-03-22  Sebastien Pouliot  <sebastien@ximian.com> 
 
        * CryptoConfigTest.cs: Fix upper/lower/mixed cases tests as they work 
        only for 2.0.
+       * CryptoStreamTest.cs: Fixed some test cases to work properly on MS
+       fx 2.0.
 
 2007-03-15 Roei Erez <roeie@mainsoft.com>
 
index fbf2264281b2024cf61d2f957b9f551b439d3568..8d62fe92d93321e20e8977e6b7218262ef1ebba8 100644 (file)
@@ -276,7 +276,9 @@ namespace MonoTests.System.Security.Cryptography {
                }
 
                [Test]
+#if ONLY_1_1
                [ExpectedException (typeof (NotSupportedException))]
+#endif
                public void FlushFinalBlockReadStream () 
                {
                        cs = new CryptoStream (readStream, encryptor, CryptoStreamMode.Read);
@@ -299,7 +301,11 @@ namespace MonoTests.System.Security.Cryptography {
 
                [Test]
                // LAMESPEC or MS BUG [ExpectedException (typeof (ObjectDisposedException))]
+#if NET_2_0
+               [ExpectedException (typeof (NotSupportedException))]
+#else
                [ExpectedException (typeof (ArgumentNullException))]
+#endif
                public void FlushFinalBlock_Disposed () 
                {
                        // do no corrupt writeStream in further tests
@@ -312,7 +318,9 @@ namespace MonoTests.System.Security.Cryptography {
 
                [Test]
                // LAMESPEC or MS BUG [ExpectedException (typeof (ObjectDisposedException))]
+#if ONLY_1_1
                [ExpectedException (typeof (ArgumentNullException))]
+#endif
                public void Read_Disposed () 
                {
                        // do no corrupt readStream in further tests
@@ -320,7 +328,7 @@ namespace MonoTests.System.Security.Cryptography {
                                byte[] buffer = new byte [8];
                                cs = new CryptoStream (s, encryptor, CryptoStreamMode.Read);
                                cs.Clear ();
-                               cs.Read (buffer, 0, 8);
+                               AssertEquals ("Read from disposed", 0, cs.Read (buffer, 0, 8));
                        }
                }