private static void throwNotEqualAssertionError(String messagePrefix, String expectedAsString, String actualAsString) { throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, null); }
/** * Asserts on a per component basis that the two spatial vectors are equal to an {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the automated message. * @param expected the expected spatial vector. Not modified. * @param actual the actual spatial vector. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two spatial vectors are not equal. If only one of the arguments * is equal to {@code null}. */ public static void assertSpatialVectorEquals(String messagePrefix, SpatialVectorReadOnly expected, SpatialVectorReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (!(expected != null && actual != null)) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (!expected.epsilonEquals(actual, epsilon)) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } }
/** * Asserts on a per component basis that the two spatial inertia matrices are equal to an * {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the automated message. * @param expected the expected spatial inertia matrix. Not modified. * @param actual the actual spatial inertia matrix. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two spatial inertia matrices are not equal. If only one of the * arguments is equal to {@code null}. */ public static void assertSpatialInertiaEquals(String messagePrefix, SpatialInertiaReadOnly expected, SpatialInertiaReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (!(expected != null && actual != null)) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (!expected.epsilonEquals(actual, epsilon)) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } }
/** * Asserts on a per component basis that the two twists are equal to an {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the automated message. * @param expected the expected twist. Not modified. * @param actual the actual spatial twist. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two twists are not equal. If only one of the arguments is equal * to {@code null}. */ public static void assertTwistEquals(String messagePrefix, TwistReadOnly expected, TwistReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (!(expected != null && actual != null)) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (!expected.epsilonEquals(actual, epsilon)) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } }
/** * Asserts on a per component basis that the two wrenches are equal to an {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the automated message. * @param expected the expected wrench. Not modified. * @param actual the actual wrench. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two wrenches are not equal. If only one of the arguments is * equal to {@code null}. */ public static void assertWrenchEquals(String messagePrefix, WrenchReadOnly expected, WrenchReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (!(expected != null && actual != null)) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (!expected.epsilonEquals(actual, epsilon)) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } }
/** * Asserts on a per component basis that the two spatial force vectors are equal to an * {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the automated message. * @param expected the expected spatial force vector. Not modified. * @param actual the actual spatial force vector. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two spatial force vectors are not equal. If only one of the * arguments is equal to {@code null}. */ public static void assertSpatialForceEquals(String messagePrefix, SpatialForceReadOnly expected, SpatialForceReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (!(expected != null && actual != null)) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (!expected.epsilonEquals(actual, epsilon)) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } }
/** * Asserts on a per component basis that the two momentum vectors are equal to an * {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the automated message. * @param expected the expected momentum vector. Not modified. * @param actual the actual momentum vector. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two momentum vectors are not equal. If only one of the arguments * is equal to {@code null}. */ public static void assertMomentumEquals(String messagePrefix, MomentumReadOnly expected, MomentumReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (!(expected != null && actual != null)) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (!expected.epsilonEquals(actual, epsilon)) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } }
/** * Asserts on a per component basis that the two spatial acceleration vectors are equal to an * {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the automated message. * @param expected the expected spatial acceleration vector. Not modified. * @param actual the actual spatial acceleration vector. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two spatial acceleration vectors are not equal. If only one of * the arguments is equal to {@code null}. */ public static void assertSpatialAccelerationEquals(String messagePrefix, SpatialAccelerationReadOnly expected, SpatialAccelerationReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (!(expected != null && actual != null)) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (!expected.epsilonEquals(actual, epsilon)) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } }
private static void throwNotEqualAssertionError(String messagePrefix, SpatialInertiaReadOnly expected, SpatialInertiaReadOnly actual, String format) { String expectedAsString = getSpatialInertiaString(format, expected); String actualAsString = getSpatialInertiaString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString); }
private static void throwNotEqualAssertionError(String messagePrefix, SpatialAccelerationReadOnly expected, SpatialAccelerationReadOnly actual, String format) { String expectedAsString = getSpatialAccelerationString(format, expected); String actualAsString = getSpatialAccelerationString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, Double.toString(computeNormError(expected, actual))); }
private static void throwNotEqualAssertionError(String messagePrefix, SpatialVectorReadOnly expected, SpatialVectorReadOnly actual, String format) { String expectedAsString = getSpatialVectorString(format, expected); String actualAsString = getSpatialVectorString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, Double.toString(computeNormError(expected, actual))); }
private static void throwNotEqualAssertionError(String messagePrefix, SpatialForceReadOnly expected, SpatialForceReadOnly actual, String format) { String expectedAsString = getSpatialForceString(format, expected); String actualAsString = getSpatialForceString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, Double.toString(computeNormError(expected, actual))); }
private static void throwNotEqualAssertionError(String messagePrefix, TwistReadOnly expected, TwistReadOnly actual, String format) { String expectedAsString = getTwistString(format, expected); String actualAsString = getTwistString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, Double.toString(computeNormError(expected, actual))); }
private static void throwNotEqualAssertionError(String messagePrefix, MomentumReadOnly expected, MomentumReadOnly actual, String format) { String expectedAsString = getMomentumString(format, expected); String actualAsString = getMomentumString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, Double.toString(computeNormError(expected, actual))); }
private static void throwNotEqualAssertionError(String messagePrefix, WrenchReadOnly expected, WrenchReadOnly actual, String format) { String expectedAsString = getWrenchString(format, expected); String actualAsString = getWrenchString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, Double.toString(computeNormError(expected, actual))); }