MRPT  1.9.9
Classes | Namespaces | Macros | Functions
typename_unittest.cpp File Reference
#include <gtest/gtest.h>
#include <mrpt/typemeta/TTypeName.h>
#include <mrpt/typemeta/TTypeName_stl.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:69

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().

Here is the call graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 5ec5114f2 Thu Feb 20 07:54:08 2020 +0100 at jue feb 20 08:00:10 CET 2020