Author: zoltan
Date: 2005-03-10 11:32:00 -0500 (Thu, 10 Mar 2005)
New Revision: 41655
Modified:
trunk/mono/mono/tests/ChangeLog
trunk/mono/mono/tests/dataslot.cs
Log:
2005-03-10 Zoltan Varga <[EMAIL PROTECTED]>
* dataslot.cs: Add tests for #65414.
Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog 2005-03-10 16:26:56 UTC (rev 41654)
+++ trunk/mono/mono/tests/ChangeLog 2005-03-10 16:32:00 UTC (rev 41655)
@@ -1,3 +1,7 @@
+2005-03-10 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * dataslot.cs: Add tests for #65414.
+
2005-03-06 Zoltan Varga <[EMAIL PROTECTED]>
* rounding.cs: Remove this, this is now in the JIT regression tests.
Modified: trunk/mono/mono/tests/dataslot.cs
===================================================================
--- trunk/mono/mono/tests/dataslot.cs 2005-03-10 16:26:56 UTC (rev 41654)
+++ trunk/mono/mono/tests/dataslot.cs 2005-03-10 16:32:00 UTC (rev 41655)
@@ -2,7 +2,7 @@
using System;
using System.Threading;
-public class Test {
+public class Test : MarshalByRefObject {
static LocalDataStoreSlot[] slot = new LocalDataStoreSlot[102400];
private void Thread_func() {
@@ -27,6 +27,19 @@
Console.WriteLine("slot 96801 contains " +
Thread.GetData(slot[96801]));
}
+ static LocalDataStoreSlot slot2;
+ static string slot_value;
+
+ public void Foo (AppDomain ad)
+ {
+ ad.DoCallBack (new CrossAppDomainDelegate (Bar));
+ }
+
+ public static void Bar ()
+ {
+ slot_value = (string)Thread.GetData (slot2);
+ }
+
public static int Main () {
Console.WriteLine ("Hello, World!");
Test test=new Test();
@@ -48,6 +61,18 @@
Console.WriteLine("slot 26801 contains " +
Thread.GetData(slot[26801]));
Console.WriteLine("slot 76801 contains " +
Thread.GetData(slot[76801]));
+ // Test appdomain transitions
+ AppDomain ad = AppDomain.CreateDomain ("MyFriendlyDomain");
+ Test o = (Test) ad.CreateInstanceFromAndUnwrap ("dataslot.exe",
"Test");
+
+ slot2 = Thread.AllocateDataSlot ();
+ Thread.SetData (slot2, "hello");
+
+ o.Foo (AppDomain.CurrentDomain);
+
+ if (Test.slot_value != "hello")
+ return 1;
+
return 0;
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches