Author: zoltan
Date: 2006-09-26 04:47:15 -0400 (Tue, 26 Sep 2006)
New Revision: 65902

Modified:
   branches/vargaz/mini-linear-il/mono/mono/tests/ChangeLog
   branches/vargaz/mini-linear-il/mono/mono/tests/interlocked-2.2.cs
Log:
2006-09-26  Zoltan Varga  <[EMAIL PROTECTED]>

        * interlocked-2.2.cs: Fix long tests and add Interlocked.Exchange(long) 
test.


Modified: branches/vargaz/mini-linear-il/mono/mono/tests/ChangeLog
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/tests/ChangeLog    2006-09-26 
07:53:32 UTC (rev 65901)
+++ branches/vargaz/mini-linear-il/mono/mono/tests/ChangeLog    2006-09-26 
08:47:15 UTC (rev 65902)
@@ -1,4 +1,7 @@
-<<<<<<< .working
+2006-09-26  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * interlocked-2.2.cs: Fix long tests and add Interlocked.Exchange(long) 
test.
+
 2006-06-24  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * interlocked-2.2.cs: Add Interlocked.Read (long) test.
@@ -7,7 +10,6 @@
 
        * libtest.c: Fix merge problem.
 
-=======
 2006-09-20  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * libtest.c (mono_test_marshal_stringbuilder_default): Null terminate 
string to

Modified: branches/vargaz/mini-linear-il/mono/mono/tests/interlocked-2.2.cs
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/tests/interlocked-2.2.cs   
2006-09-26 07:53:32 UTC (rev 65901)
+++ branches/vargaz/mini-linear-il/mono/mono/tests/interlocked-2.2.cs   
2006-09-26 08:47:15 UTC (rev 65902)
@@ -4,7 +4,7 @@
 public class InterlockTest
 {
        public int test;
-       public int ltest;
+       public long ltest;
 
        public static int Main() {
                int a,b;
@@ -30,7 +30,7 @@
 
                /* long */
                it.ltest = 2;
-               int lc = Interlocked.Add (ref it.ltest, 1);
+               long lc = Interlocked.Add (ref it.ltest, 1);
                if (lc != 3)
                        return 5;
 
@@ -47,6 +47,14 @@
                if (Interlocked.Read (ref la) != 2)
                        return 9;
 
+               la = 1;
+               lc = Interlocked.Exchange (ref la, 2);
+               if (c != 1)
+                       return 10;
+
+               if (la != 2)
+                       return 11;
+
                /* Generics */
                InterlockTest o1 = new InterlockTest ();
                InterlockTest o2 = new InterlockTest ();
@@ -54,15 +62,15 @@
 
                InterlockTest o3 = Interlocked.CompareExchange (ref o, o2, o2);
                if (o3 != o1)
-                       return 10;
+                       return 12;
                if (o != o1)
-                       return 11;
+                       return 13;
 
                InterlockTest o4 = Interlocked.CompareExchange (ref o, o2, o1);
                if (o4 != o1)
-                       return 12;
+                       return 14;
                if (o != o2)
-                       return 13;
+                       return 15;
 
                Console.WriteLine ("done!");
 

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

Reply via email to