MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / testLess

Method testLess

src/test/java/com/rtg/util/TestUtils.java:581–596  ·  view source on GitHub ↗

All pairs of items from the arrays should be not equal and if checkHash is true then their hashCodes should differ. All items from a should compare less than all the items from b. @param msg to be used when reporting errors. @param a lesser array to be checked. @param b greater array to be checked.

(final String msg, final T[] a, final T[] b, final boolean checkHash)

Source from the content-addressed store, hash-verified

579 * of hashCode it may be necessary to leave this false in some cases).
580 */
581 private static <T extends Comparable<T>> void testLess(final String msg, final T[] a, final T[] b, final boolean checkHash) {
582 for (int i = 0; i < a.length; ++i) {
583 final T ai = a[i];
584 for (int j = 0; j < b.length; ++j) {
585 final T bj = b[j];
586 final String m = msg + ": " + i + ":" + j + " : " + ai + " : " + bj;
587 Assert.assertTrue(m, ai.compareTo(bj) < 0);
588 Assert.assertTrue(m, bj.compareTo(ai) > 0);
589 Assert.assertFalse(m, ai.equals(bj));
590 Assert.assertFalse(m, bj.equals(ai));
591 if (checkHash) {
592 Assert.assertFalse(m, ai.hashCode() == bj.hashCode());
593 }
594 }
595 }
596 }
597
598 /**
599 * Take a string of LS (either platform) separated strings and split them into an array containing one string per line.

Callers 1

testOrderMethod · 0.95

Calls 5

assertTrueMethod · 0.80
assertFalseMethod · 0.80
compareToMethod · 0.45
equalsMethod · 0.45
hashCodeMethod · 0.45

Tested by

no test coverage detected