use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_long.
@org.junit.Test
public void arrayAsReturnType_long() {
final Set<Long> set = new HashSet<Long>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
long[] longs = { Long.MIN_VALUE, Long.MAX_VALUE, 523400023467l, 23424234332424l };
@TestCase
public void test(@TestData("longs") long l) throws Throwable {
set.add(l);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(4, set.size());
Assert.assertTrue(set.contains(Long.MIN_VALUE));
Assert.assertTrue(set.contains(Long.MAX_VALUE));
Assert.assertTrue(set.contains(523400023467l));
Assert.assertTrue(set.contains(23424234332424l));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_double.
@org.junit.Test
public void arrayAsReturnType_double() {
final Set<Double> set = new HashSet<Double>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
double[] doubles = { 0., 3.4, 67.3456, Double.MAX_VALUE };
@TestCase
public void test(@TestData("doubles") double d) throws Throwable {
set.add(d);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(4, set.size());
Assert.assertTrue(set.contains(0.));
Assert.assertTrue(set.contains(3.4));
Assert.assertTrue(set.contains(67.3456));
Assert.assertTrue(set.contains(Double.MAX_VALUE));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_byte.
@org.junit.Test
public void arrayAsReturnType_byte() {
final Set<Byte> set = new HashSet<Byte>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
byte[] bytes = { 0, 1, 120, 45, 8 };
@TestCase
public void test(@TestData("bytes") byte b) throws Throwable {
set.add(b);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(5, set.size());
Assert.assertTrue(set.contains((byte) 0));
Assert.assertTrue(set.contains((byte) 1));
Assert.assertTrue(set.contains((byte) 120));
Assert.assertTrue(set.contains((byte) 45));
Assert.assertTrue(set.contains((byte) 8));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_bytes_special_case_1.
@org.junit.Test
public void arrayAsReturnType_bytes_special_case_1() {
final List<Byte> is = new ArrayList<Byte>();
final List<Byte> js = new ArrayList<Byte>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
byte[][] bytes = { { 34, 12 }, { 89, 29 } };
@TestCase
@TestData("bytes")
public void test(byte i, byte 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(34, (byte) is.get(0));
Assert.assertEquals(12, (byte) js.get(0));
Assert.assertEquals(89, (byte) is.get(1));
Assert.assertEquals(29, (byte) js.get(1));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_doubles_special_case.
@org.junit.Test
public void arrayAsReturnType_doubles_special_case() {
final List<Double> is = new ArrayList<Double>();
final List<Double> js = new ArrayList<Double>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
double[][] doubles = { { 3.96786, 8678.18 } };
@TestCase
@TestData("doubles")
public void test(double i, double j) throws Throwable {
is.add(i);
js.add(j);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(1, is.size());
Assert.assertEquals(1, js.size());
Assert.assertEquals(3.96786, (double) is.get(0), 0.0001);
Assert.assertEquals(8678.18, (double) js.get(0), 0.0001);
}
Aggregations