Package boofcv.testing
Class CompareEquivalentFunctions
- java.lang.Object
-
- boofcv.testing.CompareEquivalentFunctions
-
- Direct Known Subclasses:
CompareIdenticalFunctions
public abstract class CompareEquivalentFunctions extends java.lang.ObjectProvides a formalism for comparing two sets of functions which should produce identical results.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean[]ignoreSubimageprotected java.lang.reflect.MethodmethodTestprotected java.lang.reflect.MethodmethodValidation
-
Constructor Summary
Constructors Modifier Constructor Description protectedCompareEquivalentFunctions(java.lang.Class<?> testClass, java.lang.Class<?>... validationClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcompareMethod(java.lang.Class<?> validationClass, java.lang.reflect.Method target, java.lang.String validationName)Allows directly comparing two functions to each other without going through all the other functionsvoidcompareMethod(java.lang.reflect.Method target, java.lang.String validationName)protected abstract voidcompareResults(java.lang.Object targetResult, java.lang.Object[] targetParam, java.lang.Object validationResult, java.lang.Object[] validationParam)Compares the two sets of results from the target and validation methods.protected abstract java.lang.Object[][]createInputParam(java.lang.reflect.Method candidate, java.lang.reflect.Method validation)Creates the set of input parameters for the functions.protected java.lang.Object[]createSubImageInputs(java.lang.Object[] param)protected abstract booleanisEquivalent(java.lang.reflect.Method candidate, java.lang.reflect.Method validation)Returns two if the two methods provide results that should be comparedprotected abstract booleanisTestMethod(java.lang.reflect.Method m)Checks to see if the provided method from the test class is a method that should be testedvoidperformTests(int numMethods)protected abstract java.lang.Object[]reformatForValidation(java.lang.reflect.Method m, java.lang.Object[] targetParam)Adjusts the input for the validation method.
-
-
-
Method Detail
-
performTests
public void performTests(int numMethods)
-
compareMethod
public void compareMethod(java.lang.Class<?> validationClass, java.lang.reflect.Method target, java.lang.String validationName)Allows directly comparing two functions to each other without going through all the other functions- Parameters:
target- The method being comparedvalidationName- Name of the method in the validation class
-
compareMethod
public void compareMethod(java.lang.reflect.Method target, java.lang.String validationName)
-
createSubImageInputs
protected java.lang.Object[] createSubImageInputs(java.lang.Object[] param)
-
isTestMethod
protected abstract boolean isTestMethod(java.lang.reflect.Method m)
Checks to see if the provided method from the test class is a method that should be tested
-
isEquivalent
protected abstract boolean isEquivalent(java.lang.reflect.Method candidate, java.lang.reflect.Method validation)Returns two if the two methods provide results that should be compared
-
createInputParam
protected abstract java.lang.Object[][] createInputParam(java.lang.reflect.Method candidate, java.lang.reflect.Method validation)Creates the set of input parameters for the functions. Tests on multiple inputs are handled by returning multiple sets of parameters
-
reformatForValidation
protected abstract java.lang.Object[] reformatForValidation(java.lang.reflect.Method m, java.lang.Object[] targetParam)Adjusts the input for the validation method. Allows methods with different parameter sets to be used.
-
compareResults
protected abstract void compareResults(java.lang.Object targetResult, java.lang.Object[] targetParam, java.lang.Object validationResult, java.lang.Object[] validationParam)Compares the two sets of results from the target and validation methods.
-
-