MRPT  1.9.9
typename_unittest.cpp File Reference
#include <mrpt/typemeta/TTypeName.h>
#include <mrpt/typemeta/TTypeName_stl.h>
#include <gtest/gtest.h>
#include <iostream>
#include <memory>
Include dependency graph for typename_unittest.cpp:

Go to the source code of this file.

Classes

struct  MyFooClass
 [example typename] More...
 
struct  MyNS::MyBarClass
 
struct  MyNS::MyBarClass2
 

Namespaces

 MyNS
 [example-define-class]
 

Macros

#define TST_FOR_TYPE(__TSTTYPE)   EXPECT_STREQ(#__TSTTYPE, TTypeName<__TSTTYPE>::get().c_str())
 
#define TST_FOR_TYPE2(__TSTTYPE, __TSTTYPE2ndpart)
 

Functions

 DECLARE_CUSTOM_TTYPENAME (MyFooClass)
 
 DECLARE_CUSTOM_TTYPENAME (MyNS::MyBarClass)
 
 TEST (TTypeName, types2str)
 
 TEST (TTypeName, types2str_shared_ptr)
 
 TEST (TTypeName, types2stdstring)
 

Macro Definition Documentation

◆ TST_FOR_TYPE

#define TST_FOR_TYPE (   __TSTTYPE)    EXPECT_STREQ(#__TSTTYPE, TTypeName<__TSTTYPE>::get().c_str())

Definition at line 34 of file typename_unittest.cpp.

Referenced by TEST().

◆ TST_FOR_TYPE2

#define TST_FOR_TYPE2 (   __TSTTYPE,
  __TSTTYPE2ndpart 
)
Value:
if (std::string(#__TSTTYPE "," #__TSTTYPE2ndpart) != \
GTEST_FAIL() << "Failed: " << #__TSTTYPE "," #__TSTTYPE2ndpart \
<< "\n Computed type is: " \
<< endl;
A template to obtain the type of its argument as a string at compile time.
Definition: TTypeName.h:65
GLsizei const GLchar ** string
Definition: glext.h:4101

Definition at line 38 of file typename_unittest.cpp.

Referenced by TEST().

Function Documentation

◆ DECLARE_CUSTOM_TTYPENAME() [1/2]

DECLARE_CUSTOM_TTYPENAME ( MyFooClass  )

◆ DECLARE_CUSTOM_TTYPENAME() [2/2]

DECLARE_CUSTOM_TTYPENAME ( MyNS::MyBarClass  )

◆ TEST() [1/3]

TEST ( TTypeName  ,
types2str   
)

Definition at line 46 of file typename_unittest.cpp.

References TST_FOR_TYPE, and TST_FOR_TYPE2.

◆ TEST() [2/3]

TEST ( TTypeName  ,
types2str_shared_ptr   
)

Definition at line 78 of file typename_unittest.cpp.

References TST_FOR_TYPE.

◆ TEST() [3/3]

TEST ( TTypeName  ,
types2stdstring   
)

Definition at line 89 of file typename_unittest.cpp.

References mrpt::typemeta::TTypeName< T >::get().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020