You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
committed by
Jo Shields
parent
183bba2c9a
commit
6992685b86
@@ -130,6 +130,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
#if !MONOTOUCH
|
||||
[Test]
|
||||
[Category("MobileNotWorking")] // SIGSEGV, probably on AppDomain.Unload
|
||||
public void WeakHandleWorksOnNonRootDomain ()
|
||||
{
|
||||
//Console.WriteLine("current app domain: " + AppDomain.CurrentDomain.Id);
|
||||
|
@@ -74,7 +74,11 @@ namespace MonoTests.System.Runtime.InteropServices {
|
||||
{
|
||||
string dirname = RuntimeEnvironment.GetRuntimeDirectory ();
|
||||
Assert.IsNotNull (dirname, "GetRuntimeDirectory");
|
||||
#if MONODROID
|
||||
Assert.IsTrue (dirname.Length == 0, "directory name empty");
|
||||
#else
|
||||
Assert.IsTrue (Directory.Exists (dirname), "Exists");
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@@ -48,22 +48,39 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
protected override void Dispose (bool manual)
|
||||
{
|
||||
disposed = true;
|
||||
#if !MONODROID
|
||||
// Bombs on Android (ObjectDisposedException)
|
||||
base.Dispose (manual);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void SimpleDispose ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle ();
|
||||
sf.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ObjectDisposedException))]
|
||||
public void BadDispose1 ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle ();
|
||||
|
||||
sf.DangerousRelease ();
|
||||
sf.DangerousRelease ();
|
||||
|
||||
try {
|
||||
sf.DangerousRelease ();
|
||||
Assert.Fail ("#1");
|
||||
} catch (ObjectDisposedException) {
|
||||
}
|
||||
|
||||
GC.SuppressFinalize (sf);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ObjectDisposedException))]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void BadDispose2 ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle ();
|
||||
@@ -74,6 +91,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ObjectDisposedException))]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void BadDispose3 ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle ();
|
||||
@@ -102,6 +120,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void GoodDispose ()
|
||||
{
|
||||
int dummyHandle = 0xDEAD;
|
||||
@@ -130,6 +149,8 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
Assert.IsTrue (sf.IsClosed, "closed");
|
||||
//Handle value is not changed, so the value itself is still valid (not 0 or -1)
|
||||
Assert.IsFalse (sf.IsInvalid, "invalid");
|
||||
|
||||
GC.SuppressFinalize (sf);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -217,6 +238,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void ReleaseAfterDispose1 ()
|
||||
{
|
||||
int dummyHandle = 0xDEAD;
|
||||
@@ -245,6 +267,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ObjectDisposedException))]
|
||||
[Category ("AndroidNotWorking")] // Because of the FakeSafeHandle.Dispose issue
|
||||
public void ReleaseAfterDispose2 ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle (true);
|
||||
@@ -263,6 +286,7 @@ namespace MonoTests.System.Runtime.InteropServices
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Not until Dispose runtime crasher in FakeSafeHandle is fixed
|
||||
public void NoReleaseUnowned ()
|
||||
{
|
||||
FakeSafeHandle sf = new FakeSafeHandle (false);
|
||||
|
Reference in New Issue
Block a user