Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / bug-30085.cs
1 using System;
2
3 class Program
4 {
5
6         static void MissingImage ()
7         {
8                 Type good = System.Type.GetType("System.Nullable`1[[System.Int32, mscorlib]]");
9                 Type bad = System.Type.GetType("System.Nullable`1[[System.Int32, mscorlibBAD]]");
10
11                 if (good.Assembly.FullName.Split (',') [0] != "mscorlib")
12                         throw new Exception ("Wrong assembly name");
13
14                 if (bad != null)
15                         throw new Exception ("Should not have loaded type");
16         }
17
18         static void ProbeCorlib ()
19         {
20                 Type good = System.Type.GetType("System.Nullable`1[[System.Int32, mscorlib]]");
21 #if MOBILE
22                 string pubKeyToken = "7cec85d7bea7798e";
23 #else
24                 string pubKeyToken = "b77a5c561934e089";
25 #endif
26                 string t = String.Format ("System.Nullable`1[[System.IO.MemoryMappedFiles.MemoryMappedFile, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken={0}]]", pubKeyToken);
27                 Type bad = System.Type.GetType(t);
28
29                 if (good.Assembly.FullName.Split (',') [0] != "mscorlib")
30                         throw new Exception ("Wrong assembly name");
31
32                 if (good == null || bad == null)
33                         throw new Exception ("Missing image did not probe corlib");
34         }
35
36         static void Main()
37         {
38                 MissingImage ();
39                 ProbeCorlib ();
40         }
41 }