![]() |
Tesseract 0.28.4
|
Common Tesseract unit test utilities. More...
#include <tesseract/common/macros.h>#include <gtest/gtest.h>#include <tesseract/common/serialization.h>#include <tesseract/common/any_poly.h>#include <tesseract/common/utils.h>Typedefs | |
| template<typename SerializableType > | |
| using | tesseract::common::TestSerializationCompareFn = std::function< bool(const SerializableType &, const SerializableType &)> |
Functions | |
| template<typename SerializableType > | |
| bool | tesseract::common::testSerializationCompareEqual (const SerializableType &a, const SerializableType &b) |
| template<typename SerializableType > | |
| bool | tesseract::common::testSerializationComparePtrEqual (const SerializableType &a, const SerializableType &b) |
| template<typename SerializableType > | |
| void | tesseract::common::testSerialization (const SerializableType &object, const std::string &typename_string, TestSerializationCompareFn< SerializableType > compare=testSerializationCompareEqual< SerializableType >) |
| Tests serialization for a serializable type. | |
| template<typename SerializableTypeBase , typename SerializableTypeDerived > | |
| void | tesseract::common::testSerializationDerivedClass (const std::shared_ptr< SerializableTypeBase > &object, const std::string &typename_string) |
| Tests serialization for a serializable derived type. | |
| template<typename SerializableTypeStored > | |
| void | tesseract::common::testSerializationAnyPoly (const tesseract::common::AnyPoly &object, const std::string &typename_string, TestSerializationCompareFn< SerializableTypeStored > compare=testSerializationCompareEqual< SerializableTypeStored >) |
| Tests serialization for a serializable any poly type. | |
Common Tesseract unit test utilities.
| void tesseract::common::testSerialization | ( | const SerializableType & | object, |
| const std::string & | typename_string, | ||
| TestSerializationCompareFn< SerializableType > | compare = testSerializationCompareEqual<SerializableType> |
||
| ) |
Tests serialization for a serializable type.
Serializes the type to XML file, binary file, and XML string. It then deserializes it and calls the equality operator on the results
| object | Object to be serialized |
| typename_string | Prefix used for filepaths. Serialized files are put in /tmp/<typename_string>.<extension> |
| void tesseract::common::testSerializationDerivedClass | ( | const std::shared_ptr< SerializableTypeBase > & | object, |
| const std::string & | typename_string | ||
| ) |
Tests serialization for a serializable derived type.
Serializes the type to XML file, binary file, and XML string using the base type. It then deserializes it, casts it to the derived type, and calls the equality operator on the results
| object | Base class pointer to the object to be serialized |
| typename_string | Prefix used for filepaths. Serialized files are put in /tmp/<typename_string>.<extension> |
| void tesseract::common::testSerializationAnyPoly | ( | const tesseract::common::AnyPoly & | object, |
| const std::string & | typename_string, | ||
| TestSerializationCompareFn< SerializableTypeStored > | compare = testSerializationCompareEqual<SerializableTypeStored> |
||
| ) |
Tests serialization for a serializable any poly type.
Serializes the type to XML file, binary file, and XML string using the base type. It then deserializes it, casts it to the derived type, and calls the equality operator on the results
| object | Base class pointer to the object to be serialized |
| typename_string | Prefix used for filepaths. Serialized files are put in /tmp/<typename_string>.<extension> |