use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_longs_special_case_1.
@org.junit.Test
public void arrayAsReturnType_longs_special_case_1() {
final List<Long> is = new ArrayList<Long>();
final List<Long> js = new ArrayList<Long>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
long[][] longs = { { 234l, 234245435l }, { 89000004l, 2345234573450l } };
@TestCase
@TestData("longs")
public void test(long i, long j) throws Throwable {
is.add(i);
js.add(j);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(2, is.size());
Assert.assertEquals(2, js.size());
Assert.assertEquals(234l, (long) is.get(0));
Assert.assertEquals(234245435l, (long) js.get(0));
Assert.assertEquals(89000004l, (long) is.get(1));
Assert.assertEquals(2345234573450l, (long) js.get(1));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_booleans.
@org.junit.Test
public void arrayAsReturnType_booleans() {
final Set<Boolean> set = new HashSet<Boolean>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
boolean[] booleans = { true, false };
@TestCase
public void test(@TestData("booleans") boolean b) throws Throwable {
set.add(b);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(2, set.size());
Assert.assertTrue(set.contains(true));
Assert.assertTrue(set.contains(false));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_ints.
// ----------------------------------------------------------------------------------------
@org.junit.Test
public void arrayAsReturnType_ints() {
final Set<Integer> set = new HashSet<Integer>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
int[] ints = { 1, 23, 7, 9 };
@TestCase
public void test(@TestData("ints") int i) {
set.add(i);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(4, set.size());
Assert.assertTrue(set.contains(1));
Assert.assertTrue(set.contains(23));
Assert.assertTrue(set.contains(7));
Assert.assertTrue(set.contains(9));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_float.
@org.junit.Test
public void arrayAsReturnType_float() {
final Set<Float> set = new HashSet<Float>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
float[] floats = { 0.787878f, 73.f, 48324.234f, Float.MIN_VALUE };
@TestCase
public void test(@TestData("floats") float f) throws Throwable {
set.add(f);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(4, set.size());
Assert.assertTrue(set.contains(0.787878f));
Assert.assertTrue(set.contains(73.f));
Assert.assertTrue(set.contains(48324.234f));
Assert.assertTrue(set.contains(Float.MIN_VALUE));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_short.
@org.junit.Test
public void arrayAsReturnType_short() {
final Set<Short> set = new HashSet<Short>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
short[] shorts = { Short.MIN_VALUE, (short) 938576, (short) 23487, (short) 809, (short) 43 };
@TestCase
public void test(@TestData("shorts") short s) throws Throwable {
set.add(s);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(5, set.size());
Assert.assertTrue(set.contains(Short.MIN_VALUE));
Assert.assertTrue(set.contains((short) 938576));
Assert.assertTrue(set.contains((short) 23487));
Assert.assertTrue(set.contains((short) 809));
Assert.assertTrue(set.contains((short) 43));
}
Aggregations