Permalink
Browse files

Dum de dum, forgot to commit.

svn path=/trunk/mono/; revision=2582
  • Loading branch information...
1 parent 089e423 commit 651f6714db009f8309f293247b83a553b50656a3 @illupus illupus committed Feb 22, 2002
Showing with 70 additions and 0 deletions.
  1. +1 −0 mono/tests/Makefile.am
  2. +69 −0 mono/tests/assignable-tests.cs
View
1 mono/tests/Makefile.am
@@ -36,6 +36,7 @@ TESTSRC= \
enum2.cs \
property.cs \
enumcast.cs \
+ assignable-tests.cs \
array-cast.cs \
cattr-compile.cs \
custom-attr.cs \
View
69 mono/tests/assignable-tests.cs
@@ -0,0 +1,69 @@
+
+using System;
+
+namespace Test {
+ public interface A {
+ void method ();
+ }
+ public interface B : A {
+ void method2 ();
+ }
+ public class test {
+ public static int Main () {
+ Type int_type = typeof (int);
+ Type obj_type = typeof (object);
+ Type vt_type = typeof (System.ValueType);
+ Type comp_type = typeof (System.IComparable);
+ Type a_type = typeof (A);
+ Type b_type = typeof (B);
+ int error = 1;
+
+ if (!int_type.IsSubclassOf(vt_type))
+ return error;
+ ++error;
+ if (!int_type.IsSubclassOf(obj_type))
+ return error;
+ ++error;
+ if (int_type.IsSubclassOf(comp_type))
+ return error;
+ ++error;
+
+ if (int_type.IsAssignableFrom(vt_type))
+ return error;
+ ++error;
+ if (int_type.IsAssignableFrom (obj_type))
+ return error;
+ ++error;
+ if (int_type.IsAssignableFrom(comp_type))
+ return error;
+ ++error;
+
+ if (!int_type.IsAssignableFrom(int_type))
+ return error;
+ ++error;
+ if (!obj_type.IsAssignableFrom (int_type))
+ return error;
+ ++error;
+ if (!vt_type.IsAssignableFrom(int_type))
+ return error;
+ ++error;
+ if (!comp_type.IsAssignableFrom(int_type))
+ return error;
+ ++error;
+
+ if (a_type.IsSubclassOf(b_type))
+ return error;
+ ++error;
+ if (b_type.IsAssignableFrom(a_type))
+ return error;
+ ++error;
+ if (b_type.IsSubclassOf(a_type))
+ return error;
+ ++error;
+ if (!a_type.IsAssignableFrom(b_type))
+ return error;
+ ++error;
+ return 0;
+ }
+ }
+}

0 comments on commit 651f671

Please sign in to comment.