2006-05-25 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 25 May 2006 16:05:05 +0000 (16:05 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 25 May 2006 16:05:05 +0000 (16:05 -0000)
* *.sh: Fix more verification problems.

* TestRunner.cs: Use Assembly.EntryPoint instead of searching for a Main method.

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

mono/tests/verifier/ChangeLog
mono/tests/verifier/TestRunner.cs
mono/tests/verifier/make_bin_test.sh
mono/tests/verifier/make_exception_branch_test.sh
mono/tests/verifier/make_obj_store_test.sh
mono/tests/verifier/make_stack_0_pop_test.sh
mono/tests/verifier/make_stack_0_test.sh
mono/tests/verifier/make_stack_1_pop_test.sh
mono/tests/verifier/make_stack_merge_test.sh
mono/tests/verifier/make_store_test.sh

index 6e00e62f556151bc83d90c818db70ac06ecaa809..c572768f01228f44bbcf0f64ed15d1ba13181c33 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-25  Zoltan Varga  <vargaz@gmail.com>
+
+       * *.sh: Fix more verification problems.
+
+       * TestRunner.cs: Use Assembly.EntryPoint instead of searching for a Main method.
+
 2006-05-23  Zoltan Varga  <vargaz@gmail.com>
 
        * make_store_test.sh make_obj_store_test.sh make_stack_merge_test.sh: Fix
index e8ad86f0635b83e83039555738f2b5bb3462a493..cacded32860fad47dbe96e21ce8fa21d3fd16be2 100644 (file)
@@ -8,9 +8,13 @@ public class TestRunner : MarshalByRefObject
                Console.Write (test);
 
                Assembly a = Assembly.LoadFrom (test);
-               Module m = a.GetLoadedModules ()[0];
 
-               MethodInfo mi = m.GetMethod ("Main");
+               MethodInfo mi = a.EntryPoint;
+
+               if (mi == null) {
+                       Console.WriteLine (" FAILED (no entry point found)");
+                       return;
+               }
 
                try {
                        mi.Invoke (null, null);
index b90bbcc86fbcdf334b2bc466929b7896cbd572b1..45f1240c0766d82542c30e106b39aacb5e2a3b9e 100755 (executable)
@@ -16,6 +16,12 @@ sed -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/
 // VALIDITY CIL which breaks the ECMA-335 rules. 
 // this CIL should fail verification by a conforming CLI verifier.
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 .method public static int32 Main() cil managed
 {
        .entrypoint
index 87d6220f8db6cd104d465b40304f5d47e454581f..e01a33303bd2e62afd04befffff341f0ddf2c6b0 100755 (executable)
@@ -16,6 +16,12 @@ sed -e "s/OPCODE1/${TEST_OP1}/g" -e "s/OPCODE2/${TEST_OP2}/g" -e "s/OPCODE3/${TE
 // invalid CIL which breaks the ECMA-335 rules. 
 // This CIL should fail verification by a conforming CLI verifier.
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 .method public static int32 Main() cil managed
 {
        .entrypoint
index 09d851984a7339299318e9f89a0127ca2f3134aa..6569caf358c56c237c37def44586ab7972147b9f 100755 (executable)
@@ -13,6 +13,12 @@ TEST_TYPE1=`echo $TEST_TYPE1 | sed -s 's/&/\\\&/'`
 TEST_TYPE2=`echo $TEST_TYPE2 | sed -s 's/&/\\\&/'`
 sed -e "s/VALIDITY/${TEST_VALIDITY}/g"  -e "s/OPCODE/${TEST_OP}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/${TEST_TYPE2}/g" > $TEST_FILE <<//EOF
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 // VALIDITY CIL which breaks the ECMA-335 rules. 
 // this CIL should fail verification by a conforming CLI verifier.
 
index a4526d1d5a22a5a13605ea5da1f48e47147f53bd..769cdee12c2949c82d350afcc259d384e1f51d57 100755 (executable)
@@ -9,12 +9,18 @@ sed -e "s/OPCODE/${TEST_OP}/g" > $TEST_FILE <<//EOF
 // invalid CIL which breaks the ECMA-335 rules. 
 // This CIL should fail verification by a conforming CLI verifier.
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 .class Class extends [mscorlib]System.Object
 {
     .field public int32 fld
 }
 
-.method public static int32 Main(int32 arg) cil managed
+.method public static int32 Main() cil managed
 {
        .entrypoint
        .maxstack 1
index 33c6650ab6f5fefb13ae0794e7566407dfe37823..168652953c39085beb4e388e49bde62f768bcf86 100755 (executable)
@@ -9,12 +9,18 @@ sed -e "s/OPCODE/${TEST_OP}/g" > $TEST_FILE <<//EOF
 // invalid CIL which breaks the ECMA-335 rules. 
 // This CIL should fail verification by a conforming CLI verifier.
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 .class Class extends [mscorlib]System.Object
 {
     .field public int32 fld
 }
 
-.method public static int32 Main(int32 arg) cil managed
+.method public static int32 Main() cil managed
 {
        .entrypoint
        .maxstack 1
index 99a5fed7cf75a3892934e955b1aa4a1bc3c2c097..fabd30d55178aa96c27076959c2f136954b3755f 100755 (executable)
@@ -10,12 +10,18 @@ sed -e "s/OPCODE/${TEST_OP}/g" -e "s/TYPE/${TEST_TYPE}/g" > $TEST_FILE <<//EOF
 // invalid CIL which breaks the ECMA-335 rules.
 // This CIL should fail verification by a conforming CLI verifier.
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 .class Class extends [mscorlib]System.Object
 {
     .field public int32 fld
 }
 
-.method public static int32 Main(int32 arg) cil managed
+.method public static int32 Main() cil managed
 {
        .entrypoint
        .maxstack 1
index 36d453907ef65b8874f811d2bc5a28a11a597099..8bbe0619c11f25fdd5a189c4ae9aa59170711af1 100755 (executable)
@@ -15,6 +15,12 @@ sed -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/
 // VALIDITY CIL which breaks the ECMA-335,III,1.8.1.3 rule. 
 // this CIL should fail verification by a conforming CLI verifier.
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 .assembly extern mscorlib
 {
   .ver 1:0:5000:0
index 155eb24fdad8fa771429fd9ff8b4c12001def6eb..18e6fa7f676c9561547650e454bfb937531da485 100755 (executable)
@@ -16,6 +16,12 @@ sed -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/
 // VALIDITY CIL which breaks the ECMA-335 rules. 
 // this CIL should fail verification by a conforming CLI verifier.
 
+.assembly '${TEST_NAME}_generated'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+
 .assembly extern mscorlib
 {
   .ver 1:0:5000:0