[System.Runtime.InteropServices.RuntimeInformation] Updated to reference copied files...
[mono-project.git] / mono / tests / debug-casts.cs
blob129e6e210e309f025c5495bc29b0f64c6749e7d3
1 using System;
2 using System.Collections.Generic;
3 using System.Runtime.CompilerServices;
5 public class Tests
7 public static int Main (string[] args) {
8 return TestDriver.RunTests (typeof (Tests), args);
11 public static int test_0_simple () {
12 object o = new object ();
13 try {
14 string s = (string)o;
15 return 1;
16 } catch (InvalidCastException ex) {
17 if (!ex.Message.Contains ("System.Object") || !ex.Message.Contains ("System.String"))
18 return 2;
20 return 0;
23 public static int test_0_complex_1 () {
24 object o = new object ();
25 try {
26 IEnumerable<object> ie = (IEnumerable<object>)o;
27 return 1;
28 } catch (InvalidCastException ex) {
29 if (!ex.Message.Contains ("System.Object") || !ex.Message.Contains ("System.Collections.Generic.IEnumerable`1[System.Object]"))
30 return 2;
32 return 0;
35 [MethodImplAttribute (MethodImplOptions.NoInlining)]
36 public static object return_null () {
37 return null;
40 public static int test_0_complex_1_null () {
41 object o = return_null ();
42 IEnumerable<object> ie = (IEnumerable<object>)o;
43 return 0;