harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r486641 - in /harmony/enhanced/drlvm/trunk: build/make/excludes/ vm/tests/smoke/stress/
Date Wed, 13 Dec 2006 13:24:44 GMT
Author: varlax
Date: Wed Dec 13 05:24:43 2006
New Revision: 486641

URL: http://svn.apache.org/viewvc?view=rev&rev=486641
Log:
Applied HARMONY-2639 [drlvm][smoke tests] The test stress.Stack is invalid.

Modified:
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.interpreter
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.jit
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.interpreter
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.jit
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Stack.java

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.interpreter
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.interpreter?view=diff&rev=486641&r1=486640&r2=486641
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.interpreter
(original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.interpreter
Wed Dec 13 05:24:43 2006
@@ -5,7 +5,6 @@
 gc/SynchronizedFinilazersTest.java
 init/ErrorInInitializer.java
 io/Integers.java
-stress/Stack.java
 thread/InfiniteFinalizer.java
 
 # fails on ubuntu 6

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.jit
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.jit?view=diff&rev=486641&r1=486640&r2=486641
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.jit
(original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.jit
Wed Dec 13 05:24:43 2006
@@ -9,3 +9,6 @@
 
 # fails on Ubuntu6 x86_64
 gc/Mark.java
+
+# fails intermittently 
+stress/Stack.java
\ No newline at end of file

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.interpreter
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.interpreter?view=diff&rev=486641&r1=486640&r2=486641
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.interpreter
(original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.interpreter
Wed Dec 13 05:24:43 2006
@@ -5,5 +5,4 @@
 gc/SynchronizedFinilazersTest.java
 init/ErrorInInitializer.java
 io/Integers.java
-stress/Stack.java
 thread/InfiniteFinalizer.java

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.jit
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.jit?view=diff&rev=486641&r1=486640&r2=486641
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.jit (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.jit Wed
Dec 13 05:24:43 2006
@@ -4,5 +4,4 @@
 gc/SynchronizedFinilazersTest.java
 init/ErrorInInitializer.java
 io/Integers.java
-stress/Stack.java
 thread/InfiniteFinalizer.java

Modified: harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Stack.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Stack.java?view=diff&rev=486641&r1=486640&r2=486641
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Stack.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/tests/smoke/stress/Stack.java Wed Dec 13 05:24:43 2006
@@ -22,25 +22,64 @@
 
 public class Stack {
 
-    static final int depth = 7000; // the external java crashes if depth = 200000
+    // the minimal reference limit for DRLVM on Windows/Interpreter
+    // which does not cause StackOverflowError
+    static final int minDepth = 300;
+    // the maximal reference limit for DRLVM on linux/OPT
+    // which cause StackOverflowError
+    static int depth = 75000;
+    static final int maxDepth = 12000000;
 
-    synchronized boolean test(int i) {
+    synchronized boolean testMinDepth(int i) {
         System.out.println("" + i);
+        if (i < minDepth && testMinDepth(++i)) {
+            return true;
+        }
+        return true;
+    }
 
+    synchronized boolean test(int i) {
+        System.out.println(i);
         if (i < depth && test(++i)) {
             return true;
         }
-        return true;
+        return false;
     }
 
     public static void main(String[] args) {
         boolean pass = false;
-
+        boolean minDepthPass = false;
+            
+        Stack test = new Stack();
+        
+        // check that StackOverflowError is NOT thrown 
+        // for the predefined minimal number of iterations 
         try {
-            Stack test = new Stack();
-            pass = test.test(0);
-        } catch (Throwable e) {
-            System.out.println("Got exception: " + e.toString());            
+            test.testMinDepth(0);
+            System.out.println("Test passed for " + minDepth + " iterations\n");
+            minDepthPass = true;
+        } catch (StackOverflowError e) {
+            System.out.println("\nStackOverflowError has been thrown too early");
+        }
+
+        // check that StackOverflowError is thrown 
+        // after some reasonable number of iterations 
+        if (minDepthPass) {
+            try {
+                while (!pass && depth <= maxDepth) {
+                    pass = test.test(0);
+                    depth *= 2;
+                }
+                System.out.println("StackOverflowError has not been thrown after " + depth
/ 2 + " iterations");
+            } catch (Throwable e) {
+                if (e instanceof StackOverflowError) {
+                    System.out.println("\nGot expected StackOverflowError");
+                    pass = true;
+                } else {
+                    System.out.println("\nGot unexpected exception: " + e.toString());
+                    pass = false;
+                }
+            }
         }
         System.out.println("Stack test " + (pass ? "passed" : "failed"));
     }



Mime
View raw message