8 public TestStruct (int i) {
15 return TestDriver.RunTests (typeof (Tests));
18 public static int test_1_nullable_unbox ()
20 return Unbox<int?> (1).Value;
23 public static int test_1_nullable_unbox_null ()
25 return Unbox<int?> (null).HasValue ? 0 : 1;
28 public static int test_1_nullable_box ()
30 return (int) Box<int?> (1);
33 public static int test_1_nullable_box_null ()
35 return Box<int?> (null) == null ? 1 : 0;
38 public static int test_1_isinst_nullable ()
41 return (o is int?) ? 1 : 0;
44 /* FIXME: This doesn't work yet
46 public static int test_1_nullable_unbox_vtype ()
48 return Unbox<TestStruct?> (new TestStruct (1)).Value.i;
51 public static int test_1_nullable_unbox_null_vtype ()
53 return Unbox<TestStruct?> (null).HasValue ? 0 : 1;
56 public static int test_1_nullable_box_vtype ()
58 return ((TestStruct)(Box<TestStruct?> (new TestStruct (1)))).i;
61 public static int test_1_nullable_box_null_vtype ()
63 return Box<TestStruct?> (null) == null ? 1 : 0;
66 public static int test_1_isinst_nullable_vtype ()
68 object o = new TestStruct (1);
69 return (o is TestStruct?) ? 1 : 0;
73 static object Box<T> (T t)
78 static T Unbox <T> (object o) {