Author: spouliot
Date: 2005-03-14 11:36:07 -0500 (Mon, 14 Mar 2005)
New Revision: 41800

Modified:
   trunk/mono/mono/tests/cas/linkdemand/ChangeLog
   trunk/mono/mono/tests/cas/linkdemand/Makefile
   trunk/mono/mono/tests/cas/linkdemand/icall1.cs
   trunk/mono/mono/tests/cas/linkdemand/icall2.cs
Log:
2005-03-14  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * icall1.cs: Fixed test to work on NET_2_0. We're now accepting the
        2.0 behaviour when dealing with icalls (as we do not keep their
        pblic status in the runtime).
        * icall2.cs: Fixed test to work on NET_2_0 as the icall has changed
        it's return value from bool to void. 
        * Makefile: Allow to build the tests with either NET_1_1 or NET_2_0.



Modified: trunk/mono/mono/tests/cas/linkdemand/ChangeLog
===================================================================
--- trunk/mono/mono/tests/cas/linkdemand/ChangeLog      2005-03-14 16:32:53 UTC 
(rev 41799)
+++ trunk/mono/mono/tests/cas/linkdemand/ChangeLog      2005-03-14 16:36:07 UTC 
(rev 41800)
@@ -1,3 +1,12 @@
+2005-03-14  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * icall1.cs: Fixed test to work on NET_2_0. We're now accepting the
+       2.0 behaviour when dealing with icalls (as we do not keep their
+       pblic status in the runtime).
+       * icall2.cs: Fixed test to work on NET_2_0 as the icall has changed
+       it's return value from bool to void. 
+       * Makefile: Allow to build the tests with either NET_1_1 or NET_2_0.
+
 2005-03-03  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * cas4-5.cs: Removed. Replaced by new refcas#.cs tests.

Modified: trunk/mono/mono/tests/cas/linkdemand/Makefile
===================================================================
--- trunk/mono/mono/tests/cas/linkdemand/Makefile       2005-03-14 16:32:53 UTC 
(rev 41799)
+++ trunk/mono/mono/tests/cas/linkdemand/Makefile       2005-03-14 16:36:07 UTC 
(rev 41800)
@@ -1,7 +1,15 @@
 RUNTIME = mono --debug --security
-CSCOMPILE = mcs --debug
 PROFILE = net_1_1
 
+compiler_defines = -d:NET_1_1
+
+ifeq ($(PROFILE), net_2_0)
+CSCOMPILE = gmcs --debug
+compiler_defines += -d:NET_2_0
+else
+CSCOMPILE = mcs --debug
+endif
+
 all:   icall1.exe icall2.exe icall3.exe icall4.exe icall5.exe icall6.exe \
        aptc1a.exe aptc1b.exe aptc2a.exe aptc2b.exe aptclib.dll \
        pinvoke1.exe pinvoke2.exe pinvoke3.exe pinvoke4.exe \
@@ -75,25 +83,25 @@
        sn -k aptc.snk
 
 %a.exe: %.cs
-       $(CSCOMPILE) $^ /out:$@
+       $(CSCOMPILE) $^ /out:$@ $(compiler_defines)
 
 %b.exe: %.cs
-       $(CSCOMPILE) $^ /out:$@ /keyfile:ecma.pub /delaysign+
+       $(CSCOMPILE) $^ /out:$@ /keyfile:ecma.pub /delaysign+ 
$(compiler_defines)
 
 aptc1b.exe: aptc1.cs aptc.snk
-       $(CSCOMPILE) aptc1.cs /out:$@ /keyfile:aptc.snk
+       $(CSCOMPILE) aptc1.cs /out:$@ /keyfile:aptc.snk $(compiler_defines)
 
 aptc2a.exe: aptc2.cs aptclib.dll
-       $(CSCOMPILE) aptc2.cs /out:$@ /r:aptclib.dll
+       $(CSCOMPILE) aptc2.cs /out:$@ /r:aptclib.dll $(compiler_defines)
 
 aptc2b.exe: aptc2.cs aptclib.dll
