|
|
@@ -23,13 +23,17 @@ import net.ranides.assira.junit.TestContract;
|
|
|
*
|
|
|
* @author Ranides Atterwim <ranides@gmail.com>
|
|
|
*/
|
|
|
+@SuppressWarnings({
|
|
|
+ "PMD.JUnit4TestShouldUseTestAnnotation",
|
|
|
+ "PMD.MethodNameRules"
|
|
|
+})
|
|
|
public class NativeArrayTester<K> {
|
|
|
|
|
|
@Resource(name = "collection!")
|
|
|
private TCollection<K> $var;
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicCompare(Function<int[], NativeArray> f) {
|
|
|
+ public void testCompare(Function<int[], NativeArray> f) {
|
|
|
NativeArray a = f.apply(new int[]{1,3,5,7});
|
|
|
NativeArray b = f.apply(new int[]{1,3,5,7});
|
|
|
NativeArray c = f.apply(new int[]{1,3,5});
|
|
|
@@ -56,7 +60,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicCompare_cmp(Function<int[], NativeArray> f) {
|
|
|
+ public void testCompare_cmp(Function<int[], NativeArray> f) {
|
|
|
Comparator cmp = CompareUtils.comparator().reversed();
|
|
|
|
|
|
NativeArray a = f.apply(new int[]{1,3,5,7});
|
|
|
@@ -85,7 +89,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicEquals(Function<int[], NativeArray> f) {
|
|
|
+ public void testEquals(Function<int[], NativeArray> f) {
|
|
|
NativeArray a = f.apply(new int[]{1,3,5,7});
|
|
|
NativeArray b = f.apply(new int[]{1,3,5,7});
|
|
|
NativeArray c = f.apply(new int[]{1,3,5});
|
|
|
@@ -98,7 +102,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicSet(Function<int[], NativeArray> f) {
|
|
|
+ public void testSet(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7});
|
|
|
target.set(0, $var.item(4).value());
|
|
|
target.set(1, $var.item(6).value());
|
|
|
@@ -121,7 +125,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicMove(Function<int[], NativeArray> f) {
|
|
|
+ public void testMove(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7});
|
|
|
|
|
|
target.move(0,1);
|
|
|
@@ -143,7 +147,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicSwap(Function<int[], NativeArray> f) {
|
|
|
+ public void testSwap(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7,2,4});
|
|
|
|
|
|
target.swap(0,1);
|
|
|
@@ -161,7 +165,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicLRCompare(Function<int[], NativeArray> f) {
|
|
|
+ public void testLRCompare(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7});
|
|
|
|
|
|
NativeComparator lcmp = target.lcmp($var.item(4).value());
|
|
|
@@ -179,7 +183,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicLRCompare_cmp(Function<int[], NativeArray> f) {
|
|
|
+ public void testLRCompare_cmp(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7});
|
|
|
|
|
|
NativeComparator lcmp = target.lcmp($var.item(4).value(), CompareUtils.comparator().reversed());
|
|
|
@@ -197,7 +201,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicEQCompare(Function<int[], NativeArray> f) {
|
|
|
+ public void testEQCompare(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7});
|
|
|
|
|
|
IntPredicate cmp = target.cmp($var.item(4).value());
|
|
|
@@ -210,7 +214,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicComparator(Function<int[], NativeArray> f) {
|
|
|
+ public void testComparator(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7,2});
|
|
|
IntComparator icmp = target.comparator();
|
|
|
|
|
|
@@ -233,7 +237,7 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicComparator_cmp(Function<int[], NativeArray> f) {
|
|
|
+ public void testComparator_cmp(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7,2});
|
|
|
IntComparator icmp = target.comparator(CompareUtils.comparator().reversed());
|
|
|
|
|
|
@@ -256,14 +260,14 @@ public class NativeArrayTester<K> {
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicToString(Function<int[], NativeArray> f) {
|
|
|
+ public void testToString(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5,7,2});
|
|
|
String exp = $var.list(1,3,5,7,2).into(new ArrayList<>()).toString();
|
|
|
assertEquals(exp, target.toString());
|
|
|
}
|
|
|
|
|
|
@TestContract
|
|
|
- public void basicAllocate(Function<int[], NativeArray> f) {
|
|
|
+ public void testAllocate(Function<int[], NativeArray> f) {
|
|
|
NativeArray target = f.apply(new int[]{1,3,5});
|
|
|
NativeArray z = target.allocate(0);
|
|
|
assertEquals(0, z.size());
|