diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2015-09-30 12:20:52 -0700 |
---|---|---|
committer | Bryan Arant <bryanar@microsoft.com> | 2015-10-18 23:09:47 -0700 |
commit | 004514c07bcf5230b518befd75f794733b5f9067 (patch) | |
tree | f05d9d5692627acac1d043915eb5b20a74f403ec /tests/src/reflection/regression/dev10bugs/dev10_630880.cs | |
parent | ddff89241f682995bdde165de89b579573a338aa (diff) | |
download | coreclr-004514c07bcf5230b518befd75f794733b5f9067.tar.gz coreclr-004514c07bcf5230b518befd75f794733b5f9067.tar.bz2 coreclr-004514c07bcf5230b518befd75f794733b5f9067.zip |
Managed Test Port
This is a collection of managed runtime tests from an internal legacy test tree.
Diffstat (limited to 'tests/src/reflection/regression/dev10bugs/dev10_630880.cs')
-rw-r--r-- | tests/src/reflection/regression/dev10bugs/dev10_630880.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/src/reflection/regression/dev10bugs/dev10_630880.cs b/tests/src/reflection/regression/dev10bugs/dev10_630880.cs new file mode 100644 index 0000000000..09768299ad --- /dev/null +++ b/tests/src/reflection/regression/dev10bugs/dev10_630880.cs @@ -0,0 +1,41 @@ +using System; +using System.Runtime.CompilerServices; +using System.Security; + +/* Regression case for Dev10 #630880 - SL4: User Breaking Change: Users are not able to run critical class constructors in platform assembles */ + +public class Dev10_630880 +{ + public static int Main() + { + int failures = 0; + + Console.WriteLine("Getting type of System.AppDomainManager."); + Type t = Type.GetType("System.AppDomainManager"); + + Console.WriteLine("Getting type handle of System.AppDomainManager type."); + RuntimeTypeHandle h = t.TypeHandle; + + Console.WriteLine("Calling RuntimeHelpers.RunClassConstructor with type handle of System.AppDomainManager type."); + try + { + // In V2, this throws TypeLoadException. + // In V4, this shouldn't throw any exception + RuntimeHelpers.RunClassConstructor(h); + + Console.WriteLine("PASS> No exception is thrown."); + } + catch (Exception e) + { + failures++; + Console.WriteLine("FAIL> Unexpected {0}!", e.GetType()); + Console.WriteLine("Please revisit Dev10 #630880."); + Console.WriteLine(); + Console.WriteLine(e); + } + + Console.WriteLine(); + Console.WriteLine("TEST {0}", failures == 0 ? "PASSED." : "FAILED!"); + return 100 + failures; + } +} |