summaryrefslogtreecommitdiffstats
path: root/test/018-stack-overflow/src
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-06-03 01:23:27 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-06-03 01:23:27 +0100
commit6ae6d126ba3b50d16b6ba61f39c3982a34a49eec (patch)
treef588c43e574217cd38777f8282314d250d9dbc6a /test/018-stack-overflow/src
parent1ca6a11a61b57edea370adf4454876ccf869d92e (diff)
parentd5e4ac0abdeeb4dc13bd05a40bf496299a787536 (diff)
downloadandroid_art-stable/cm-11.0-XNG2S.tar.gz
android_art-stable/cm-11.0-XNG2S.tar.bz2
android_art-stable/cm-11.0-XNG2S.zip
Android 4.4.3 release 1
Diffstat (limited to 'test/018-stack-overflow/src')
-rw-r--r--test/018-stack-overflow/src/Main.java37
1 files changed, 33 insertions, 4 deletions
diff --git a/test/018-stack-overflow/src/Main.java b/test/018-stack-overflow/src/Main.java
index f79c269c85..41adabc9ff 100644
--- a/test/018-stack-overflow/src/Main.java
+++ b/test/018-stack-overflow/src/Main.java
@@ -19,17 +19,46 @@
*/
public class Main {
public static void main(String args[]) {
+ testSelfRecursion();
+ testMutualRecursion();
+ System.out.println("SOE test done");
+ }
+
+ private static void testSelfRecursion() {
try {
stackOverflowTestSub(0.0, 0.0, 0.0);
}
catch (StackOverflowError soe) {
- System.out.println("caught SOE");
+ System.out.println("caught SOE in testSelfRecursion");
}
- System.out.println("SOE test done");
}
- private static void stackOverflowTestSub(double pad1, double pad2,
- double pad3) {
+ private static void stackOverflowTestSub(double pad1, double pad2, double pad3) {
stackOverflowTestSub(pad1, pad2, pad3);
}
+
+ private static void testMutualRecursion() {
+ try {
+ foo(0.0, 0.0, 0.0);
+ }
+ catch (StackOverflowError soe) {
+ System.out.println("caught SOE in testMutualRecursion");
+ }
+ }
+
+ private static void foo(double pad1, double pad2, double pad3) {
+ bar(pad1, pad2, pad3);
+ }
+
+ private static void bar(double pad1, double pad2, double pad3) {
+ baz(pad1, pad2, pad3);
+ }
+
+ private static void baz(double pad1, double pad2, double pad3) {
+ qux(pad1, pad2, pad3);
+ }
+
+ private static void qux(double pad1, double pad2, double pad3) {
+ foo(pad1, pad2, pad3);
+ }
}