Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@ -266,6 +266,7 @@ namespace MonoTests.System
}
[Test]
[Category("StackWalks")]
public void GetObjectData ()
{
string msg = "MESSAGE";
@ -383,6 +384,7 @@ namespace MonoTests.System
}
[Test]
[Category("StackWalks")]
public void Source ()
{
Exception ex1 = new Exception ("MSG");
@ -405,21 +407,21 @@ namespace MonoTests.System
}
#if !MOBILE
void NestedStackTraces (int depth)
void NestedStackTraces (int depth)
{
if (depth == 0)
throw new ArgumentException ("Depth 0 exception");
if (depth == 0)
throw new ArgumentException ("Depth 0 exception");
try {
NestedStackTraces (depth - 1);
} catch (Exception exc) {
throw new Exception (String.Format ("Depth {0} exception, expect nested", depth), exc);
}
}
void StacktraceToStateTest (int depth)
{
try {
NestedStackTraces (depth);
NestedStackTraces (depth - 1);
} catch (Exception exc) {
throw new Exception (String.Format ("Depth {0} exception, expect nested", depth), exc);
}
}
void StacktraceToStateTest (int depth)
{
try {
NestedStackTraces (depth);
} catch (Exception exc) {
var monoType = Type.GetType ("Mono.Runtime", false);
var convert = monoType.GetMethod("ExceptionToState", BindingFlags.NonPublic | BindingFlags.Static);
@ -430,41 +432,41 @@ namespace MonoTests.System
var portable_hash = output.Item2;
var unportable_hash = output.Item3;
// To see what we're working with
// Console.WriteLine (dump);
// To see what we're working with
// Console.WriteLine (dump);
Assert.IsTrue (portable_hash != 0, "#1");
Assert.IsTrue (unportable_hash != 0, "#2");
Assert.IsTrue (dump.Length > 0, "#3");
}
}
// Ensure that we can convert a stacktrace to a
// telemetry message
//
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateBase ()
{
StacktraceToStateTest (0);
}
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateDeeper ()
{
StacktraceToStateTest (2);
}
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateOverflow ()
{
// We set a limit on 15 nested exceptions. Lets check that we're valid
// when exceeding that limit.
StacktraceToStateTest (20);
}
// Ensure that we can convert a stacktrace to a
// telemetry message
//
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateBase ()
{
StacktraceToStateTest (0);
}
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateDeeper ()
{
StacktraceToStateTest (2);
}
[Test]
[Category("NotOnWindows")]
public void StacktraceToStateOverflow ()
{
// We set a limit on 15 nested exceptions. Lets check that we're valid
// when exceeding that limit.
StacktraceToStateTest (20);
}
void DumpSingle ()
{
var monoType = Type.GetType ("Mono.Runtime", false);