Author: spouliot
Date: 2005-03-14 15:46:04 -0500 (Mon, 14 Mar 2005)
New Revision: 41802

Modified:
   trunk/mcs/class/corlib/Test/System/ChangeLog
   trunk/mcs/class/corlib/Test/System/EnvironmentCas.cs
   trunk/mcs/class/corlib/Test/System/ExceptionCas.cs
Log:
2005-03-14  Sebastien Pouliot  <[EMAIL PROTECTED]> 

        * EnvironmentCas.cs: Fixed failures under MS for NET_1_1.
        * ExceptionCas.cs: Fixed failures under MS for NET_1_1.



Modified: trunk/mcs/class/corlib/Test/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System/ChangeLog        2005-03-14 18:09:51 UTC 
(rev 41801)
+++ trunk/mcs/class/corlib/Test/System/ChangeLog        2005-03-14 20:46:04 UTC 
(rev 41802)
@@ -1,3 +1,8 @@
+2005-03-14  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+
+       * EnvironmentCas.cs: Fixed failures under MS for NET_1_1.
+       * ExceptionCas.cs: Fixed failures under MS for NET_1_1.
+
 2005-03-09  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * TypeTest.cs: Add tests for bug #73432.

Modified: trunk/mcs/class/corlib/Test/System/EnvironmentCas.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System/EnvironmentCas.cs        2005-03-14 
18:09:51 UTC (rev 41801)
+++ trunk/mcs/class/corlib/Test/System/EnvironmentCas.cs        2005-03-14 
20:46:04 UTC (rev 41802)
@@ -212,6 +212,10 @@
 
                [Test]
                [EnvironmentPermission (SecurityAction.Deny, Read = 
"PLEASE_NEVER_DEFINE_THIS_VARIABLE")]
+#if !NET_2_0
+               // Before 2.0 this required Unrestricted EnvironmentPermission
+               [ExpectedException (typeof (SecurityException))]
+#endif
                public void GetEnvironmentVariables_Pass ()
                {
                        // this will work as long as 
PLEASE_NEVER_DEFINE_THIS_VARIABLE
@@ -413,7 +417,11 @@
 
                [Test]
 #if WINDOWS
+#if NET_2_0
                [FileIOPermission (SecurityAction.Deny, PathDiscovery = "C:\\")]
+#else
+               [FileIOPermission (SecurityAction.Deny, Read = "C:\\")]
+#endif
                [ExpectedException (typeof (SecurityException))]
 #endif
                public void SystemDirectory ()

Modified: trunk/mcs/class/corlib/Test/System/ExceptionCas.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System/ExceptionCas.cs  2005-03-14 18:09:51 UTC 
(rev 41801)
+++ trunk/mcs/class/corlib/Test/System/ExceptionCas.cs  2005-03-14 20:46:04 UTC 
(rev 41802)
@@ -92,17 +92,29 @@
                        Assert.AreEqual ("message", e.Message, "Message");
                        Assert.IsNotNull (e.InnerException, "InnerException");
                        Assert.IsNotNull (e.ToString (), "ToString");
-#if NET_2_0
-                       Assert.IsNotNull (e.Data, "Data");
-#endif
                        Assert.IsNull (e.HelpLink, "HelpLink");
                        Assert.IsNull (e.Source, "Source");
                        Assert.IsNull (e.StackTrace, "StackTrace");
+#if NET_2_0
+                       Assert.IsNotNull (e.Data, "Data");
+                       // throws under 1.x
                        Assert.IsNull (e.TargetSite, "TargetSite");
+#endif
                }
 
+#if !NET_2_0
                [Test]
                [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+               [ExpectedException (typeof (SecurityException))]
+               public void FullRestriction_TargetSite ()
+               {
+                       Exception e = new Exception ("message", new Exception 
("inner message"));
+                       Assert.IsNull (e.TargetSite, "TargetSite");
+               }
+#endif
+
+               [Test]
+               [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
                public void Throw_FullRestriction_Pass ()
                {
                        try {
@@ -111,12 +123,13 @@
                        catch (Exception e) {
                                Assert.AreEqual ("message", e.Message, 
"Message");
                                Assert.IsNotNull (e.InnerException, 
"InnerException");
+                               Assert.IsNull (e.HelpLink, "HelpLink");
+                               Assert.IsNotNull (e.Source, "Source");
 #if NET_2_0
                                Assert.IsNotNull (e.Data, "Data");
+                               // throws under 1.x
+                               Assert.IsNotNull (e.TargetSite, "TargetSite");
 #endif
-                               Assert.IsNull (e.HelpLink, "HelpLink");
-                               Assert.IsNotNull (e.Source, "Source");
-                               Assert.IsNotNull (e.TargetSite, "TargetSite");
                        }
                }
 
@@ -126,13 +139,16 @@
 #else
                [FileIOPermission (SecurityAction.Deny, PathDiscovery = "/")]
 #endif
+#if NET_2_0
                [ExpectedException (typeof (Exception))]
+#endif
                public void Throw_FullRestriction_Fail_StackTrace ()
                {
                        try {
                                throw new Exception ("message");
                        }
                        catch (Exception e) {
+                               // throws only under 2.x
                                string s = e.StackTrace;
                        }
                }
@@ -143,13 +159,16 @@
 #else
                [FileIOPermission (SecurityAction.Deny, PathDiscovery = "/")]
 #endif
+#if NET_2_0
                [ExpectedException (typeof (Exception))]
+#endif
                public void Throw_FullRestriction_Fail_ToString ()
                {
                        try {
                                throw new Exception ("message");
                        }
                        catch (Exception e) {
+                               // throws only under 2.x
                                string s = e.ToString ();
                        }
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to