/** * Asserts, using reflection, that the methods, that are public and static, in * {@code typeHoldingStaticMethodsToTest} are properly checking and/or setting reference frames * of their arguments. * <p> * This assertion expects methods to be declaring arguments as read-only to inform that they are * used as input only, and as mutable to inform that they are the output(s). * </p> * <p> * Note that this does not perform any assertion for methods with only 1 frame argument. * </p> * <p> * This expects methods to throw a {@link ReferenceFrameMismatchException} to indicate that the * operation cannot be performed because at least two arguments are expressed in a different * reference frame. * </p> * * @param typeDeclaringStaticMethodsToTest the type in which the methods are to be tested. * @throws Throwable if an unexpected throwable has been thrown by a method at invocation time. */ public static void assertStaticMethodsCheckReferenceFrame(Class<?> typeDeclaringStaticMethodsToTest) throws Throwable { assertStaticMethodsCheckReferenceFrame(typeDeclaringStaticMethodsToTest, m -> true); }
@Test public void testReferenceFrameChecked() throws Throwable { EuclidFrameAPITestTools.assertStaticMethodsCheckReferenceFrame(EuclidFrameTools.class); }