From 908306b10525c9fdf9940fe2b679304ed5d0d190 Mon Sep 17 00:00:00 2001 From: Gayan Weerakutti Date: Mon, 28 May 2018 22:25:45 +0530 Subject: [PATCH] Remove countStackFrames() in StackDepthCheckerTest#testInfiniteRecursion Seeting the stack frame depth (n) in here is not very important. So removed. Fixes: #62 --- .../nasa/jpf/test/mc/basic/StackDepthCheckerTest.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/tests/gov/nasa/jpf/test/mc/basic/StackDepthCheckerTest.java b/src/tests/gov/nasa/jpf/test/mc/basic/StackDepthCheckerTest.java index bbd17027..770a34f2 100644 --- a/src/tests/gov/nasa/jpf/test/mc/basic/StackDepthCheckerTest.java +++ b/src/tests/gov/nasa/jpf/test/mc/basic/StackDepthCheckerTest.java @@ -35,19 +35,14 @@ void foo(){ System.out.println(n); foo(); - - n--; // not that we ever get here - System.out.print("exited foo() at level "); - System.out.println(n); + + // this function never returns } @Test - @SuppressWarnings("deprecation") public void testInfiniteRecursion (){ if (verifyUnhandledException("java.lang.StackOverflowError", "+listener=.listener.StackDepthChecker", "+sdc.max_stack_depth=42")){ - Thread t = Thread.currentThread(); - n = t.countStackFrames(); // it's deprecated, but we just want to make the printout more readable foo(); } }