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" Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
std::string MRPT_GLOBAL_UNITTEST_SRC_DIR
std::vector< uint8_t > vector_byte
The virtual base class which provides a unified interface for all persistent objects in MRPT...
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...
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
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...
CSerializable::Ptr ReadObject()
Reads an object from stream, its class determined at runtime, and returns a smart pointer to the obje...
mrpt::utils::CObject * createObject() const
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
void ObjectToOctetVector(const CSerializable *o, vector_byte &out_vector)
Converts (serializes) an MRPT object into an array of bytes.
This CStream derived class allow using a memory buffer as a CStream.
GLsizei const GLchar ** string
const mrpt::utils::TRuntimeClassId * lstClasses[]
std::shared_ptr< CSerializable > Ptr
TEST(NavTests, Serialization_WriteReadToMem)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A structure that holds runtime class type information.