2009-05-19 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 19 May 2009 22:15:28 +0000 (22:15 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 19 May 2009 22:15:28 +0000 (22:15 -0000)
* cli-tables-tests.md: Add tests for the methodspec table.

* assembly-with-generics.cs: Add stuff for new tests.

svn path=/trunk/mono/; revision=134428

mono/tests/metadata-verifier/Changelog
mono/tests/metadata-verifier/assembly-with-generics.cs
mono/tests/metadata-verifier/cli-tables-tests.md

index d4ba15c50b4f53426cfa58964e585ce50340d3cf..4fd2c667f803be5fb13058c183bab98e12a02bc7 100644 (file)
@@ -1,3 +1,9 @@
+2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * cli-tables-tests.md: Add tests for the methodspec table.
+
+       * assembly-with-generics.cs: Add stuff for new tests.
+
 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * cli-tables-tests.md: Add tests for the generic param table.
index 4729a59cf643aeadd1cfde151fb0d023bb3ad6d2..772a2bf22f78c46ffca64bff9079b3af037de9bc 100644 (file)
@@ -1,7 +1,12 @@
 using System;
 using System.Runtime.InteropServices;
 
-public class Simple<T,K>  {}
+public class Simple<T,K>  {
+       public static void Gen<D>() {
+               Simple<D,T>.Gen<K> ();
+       }
+       public T t;
+}
 
 public class Generic<A,B,C,D,E> 
        where B : class
@@ -24,5 +29,9 @@ public class Driver
 
        public static void Main ()
        {
+               var x = new Simple<int, double> ();
+               var y = x.t;
+               Simple<int, double>.Gen<string> ();
+               Simple<int, object>.Gen<Type> ();
        }
 }
\ No newline at end of file
index e0d6ae97046be309af86fafffe291dc2cbee4a64..35195d1dce208d1d492c60882d753f5b0679f74b 100644 (file)
@@ -1226,5 +1226,20 @@ generic-param-table {
        #step bigger than 1
        invalid offset table-row (0x2A 0)  set-ushort 0,
                        offset table-row (0x2A 1)  set-ushort 2
+}
+
+method-spec-table {
+       assembly assembly-with-generics.exe
+
+       #method is a valid token
+       invalid offset table-row (0x2B 0) set-ushort 0
+       invalid offset table-row (0x2B 0) set-ushort 0x8800
+       invalid offset table-row (0x2B 0) set-ushort 0x8801
+
+       #instantiation is invalid
+
+       invalid offset table-row (0x2B 0) + 2 set-ushort 0
+       invalid offset table-row (0x2B 0) + 2 set-ushort 0xABCD
 
+       #TODO check the content of the blob sig and validate against the token.
 }