Improve tests
authorMiguel de Icaza <miguel@gnome.org>
Tue, 1 Jan 2002 19:06:23 +0000 (19:06 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 1 Jan 2002 19:06:23 +0000 (19:06 -0000)
svn path=/trunk/mcs/; revision=1769

mcs/tests/ChangeLog
mcs/tests/test-19.cs
mcs/tests/test-35.cs
mcs/tests/test-67.cs

index 570df3f80f667ca4dd8b0be0057c3fa1f0362061..444ddcb0d6a7f30c18d98519cfee3360022e0ae9 100755 (executable)
@@ -1,3 +1,7 @@
+2001-12-30  Miguel de Icaza  <miguel@ximian.com>
+
+       * test-67.cs: Improve this test.
+
 2001-12-29  Ravi Pratap  <ravi@ximian.com>
 
        * test-69.cs : Add. This tests support for methods which are
index c42af6f03b90e3de1e4bb1371d35e819c339c1a2..4a49c8fb6fd7901876cb4f5d4ac8b913d4741b5f 100755 (executable)
@@ -51,6 +51,7 @@ class X {
        {
                I.GetTextFn _ = I.GetText;
 
+       Console.WriteLine ("Value: " + I.GetText);
                X x = new X ();
 
                Thread thr = new Thread (new ThreadStart (x.Thread_func));
@@ -70,6 +71,8 @@ class X {
                MemberInfo [] mi = t.FindMembers (MemberTypes.Method, BindingFlags.Static | BindingFlags.NonPublic,
                                                  Type.FilterName, "MyFilter");
 
+               Console.WriteLine ("FindMembers called, mi = " + mi);
+               Console.WriteLine ("   Count: " + mi.Length);
                if (!filter (mi [0], "MyFilter"))
                        return 1;
                
index 15654965b24f278f5d993c34fb32a783003c6a12..d9bc1d8338e92bf0e57d25bd53587e9ea35e0cef 100755 (executable)
@@ -12,6 +12,11 @@ class X {
                if (!t)
                        j = 1;
        }
+
+       static void w (int x)
+       {
+               System.Console.WriteLine (" " + x);
+       }
        
        static int Main ()
        {
@@ -22,11 +27,13 @@ class X {
                else
                        error++;
 
+               w (1);
                if (f)
                        error++;
                else
                        ok |= 2;
 
+               w(2);
                if (t)
                        ok |= 4;
                else
@@ -43,6 +50,7 @@ class X {
                        ok |= 16;
 
                int i = 0;
+               w(3);
                do {
                        i++;
                } while (!(i > 5));
@@ -51,6 +59,8 @@ class X {
                else
                        ok |= 32;
                
+               w(100);
+               System.Console.WriteLine ("Value: " + t);
                do {
                        i++;
                } while (!t);
index cf50fc667646e9ede0550ab176fa4d7b4bb743a2..7eb792ae690d37610e8ef3635c4596d71ff1c866 100644 (file)
@@ -27,6 +27,20 @@ public struct Rect {
        [FieldOffset (12)] public int bottom;
 }
 
+[StructLayout (LayoutKind.Explicit)]
+struct A {
+       [FieldOffset (0)]
+       public int a;
+       [FieldOffset (0)]
+       public byte b1;
+       [FieldOffset (1)]
+       public byte b2;
+       [FieldOffset (2)]
+       public byte b3;
+       [FieldOffset (3)]
+       public byte b4;
+}
+
 public class Blah {
 
        [DllImport ("Kernel32.dll")]
@@ -58,6 +72,19 @@ public class Blah {
 
                if (!PtInRect (ref r, p))
                        return 1;
+
+               A a = new A ();
+
+               a.a = 0x12345678;
+
+               if (a.b1 != 0x78)
+                       return 2;
+               if (a.b2 != 0x56)
+                       return 3;
+               if (a.b3 != 0x34)
+                       return 4;
+               if (a.b4 != 0x12)
+                       return 5;
                
                Console.WriteLine ("Point lies inside rect");
                Console.WriteLine ("Test passes");