Skip to content
Permalink
Browse files
8275173: testlibrary_tests/ir_framework/tests/TestCheckedTests.java f…
…ails after JDK-8274911

Reviewed-by: chagedorn, thartmann
  • Loading branch information
DamonFool committed Oct 13, 2021
1 parent 5ffb5d1 commit 451a296510994ff9fe1e0381900ffa9a8a1caa54
Showing 1 changed file with 12 additions and 2 deletions.
@@ -26,6 +26,8 @@
import compiler.lib.ir_framework.*;
import compiler.lib.ir_framework.driver.IRViolationException;
import compiler.lib.ir_framework.driver.TestVMException;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import jdk.test.lib.Asserts;

/*
@@ -41,22 +43,30 @@ public class TestCheckedTests {
public int iFld;

public static void main(String[] args) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
PrintStream oldOut = System.out;
System.setOut(ps);

TestFramework.run();
try {
TestFramework.run(BadIRAndRuntimeCheckedTests.class);
Utils.shouldHaveThrownException();
Utils.shouldHaveThrownException(baos.toString());
} catch (TestVMException e) {
System.setOut(oldOut);
Asserts.assertTrue(e.getExceptionInfo().contains("Test Failures (2)"));
Asserts.assertTrue(e.getExceptionInfo().contains("checkTestBad3"));
Asserts.assertTrue(e.getExceptionInfo().contains("checkTestBad5"));
Asserts.assertTrue(e.getExceptionInfo().split("BadCheckedTestException").length == 3);
Asserts.assertFalse(e.getExceptionInfo().contains("Failed IR Rules"));
}

System.setOut(ps);
try {
TestFramework.run(BadIRCheckedTests.class);
Utils.shouldHaveThrownException();
Utils.shouldHaveThrownException(baos.toString());
} catch (IRViolationException e) {
System.setOut(oldOut);
Asserts.assertTrue(e.getExceptionInfo().contains("Failed IR Rules (3)"));
}
}

1 comment on commit 451a296

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 451a296 Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.