From a9836c29426b526670c219f7ac5eda1300bcc772 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Thu, 25 May 2006 16:05:05 +0000 Subject: [PATCH] 2006-05-25 Zoltan Varga * *.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 | 6 ++++++ mono/tests/verifier/TestRunner.cs | 8 ++++++-- mono/tests/verifier/make_bin_test.sh | 6 ++++++ mono/tests/verifier/make_exception_branch_test.sh | 6 ++++++ mono/tests/verifier/make_obj_store_test.sh | 6 ++++++ mono/tests/verifier/make_stack_0_pop_test.sh | 8 +++++++- mono/tests/verifier/make_stack_0_test.sh | 8 +++++++- mono/tests/verifier/make_stack_1_pop_test.sh | 8 +++++++- mono/tests/verifier/make_stack_merge_test.sh | 6 ++++++ mono/tests/verifier/make_store_test.sh | 6 ++++++ 10 files changed, 63 insertions(+), 5 deletions(-) diff --git a/mono/tests/verifier/ChangeLog b/mono/tests/verifier/ChangeLog index 6e00e62f556..c572768f012 100644 --- a/mono/tests/verifier/ChangeLog +++ b/mono/tests/verifier/ChangeLog @@ -1,3 +1,9 @@ +2006-05-25 Zoltan Varga + + * *.sh: Fix more verification problems. + + * TestRunner.cs: Use Assembly.EntryPoint instead of searching for a Main method. + 2006-05-23 Zoltan Varga * make_store_test.sh make_obj_store_test.sh make_stack_merge_test.sh: Fix diff --git a/mono/tests/verifier/TestRunner.cs b/mono/tests/verifier/TestRunner.cs index e8ad86f0635..cacded32860 100644 --- a/mono/tests/verifier/TestRunner.cs +++ b/mono/tests/verifier/TestRunner.cs @@ -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); diff --git a/mono/tests/verifier/make_bin_test.sh b/mono/tests/verifier/make_bin_test.sh index b90bbcc86fb..45f1240c076 100755 --- a/mono/tests/verifier/make_bin_test.sh +++ b/mono/tests/verifier/make_bin_test.sh @@ -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 diff --git a/mono/tests/verifier/make_exception_branch_test.sh b/mono/tests/verifier/make_exception_branch_test.sh index 87d6220f8db..e01a33303bd 100755 --- a/mono/tests/verifier/make_exception_branch_test.sh +++ b/mono/tests/verifier/make_exception_branch_test.sh @@ -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 diff --git a/mono/tests/verifier/make_obj_store_test.sh b/mono/tests/verifier/make_obj_store_test.sh index 09d851984a7..6569caf358c 100755 --- a/mono/tests/verifier/make_obj_store_test.sh +++ b/mono/tests/verifier/make_obj_store_test.sh @@ -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 < $TEST_FILE < $TEST_FILE < $TEST_FILE <