Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 451a296
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -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;

/*
Expand All @@ -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)"));
}
}
Expand Down

1 comment on commit 451a296

@openjdk-notifier
Copy link

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.