Mercurial > hg > truffle
comparison graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/Class_asSubclass01.java @ 7282:390448a6b535
converted the JTT tests to use the GraalCompilerTest framework which offers more control over what is compiled and executed
the HP_series and FloatingReads tests have been disabled temporarily
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 20 Dec 2012 14:59:57 +0100 |
parents | e808627bd16f |
children | c38d2870439e |
comparison
equal
deleted
inserted
replaced
7281:e960cda050d7 | 7282:390448a6b535 |
---|---|
22 */ | 22 */ |
23 /* | 23 /* |
24 */ | 24 */ |
25 package com.oracle.graal.jtt.lang; | 25 package com.oracle.graal.jtt.lang; |
26 | 26 |
27 import com.oracle.graal.jtt.*; | |
27 import org.junit.*; | 28 import org.junit.*; |
28 | 29 |
29 @SuppressWarnings("static-method") | 30 public final class Class_asSubclass01 extends JTTTest { |
30 public final class Class_asSubclass01 { | |
31 | 31 |
32 public static int test(int i) { | 32 public static int test(int i) { |
33 if (i == 0) { | 33 if (i == 0) { |
34 if (Object.class.asSubclass(String.class) == null) { | 34 if (Object.class.asSubclass(String.class) == null) { |
35 return -1; | 35 return -1; |
51 } | 51 } |
52 } | 52 } |
53 return i; | 53 return i; |
54 } | 54 } |
55 | 55 |
56 @Test(expected = java.lang.ClassCastException.class) | 56 @Test |
57 public void run0() throws Throwable { | 57 public void run0() throws Throwable { |
58 test(0); | 58 runTest("test", 0); |
59 } | 59 } |
60 | 60 |
61 @Test | 61 @Test |
62 public void run1() throws Throwable { | 62 public void run1() throws Throwable { |
63 Assert.assertEquals(1, test(1)); | 63 runTest("test", 1); |
64 } | 64 } |
65 | 65 |
66 @Test(expected = java.lang.ClassCastException.class) | 66 @Test |
67 public void run2() throws Throwable { | 67 public void run2() throws Throwable { |
68 test(2); | 68 runTest("test", 2); |
69 } | 69 } |
70 | 70 |
71 @Test | 71 @Test |
72 public void run3() throws Throwable { | 72 public void run3() throws Throwable { |
73 Assert.assertEquals(3, test(3)); | 73 runTest("test", 3); |
74 } | 74 } |
75 | 75 |
76 @Test | 76 @Test |
77 public void run4() throws Throwable { | 77 public void run4() throws Throwable { |
78 Assert.assertEquals(4, test(4)); | 78 runTest("test", 4); |
79 } | 79 } |
80 | 80 |
81 } | 81 } |