comparison test/compiler/whitebox/SetDontInlineMethodTest.java @ 10113:4b2eebe03f93

8011971: WB API doesn't accept j.l.reflect.Constructor Reviewed-by: kvn, vlivanov
author iignatyev
date Tue, 16 Apr 2013 10:04:01 -0700
parents b84fd7d73702
children 11237ee74aae
comparison
equal deleted inserted replaced
10112:c89eab0b6b30 10113:4b2eebe03f93
25 * @test SetDontInlineMethodTest 25 * @test SetDontInlineMethodTest
26 * @library /testlibrary /testlibrary/whitebox 26 * @library /testlibrary /testlibrary/whitebox
27 * @build SetDontInlineMethodTest 27 * @build SetDontInlineMethodTest
28 * @run main ClassFileInstaller sun.hotspot.WhiteBox 28 * @run main ClassFileInstaller sun.hotspot.WhiteBox
29 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetDontInlineMethodTest 29 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetDontInlineMethodTest
30 * @summary testing of WB::testSetDontInlineMethod()
30 * @author igor.ignatyev@oracle.com 31 * @author igor.ignatyev@oracle.com
31 */ 32 */
32 public class SetDontInlineMethodTest extends CompilerWhiteBoxTest { 33 public class SetDontInlineMethodTest extends CompilerWhiteBoxTest {
33 34
34 public static void main(String[] args) throws Exception { 35 public static void main(String[] args) throws Exception {
35 new SetDontInlineMethodTest().runTest(); 36 for (TestCase test : TestCase.values()) {
37 new SetDontInlineMethodTest(test).runTest();
38 }
36 } 39 }
37 40
41 public SetDontInlineMethodTest(TestCase testCase) {
42 super(testCase);
43 }
44
45 /**
46 * Tests {@code WB::testSetDontInlineMethod()} by sequential calling it and
47 * checking of return value.
48 *
49 * @throws Exception if one of the checks fails.
50 */
51 @Override
38 protected void test() throws Exception { 52 protected void test() throws Exception {
39 if (WHITE_BOX.testSetDontInlineMethod(METHOD, true)) { 53 if (WHITE_BOX.testSetDontInlineMethod(method, true)) {
40 throw new RuntimeException("on start " + METHOD 54 throw new RuntimeException("on start " + method
41 + " must be inlineable"); 55 + " must be inlineable");
42 } 56 }
43 if (!WHITE_BOX.testSetDontInlineMethod(METHOD, true)) { 57 if (!WHITE_BOX.testSetDontInlineMethod(method, true)) {
44 throw new RuntimeException("after first change to true " + METHOD 58 throw new RuntimeException("after first change to true " + method
45 + " must be not inlineable"); 59 + " must be not inlineable");
46 } 60 }
47 if (!WHITE_BOX.testSetDontInlineMethod(METHOD, false)) { 61 if (!WHITE_BOX.testSetDontInlineMethod(method, false)) {
48 throw new RuntimeException("after second change to true " + METHOD 62 throw new RuntimeException("after second change to true " + method
49 + " must be still not inlineable"); 63 + " must be still not inlineable");
50 } 64 }
51 if (WHITE_BOX.testSetDontInlineMethod(METHOD, false)) { 65 if (WHITE_BOX.testSetDontInlineMethod(method, false)) {
52 throw new RuntimeException("after first change to false" + METHOD 66 throw new RuntimeException("after first change to false" + method
53 + " must be inlineable"); 67 + " must be inlineable");
54 } 68 }
55 if (WHITE_BOX.testSetDontInlineMethod(METHOD, false)) { 69 if (WHITE_BOX.testSetDontInlineMethod(method, false)) {
56 throw new RuntimeException("after second change to false " + METHOD 70 throw new RuntimeException("after second change to false " + method
57 + " must be inlineable"); 71 + " must be inlineable");
58 } 72 }
59 } 73 }
60 } 74 }