10 #include <gtest/gtest.h>    15 #include <test_mrpt_common.h>    29 TEST(NavTests, Serialization_WriteReadToMem)
    47         catch (
const std::exception& e)
    49             GTEST_FAIL() << 
"Exception during serialization test for class '"    50                          << cl->className << 
"':\n"    57 TEST(SerializeTestObs, WriteReadToOctectVectors)
    63             std::vector<uint8_t> buf;
    73         catch (
const std::exception& e)
    75             GTEST_FAIL() << 
"Exception during serialization test for class '"    76                          << cl->className << 
"':\n"    83 TEST(NavTests, NavLogLoadFromTestFile)
    85     const string navlog_file =
    86         UNITTEST_BASEDIR + string(
"/tests/serialize_test_data.reactivenavlog");
    89         cerr << 
"WARNING: Skipping test due to missing file: " << navlog_file
    99         for (
int i = 0; i < 2; i++)
   102             arch.ReadObject(&lfr);
   105     catch (
const std::exception& e)
   107         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...
 
TEST(NavTests, Serialization_WriteReadToMem)
 
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries. 
 
static CAST_TO::Ptr from(const CAST_FROM_PTR &ptr)
 
const mrpt::rtti::TRuntimeClassId * lstClasses[]