int ln = sf.GetFileLineNumber ();
int il = sf.GetILOffset ();
int no = sf.GetNativeOffset ();
-#if NET_2_0
- // this throws in 1.x
+
Assert.IsNotNull (sf.GetMethod (), "GetMethod");
-#endif
+
if (checkFile) {
string fn = sf.GetFileName ();
}
StackFrame sf = new StackFrame ();
Check (sf, true);
}
-
+
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.Deny, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.Deny, PathDiscovery = "/")]
-#endif
-#if NET_2_0
[ExpectedException (typeof (SecurityException))]
-#endif
public void StackFrame_TrueConstructor_Fail ()
{
StackFrame sf = null;
}
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "/")]
-#endif
public void StackFrame_TrueConstructor_Pass ()
{
// ask file info
StackFrame sf = new StackFrame (true);
Check (sf, true);
}
-
- [Test]
- [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
- public void StackFrame_FalseConstructor ()
- {
- // DO NOT ask for file informations
- StackFrame sf = new StackFrame (false);
- Check (sf, true);
- }
-
- [Test]
- [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
- public void StackFrame_IntConstructor ()
- {
- StackFrame sf = new StackFrame (1);
- Check (sf, true);
- }
-
+
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.Deny, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.Deny, PathDiscovery = "/")]
-#endif
-#if NET_2_0
[ExpectedException (typeof (SecurityException))]
-#endif
public void StackFrame_IntTrueConstructor_Fail ()
{
StackFrame sf = null;
}
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "/")]
-#endif
public void StackFrame_IntTrueConstructor_Pass ()
{
// ask file info
StackFrame sf = new StackFrame (0, true);
Check (sf, true);
}
-
- [Test]
- [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
- public void StackFrame_IntFalseConstructor ()
- {
- // DO NOT ask for file informations
- StackFrame sf = new StackFrame (1, false);
- Check (sf, true);
- }
-
+
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.Deny, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.Deny, PathDiscovery = "/")]
-#endif
-#if NET_2_0
[ExpectedException (typeof (SecurityException))]
-#endif
public void StackFrame_StringIntConstructor_Fail ()
{
StackFrame sf = null;
}
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "/")]
-#endif
public void StackFrame_StringIntConstructor_Pass ()
{
// supply file info
}
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.Deny, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.Deny, PathDiscovery = "/")]
-#endif
-#if NET_2_0
[ExpectedException (typeof (SecurityException))]
-#endif
public void StackFrame_StringIntIntConstructor_Fail ()
{
StackFrame sf = null;
}
[Test]
-#if WINDOWS
- [FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "C:\\")]
-#else
[FileIOPermission (SecurityAction.PermitOnly, PathDiscovery = "/")]
-#endif
public void StackFrame_StringIntIntConstructor_Pass ()
{
// supply file info
StackFrame sf = new StackFrame ("mono.cs", 1, 1);
Check (sf, true);
+ }
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void StackFrame_FalseConstructor ()
+ {
+ // DO NOT ask for file informations
+ StackFrame sf = new StackFrame (false);
+ Check (sf, true);
+ }
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void StackFrame_IntConstructor ()
+ {
+ StackFrame sf = new StackFrame (1);
+ Check (sf, true);
+ }
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void StackFrame_IntFalseConstructor ()
+ {
+ // DO NOT ask for file informations
+ StackFrame sf = new StackFrame (1, false);
+ Check (sf, true);
}
}
}