Concept check for values that can be used in unit tests. More...
#include <gtsam/base/concepts.h>
#include <functional>
#include <iostream>
#include <memory>
#include <string>
Go to the source code of this file.
Classes | |
struct | gtsam::equals< V > |
struct | gtsam::equals_star< V > |
struct | gtsam::HasTestablePrereqs< T > |
Requirements on type to pass it to Testable template below. More... | |
class | gtsam::IsTestable< T > |
struct | gtsam::Testable< T > |
struct | gtsam::traits< T > |
Namespaces | |
gtsam | |
traits | |
Macros | |
#define | GTSAM_CONCEPT_TESTABLE_INST(T) template class gtsam::IsTestable<T>; |
#define | GTSAM_CONCEPT_TESTABLE_TYPE(T) using _gtsam_Testable_##T = gtsam::IsTestable<T>; |
#define | GTSAM_PRINT(x) ((x).print(#x)) |
Functions | |
template<class V > | |
bool | gtsam::assert_equal (const V &expected, const V &actual, double tol=1e-9) |
template<class T > | |
bool | gtsam::equal (const T &obj1, const T &obj2) |
template<class T > | |
bool | gtsam::equal (const T &obj1, const T &obj2, double tol) |
void | gtsam::print (double v, const std::string &s="") |
void | gtsam::print (float v, const std::string &s="") |
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 PriorFactor for an example equals is not supposed to print out anything, just return true|false bool equals(const Derived& expected, double tol) const = 0;
Definition in file Testable.h.
#define GTSAM_CONCEPT_TESTABLE_INST | ( | T | ) | template class gtsam::IsTestable<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
Definition at line 176 of file Testable.h.
#define GTSAM_CONCEPT_TESTABLE_TYPE | ( | T | ) | using _gtsam_Testable_##T = gtsam::IsTestable<T>; |
Definition at line 177 of file Testable.h.