harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r504869 - in /harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc: PhantomReferenceTest.java WeakReferenceTest.java
Date Thu, 08 Feb 2007 12:26:59 GMT
Author: gshimansky
Date: Thu Feb  8 04:26:58 2007
New Revision: 504869

URL: http://svn.apache.org/viewvc?view=rev&rev=504869
Log:
Applied HARMONY-3137 [drlvm][smoke tests] smoke tests gc.WeakReferenceTest and gc.PhantomReferenceTest
enhancement

Tests passed on Ubuntu6 x86, Windows 2003 server x86 and SuSE9 x86_64


Modified:
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/PhantomReferenceTest.java
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/WeakReferenceTest.java

Modified: harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/PhantomReferenceTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/PhantomReferenceTest.java?view=diff&rev=504869&r1=504868&r2=504869
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/PhantomReferenceTest.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/PhantomReferenceTest.java Thu Feb  8 04:26:58
2007
@@ -40,18 +40,13 @@
         referent = null;
 
         System.gc();
-        System.out.println("waiting for a reference..");
-        // wait a little before calling poll()
+
+        // run finalization to be sure that the reference is enqueued
+        System.runFinalization();
+
         Reference enqueued;
-        int count = 500;
-        do {
-            try {
-                Thread.sleep(20);
-            } catch (Exception e) {
-            }
-            enqueued = queue.poll();
-        } while (enqueued == null && count-- > 0);
-        if (count == 0) {
+        enqueued = queue.poll();
+        if (enqueued == null) {
             System.out.println("FAIL: reference was not enqueued");
             return;
         }

Modified: harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/WeakReferenceTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/WeakReferenceTest.java?view=diff&rev=504869&r1=504868&r2=504869
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/WeakReferenceTest.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/smoke/gc/WeakReferenceTest.java Thu Feb  8 04:26:58
2007
@@ -44,18 +44,13 @@
         referent = null;
 
         System.gc();
-        System.out.println("waiting for a reference..");
-        // wait a little before calling poll()
+        
+        // run finalization to be sure that the reference is enqueued
+        System.runFinalization();
+        
         Reference enqueued;
-        int count = 500;
-        do {
-            try {
-                Thread.sleep(20);
-            } catch (Exception e) {
-            }
-            enqueued = queue.poll();
-        } while (enqueued == null && count-- > 0);
-        if (count == 0) {
+        enqueued = queue.poll();
+        if (enqueued == null) {
             System.out.println("FAIL: reference was not enqueued");
             return;
         }



Mime
View raw message