13 #include <gtest/gtest.h> 21 namespace mrpt {
namespace utils {
31 TEST(NavTests, Serialization_WriteReadToMem)
44 CSerializablePtr recons;
48 catch (std::exception &e)
51 "Exception during serialization test for class '" <<
lstClasses[i]->
className <<
"':\n" << e.what() << endl;
57 TEST(SerializeTestObs, WriteReadToOctectVectors)
70 CSerializablePtr recons;
73 catch (std::exception &e)
76 "Exception during serialization test for class '" <<
lstClasses[i]->
className <<
"':\n" << e.what() << endl;
85 TEST(NavTests, NavLogLoadFromTestFile)
90 cerr <<
"WARNING: Skipping test due to missing file: " << navlog_file <<
"\n";
104 catch (std::exception &e)
106 FAIL() <<
"Failed to parse stored navlog. Exception was:\n" << e.what() << endl;
void BASE_IMPEXP OctetVectorToObject(const vector_byte &in_data, CSerializablePtr &obj)
Converts back (de-serializes) a sequence of binary data into a MRPT object, without prior information...
CSerializablePtr ReadObject()
Reads an object from stream, its class determined at runtime, and returns a smart pointer to the obje...
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...
bool BASE_IMPEXP 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...
mrpt::utils::CObject * createObject() const
void BASE_IMPEXP 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[]
TEST(NavTests, Serialization_WriteReadToMem)
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) MRPT_OVERRIDE
Introduces a pure virtual method for moving to a specified position in the streamed resource...
A structure that holds runtime class type information.