13 #include <gtest/gtest.h>
35 TEST(NavTests, Serialization_WriteReadToMem)
53 catch (std::exception& e)
55 GTEST_FAIL() <<
"Exception during serialization test for class '"
63 TEST(SerializeTestObs, WriteReadToOctectVectors)
80 catch (std::exception& e)
82 GTEST_FAIL() <<
"Exception during serialization test for class '"
90 TEST(NavTests, NavLogLoadFromTestFile)
92 const string navlog_file =
94 string(
"/tests/serialize_test_data.reactivenavlog");
97 cerr <<
"WARNING: Skipping test due to missing file: " << navlog_file
106 for (
int i = 0; i < 2; i++)
112 catch (std::exception& e)
114 FAIL() <<
"Failed to parse stored navlog. Exception was:\n"
const mrpt::utils::TRuntimeClassId * lstClasses[]
TEST(NavTests, Serialization_WriteReadToMem)
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
This CStream derived class allow using a memory buffer as a CStream.
uint64_t Seek(uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource.
The virtual base class which provides a unified interface for all persistent objects in MRPT.
std::shared_ptr< CSerializable > Ptr
CSerializable::Ptr ReadObject()
Reads an object from stream, its class determined at runtime, and returns a smart pointer to the obje...
GLsizei const GLchar ** string
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
std::vector< uint8_t > vector_byte
void OctetVectorToObject(const vector_byte &in_data, CSerializable::Ptr &obj)
Converts back (de-serializes) a sequence of binary data into a MRPT object, without prior information...
void ObjectToOctetVector(const CSerializable *o, vector_byte &out_vector)
Converts (serializes) an MRPT object into an array of bytes.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
std::string MRPT_GLOBAL_UNITTEST_SRC_DIR
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A structure that holds runtime class type information.
mrpt::utils::CObject * createObject() const