/** * Asserts on a per component basis that the two frame tuples 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 frame tuple. Not modified. * @param actual the actual frame tuple. Not modified. * @param epsilon the tolerance to use. * @throws AssertionError if the two frame tuples are not equal or not expressed in the reference * frame. If only one of the arguments is equal to {@code null}. */ public static void assertFrameTuple2DEquals(FrameTuple2DReadOnly expected, FrameTuple2DReadOnly actual, double epsilon) { assertFrameTuple2DEquals(null, expected, actual, epsilon); }
/** * Asserts on a per component basis that the two frame tuples 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 frame tuple. Not modified. * @param actual the actual frame tuple. Not modified. * @param epsilon the tolerance to use. * @throws AssertionError if the two frame tuples are not equal or not expressed in the reference * frame. If only one of the arguments is equal to {@code null}. */ public static void assertFrameTuple2DEquals(String messagePrefix, FrameTuple2DReadOnly expected, FrameTuple2DReadOnly actual, double epsilon) { assertFrameTuple2DEquals(messagePrefix, expected, actual, epsilon, DEFAULT_FORMAT); }
@Test public void testSetMatchingFrame() throws Exception { Random random = new Random(544354); for (int i = 0; i < ITERATIONS; i++) { // Test setMatchingFrame(FrameTuple2DReadOnly other) ReferenceFrame sourceFrame = EuclidFrameRandomTools.nextReferenceFrame(random, true); ReferenceFrame destinationFrame = EuclidFrameRandomTools.nextReferenceFrame(random, true); FrameTuple2DReadOnly source = EuclidFrameRandomTools.nextFramePoint2D(random, sourceFrame); FrameVector2D actual = createEmptyFrameTuple(destinationFrame); actual.setMatchingFrame(source); FrameVector2D expected = new FrameVector2D(source); expected.changeFrame(destinationFrame); EuclidFrameTestTools.assertFrameTuple2DEquals(expected, actual, EPSILON); } }
@Test public void testSetMatchingFrame() throws Exception { Random random = new Random(544354); for (int i = 0; i < ITERATIONS; i++) { // Test setMatchingFrame(FrameTuple2DReadOnly other) ReferenceFrame sourceFrame = EuclidFrameRandomTools.nextReferenceFrame(random, true); ReferenceFrame destinationFrame = EuclidFrameRandomTools.nextReferenceFrame(random, true); FrameTuple2DReadOnly source = EuclidFrameRandomTools.nextFramePoint2D(random, sourceFrame); FramePoint2D actual = createEmptyFrameTuple(destinationFrame); actual.setMatchingFrame(source); FramePoint2D expected = new FramePoint2D(source); expected.changeFrame(destinationFrame); EuclidFrameTestTools.assertFrameTuple2DEquals(expected, actual, EPSILON); } }
assertTrue(framePoint2D.getReferenceFrame() == randomFrame); EuclidCoreTestTools.assertTuple2DEquals(randomTuple, framePoint2D, EPSILON); EuclidFrameTestTools.assertFrameTuple2DEquals(randomTuple, framePoint2D, EPSILON);