-       $(CSCOMPILE) aptc2.cs /out:$@ /keyfile:aptc.snk /r:aptclib.dll
+       $(CSCOMPILE) aptc2.cs /out:$@ /keyfile:aptc.snk /r:aptclib.dll 
$(compiler_defines)
 
 aptclib.dll: aptclib.cs aptc.snk
-       $(CSCOMPILE) aptclib.cs /out:$@ /target:library /keyfile:aptc.snk
+       $(CSCOMPILE) aptclib.cs /out:$@ /target:library /keyfile:aptc.snk 
$(compiler_defines)
 
 %.exe: %.cs
-       $(CSCOMPILE) $^ /out:$@
+       $(CSCOMPILE) $^ /out:$@ $(compiler_defines)
 
 %.exe.so: %.exe
        $(RUNTIME) --aot $^

Modified: trunk/mono/mono/tests/cas/linkdemand/icall1.cs
===================================================================
--- trunk/mono/mono/tests/cas/linkdemand/icall1.cs      2005-03-14 16:32:53 UTC 
(rev 41799)
+++ trunk/mono/mono/tests/cas/linkdemand/icall1.cs      2005-03-14 16:36:07 UTC 
(rev 41800)
@@ -8,7 +8,7 @@
        public class Environment {
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               internal extern static string internalGetGacPath ();
+               public extern static string internalGetGacPath ();
        }
 
        // private internal call for MS runtime
@@ -20,7 +20,11 @@
                }
 
                [MethodImpl (MethodImplOptions.InternalCall)]
-               internal extern bool CompleteGuid ();
+#if NET_2_0
+               public extern void CompleteGuid ();
+#else
+               public extern bool CompleteGuid ();
+#endif
        }
 }
 
@@ -41,14 +45,28 @@
                                result = Environment.internalGetGacPath ();
                        } else {
                                System.Guid g = new System.Guid ();
+#if NET_2_0
+                               g.CompleteGuid ();
+                               result = "completed";
+#else
                                result = g.CompleteGuid ().ToString ();
+#endif
                        }
-                       Console.WriteLine ("*1* Unexcepted internal call: {0}", 
result);
-                       return 1;
+#if NET_2_0
+                       Console.WriteLine ("*0* Excepted internal call: {0}", 
result);
+#else
+                       Console.WriteLine ("*0* Unexcepted (1.x) but accepted 
(like 2.x) internal call: {0}", result);
+#endif
+                       return 0;
                }
                catch (SecurityException se) {
-                       Console.WriteLine ("*0* Expected 
SecurityException\n{0}", se);
+#if NET_2_0
+                       Console.WriteLine ("*1* Unexpected 
SecurityException\n{0}", se);
+                       return 1;
+#else
+                       Console.WriteLine ("*0* Expected (1.x) 
SecurityException\n{0}", se);
                        return 0;
+#endif
                }
                catch (Exception e) {
                        Console.WriteLine ("*2* Unexpected exception\n{0}", e);

Modified: trunk/mono/mono/tests/cas/linkdemand/icall2.cs
===================================================================
--- trunk/mono/mono/tests/cas/linkdemand/icall2.cs      2005-03-14 16:32:53 UTC 
(rev 41799)
+++ trunk/mono/mono/tests/cas/linkdemand/icall2.cs      2005-03-14 16:36:07 UTC 
(rev 41800)
@@ -21,6 +21,8 @@
                        icall = "internalGetGacPath";
                        mi = typeof (System.Environment).GetMethod (icall, 
BindingFlags.Static | BindingFlags.NonPublic);
                } else {
+                       // private internal call for MS runtime
+                       // 
http://msdn.microsoft.com/msdnmag/issues/04/11/NETMatters/
                        icall = "CompleteGuid";
                        mi = typeof (System.Guid).GetMethod (icall, 
BindingFlags.Instance | BindingFlags.NonPublic);
                }
@@ -36,7 +38,12 @@
                                result = (string) mi.Invoke (null, null);
                        } else {
                                System.Guid g = new System.Guid ();
+#if NET_2_0
+                               mi.Invoke (g, null);
+                               result = "completed";
+#else
                                result = ((bool) mi.Invoke (g, null)).ToString 
();
+#endif
                        }
                        Console.WriteLine ("*0* [Reflected]{0}: {1}", icall, 
result);
                        return 0;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to