Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@ -7,6 +7,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using NUnit.Framework;
@ -45,6 +46,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
}
}
[Test]
public void TestOffsetToStringData ()
{
Assert.AreEqual (
@ -52,6 +54,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
RuntimeHelpers.OffsetToStringData, "OffsetToStringData is not constant");
}
[Test]
public void TestGetObjectValue ()
{
FooStruct s1;
@ -75,6 +78,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
Assert.AreEqual (s2.j, "FOO");
}
[Test]
public void TestRunClassConstructor ()
{
RuntimeHelpers.RunClassConstructor (typeof(FooClass).TypeHandle);
@ -169,6 +173,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
RuntimeHelpers.InitializeArray (new Fielder ().array, rfh);
}
[Test]
public void TestGetHashCode ()
{
Assert.AreEqual (0, RuntimeHelpers.GetHashCode (null));
@ -177,6 +182,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
Assert.IsTrue (5 != RuntimeHelpers.GetHashCode (new FooClass ()));
}
[Test]
public void TestEquals ()
{
Assert.IsTrue (RuntimeHelpers.Equals (null, null));
@ -197,5 +203,21 @@ namespace MonoTests.System.Runtime.CompilerServices {
Assert.IsTrue (RuntimeHelpers.Equals (o1, o3));
Assert.IsTrue (!RuntimeHelpers.Equals (o1, o4));
}
[Test]
public void TestEnsureSufficientExecutionStack ()
{
var t = new Thread (() => {
unsafe {
var s = stackalloc byte [1024];
}
RuntimeHelpers.EnsureSufficientExecutionStack ();
});
t.Start ();
t.Join ();
}
}
}