Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@ -307,6 +307,7 @@ namespace MonoTests.System.Threading
[Test]
[Category ("NotDotNet")] // it hangs.
[Category ("InterpreterNotWorking")] /* crashes on linux/arm64 */
public void TestStart()
{
{
@ -449,6 +450,7 @@ namespace MonoTests.System.Threading
}
[Test]
[Category ("InterpreterNotWorking")]
public void TestUndivisibleByPageSizeMaxStackSize ()
{
const int undivisible_stacksize = 1048573;
@ -1016,6 +1018,27 @@ namespace MonoTests.System.Threading
Assert.IsNotNull (ex.Message, "#B8");
}
}
[Test] // bug #60031
public void StoppedThreadsThrowThreadStateException ()
{
var t = new Thread (() => { });
t.Start ();
t.Join ();
Assert.Throws<ThreadStateException> (() => { var isb = t.IsBackground; }, "IsBackground getter");
Assert.Throws<ThreadStateException> (() => { var isb = t.ApartmentState; }, "ApartmentState getter");
Assert.Throws<ThreadStateException> (() => t.ApartmentState = ApartmentState.MTA, "ApartmentState setter");
Assert.Throws<ThreadStateException> (() => t.IsBackground = false, "IsBackground setter");
Assert.Throws<ThreadStateException> (() => t.Start (), "Start ()");
#if MONO_FEATURE_THREAD_SUSPEND_RESUME
Assert.Throws<ThreadStateException> (() => t.Resume (), "Resume ()");
Assert.Throws<ThreadStateException> (() => t.Suspend (), "Suspend ()");
#endif
Assert.Throws<ThreadStateException> (() => t.GetApartmentState (), "GetApartmentState ()");
Assert.Throws<ThreadStateException> (() => t.SetApartmentState (ApartmentState.MTA), "SetApartmentState ()");
Assert.Throws<ThreadStateException> (() => t.TrySetApartmentState (ApartmentState.MTA), "TrySetApartmentState ()");
}
}
[TestFixture]