/** * 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. * @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) { assertTwistEquals(messagePrefix, expected, actual, epsilon, DEFAULT_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 expected the expected spatial acceleration vector. Not modified. * @param actual the actual spatial acceleration vector. Not modified. * @param epsilon the tolerance to use. * @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(SpatialAccelerationReadOnly expected, SpatialAccelerationReadOnly actual, double epsilon) { assertSpatialAccelerationEquals(null, expected, actual, epsilon); }
/** * 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. * @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) { assertSpatialForceEquals(messagePrefix, expected, actual, epsilon, DEFAULT_FORMAT); }
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))); }
/** * 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. * @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) { assertWrenchEquals(messagePrefix, expected, actual, epsilon, DEFAULT_FORMAT); }
/** * 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 expected the expected spatial vector. Not modified. * @param actual the actual spatial vector. Not modified. * @param epsilon the tolerance to use. * @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(SpatialVectorReadOnly expected, SpatialVectorReadOnly actual, double epsilon) { assertSpatialVectorEquals(null, expected, actual, epsilon); }
/** * 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 expected the expected spatial inertia matrix. Not modified. * @param actual the actual spatial inertia matrix. Not modified. * @param epsilon the tolerance to use. * @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(SpatialInertiaReadOnly expected, SpatialInertiaReadOnly actual, double epsilon) { assertSpatialInertiaEquals(null, expected, actual, epsilon); }
/** * 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 expected the expected momentum vector. Not modified. * @param actual the actual momentum vector. Not modified. * @param epsilon the tolerance to use. * @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(MomentumReadOnly expected, MomentumReadOnly actual, double epsilon) { assertMomentumEquals(null, expected, actual, epsilon); }
private static void throwNotEqualAssertionError(String messagePrefix, String expectedAsString, String actualAsString, String differenceAsString) { String errorMessage = addPrefixToMessage(messagePrefix, "expected:\n" + expectedAsString + "\n but was:\n" + actualAsString); if (differenceAsString != null) errorMessage += "\nDifference of: " + differenceAsString; throw new AssertionError(errorMessage); }
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))); }
/** * 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 expected the expected wrench. Not modified. * @param actual the actual wrench. Not modified. * @param epsilon the tolerance to use. * @throws AssertionError if the two wrenches are not equal. If only one of the arguments is * equal to {@code null}. */ public static void assertWrenchEquals(WrenchReadOnly expected, WrenchReadOnly actual, double epsilon) { assertWrenchEquals(null, expected, actual, epsilon); }
/** * 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. * @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) { assertSpatialVectorEquals(messagePrefix, expected, actual, epsilon, DEFAULT_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. * @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) { assertSpatialInertiaEquals(messagePrefix, expected, actual, epsilon, DEFAULT_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. * @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) { assertMomentumEquals(messagePrefix, expected, actual, epsilon, DEFAULT_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 expected the expected twist. Not modified. * @param actual the actual spatial twist. Not modified. * @param epsilon the tolerance to use. * @throws AssertionError if the two twists are not equal. If only one of the arguments is equal * to {@code null}. */ public static void assertTwistEquals(TwistReadOnly expected, TwistReadOnly actual, double epsilon) { assertTwistEquals(null, expected, actual, epsilon); }
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))); }
/** * 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 expected the expected spatial force vector. Not modified. * @param actual the actual spatial force vector. Not modified. * @param epsilon the tolerance to use. * @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(SpatialForceReadOnly expected, SpatialForceReadOnly actual, double epsilon) { assertSpatialForceEquals(null, expected, actual, epsilon); }
/** * 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. * @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) { assertSpatialAccelerationEquals(messagePrefix, expected, actual, epsilon, DEFAULT_FORMAT); }
expectedTwist.changeFrame(entry.getValue()); MecanoTestTools.assertTwistEquals(expectedTwist, actualTwist, 1.0e-5);
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))); }