Mercurial > hg > truffle
comparison graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/except/BC_bastore.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_bastore { | 30 public class BC_bastore extends JTTTest { |
30 | 31 |
31 static boolean[] arr = {false, false, false, false}; | 32 static boolean[] arr = {false, false, false, false}; |
32 | 33 |
33 public static boolean test(int arg, boolean val) { | 34 public static boolean test(int arg, boolean val) { |
34 final boolean[] array = arg == -2 ? null : arr; | 35 final boolean[] array = arg == -2 ? null : arr; |
35 array[arg] = val; | 36 array[arg] = val; |
36 return array[arg]; | 37 return array[arg]; |
37 } | 38 } |
38 | 39 |
39 @Test(expected = java.lang.NullPointerException.class) | 40 @Test |
40 public void run0() throws Throwable { | 41 public void run0() throws Throwable { |
41 test(-2, true); | 42 runTest("test", -2, true); |
42 } | 43 } |
43 | 44 |
44 @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class) | 45 @Test |
45 public void run1() throws Throwable { | 46 public void run1() throws Throwable { |
46 test(-1, false); | 47 runTest("test", -1, false); |
47 } | 48 } |
48 | 49 |
49 @Test | 50 @Test |
50 public void run2() throws Throwable { | 51 public void run2() throws Throwable { |
51 Assert.assertEquals(true, test(0, true)); | 52 runTest("test", 0, true); |
52 } | 53 } |
53 | 54 |
54 @Test(expected = java.lang.ArrayIndexOutOfBoundsException.class) | 55 @Test |
55 public void run3() throws Throwable { | 56 public void run3() throws Throwable { |
56 test(4, true); | 57 runTest("test", 4, true); |
57 } | 58 } |
58 | 59 |
59 } | 60 } |