Mercurial > hg > truffle
comparison graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_aaload0.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 | 64dcb92ee75a |
comparison
equal
deleted
inserted
replaced
7281:e960cda050d7 | 7282:390448a6b535 |
---|---|
22 */ | 22 */ |
23 /* | 23 /* |
24 */ | 24 */ |
25 package com.oracle.graal.jtt.except; | 25 package com.oracle.graal.jtt.except; |
26 | 26 |
27 import com.oracle.graal.jtt.*; | |
27 import org.junit.*; | 28 import org.junit.*; |
28 | 29 |
29 public class BC_aaload0 { | 30 public class BC_aaload0 extends JTTTest { |
30 | 31 |
31 static Object[] array = {null, null, ""}; | 32 static Object[] array = {null, null, ""}; |
32 | 33 |
33 public static Object test(int arg) { | 34 public static Object test(int arg) { |
34 final Object[] obj = arg == -2 ? null : array; | 35 final Object[] obj = arg == -2 ? null : array; |
35 return obj[arg]; | 36 return obj[arg]; |
36 } | 37 } |
37 | 38 |
38 @Test(expected = java.lang.NullPointerException.class) | 39 @Test |
39 public void run0() throws Throwable { | 40 public void run0() throws Throwable { |
40 test(-2); | 41 runTest("test", -2); |
41 } | 42 } |
42 | 43 |
43 @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class) | 44 @Test |
44 public void run1() throws Throwable { | 45 public void run1() throws Throwable { |
45 test(-1); | 46 runTest("test", -1); |
46 } | 47 } |
47 | 48 |
48 @Test | 49 @Test |
49 public void run2() throws Throwable { | 50 public void run2() throws Throwable { |
50 Assert.assertEquals(null, test(0)); | 51 runTest("test", 0); |
51 } | 52 } |
52 | 53 |
53 } | 54 } |