14 #include <gtest/gtest.h> 34 TEST(NavTests, Serialization_WriteReadToMem)
53 catch (std::exception& e)
55 GTEST_FAIL() <<
"Exception during serialization test for class '" 63 TEST(SerializeTestObs, WriteReadToOctectVectors)
69 std::vector<uint8_t> buf;
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
107 for (
int i = 0; i < 2; i++)
110 arch.ReadObject(&lfr);
113 catch (std::exception& e)
115 FAIL() <<
"Failed to parse stored navlog. Exception was:\n" bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
void ObjectToOctetVector(const CSerializable *o, std::vector< uint8_t > &out_vector)
Converts (serializes) an MRPT object into an array of bytes.
A structure that holds runtime class type information.
A class for storing, saving and loading a reactive navigation log record for the CReactiveNavigationS...
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream, std::istream, std::ostream, std::stringstream
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
void OctetVectorToObject(const std::vector< uint8_t > &in_data, CSerializable::Ptr &obj)
Converts back (de-serializes) a sequence of binary data into a MRPT object, without prior information...
This CStream derived class allow using a memory buffer as a CStream.
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource...
GLsizei const GLchar ** string
TEST(NavTests, Serialization_WriteReadToMem)
std::string MRPT_GLOBAL_UNITTEST_SRC_DIR
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
const mrpt::rtti::TRuntimeClassId * lstClasses[]
mrpt::rtti::CObject * createObject() const