|
gtsam
3.2.1
gtsam
|
Concept check for values that can be used in unit tests. More...
Go to the source code of this file.
Classes | |
| class | gtsam::TestableConcept< T > |
| struct | gtsam::equals< V > |
| Template to create a binary predicate. More... | |
| struct | gtsam::equals_star< V > |
| Binary predicate on shared pointers. More... | |
Namespaces | |
| gtsam | |
| Global functions in a separate testing namespace. | |
Macros | |
| #define | GTSAM_PRINT(x) ((x).print(#x)) |
| #define | GTSAM_CONCEPT_TESTABLE_INST(T) template class gtsam::TestableConcept<T>; |
| Macros for using the TestableConcept. More... | |
| #define | GTSAM_CONCEPT_TESTABLE_TYPE(T) typedef gtsam::TestableConcept<T> _gtsam_TestableConcept_##T; |
Functions | |
| template<class T > | |
| void | gtsam::print (const T &object, const std::string &s="") |
| Call print on the object. | |
| template<class T > | |
| bool | gtsam::equal (const T &obj1, const T &obj2, double tol) |
| Call equal on the object. | |
| template<class T > | |
| bool | gtsam::equal (const T &obj1, const T &obj2) |
| Call equal on the object without tolerance (use default tolerance) | |
| template<class V > | |
| bool | gtsam::assert_equal (const V &expected, const V &actual, double tol=1e-9) |
| This template works for any type with equals. | |
Concept check for values that can be used in unit tests.
The necessary functions to implement for Testable are defined below with additional details as to the interface. The concept checking function will check whether or not the function exists in derived class and throw compile-time errors.
print with optional string naming the object void print(const std::string& name) const = 0;
equality up to tolerance tricky to implement, see NoiseModelFactor1 for an example equals is not supposed to print out anything, just return true|false bool equals(const Derived& expected, double tol) const = 0;
| #define GTSAM_CONCEPT_TESTABLE_INST | ( | T | ) | template class gtsam::TestableConcept<T>; |
Macros for using the TestableConcept.
NOTE: intentionally not in the gtsam namespace to allow for classes not in the gtsam namespace to be more easily enforced as testable