SpiecsEngine
 
Loading...
Searching...
No Matches

◆ TEST() [7/59]

SpicesTest::TEST ( ClassTraits_test ,
GetProperty_V  )

Testing Spices::class_traits::GetProperty_V.

Definition at line 226 of file ClassTraits_test.h.

226 {
227
229
230 using namespace Spices;
231
232 auto ClassTraitsTestTraits = Spices::class_traits_i(inst);
233
234 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<int>("i"), &inst.i);
235 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<std::reference_wrapper<int>>("ir"), &inst.ir);
236 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<int*>("ip"), &inst.ip);
237 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<std::reference_wrapper<int*>>("ipr"), &inst.ipr);
238 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<int**>("ipp"), &inst.ipp);
239
240 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<const int>("ci"), &inst.ci);
241 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<std::reference_wrapper<const int>>("cir"), &inst.cir);
242 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<const int*>("cip"), &inst.cip);
243 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<std::reference_wrapper<const int*>>("cipr"), &inst.cipr);
244 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<const int**>("cipp"), &inst.cipp);
245
246 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<const int const*>("cicp"), &inst.cicp);
247 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<std::reference_wrapper<const int const* const>>("cicpcr"), &inst.cicpcr);
248
249 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<int>("si"), &inst.si);
250 EXPECT_EQ(ClassTraitsTestTraits.GetProperty_V<volatile int >("vi"), &inst.vi);
251 }
#define SPICESTEST_PROFILE_FUNCTION()
std::reference_wrapper< const int > cir
std::reference_wrapper< int * > ipr
std::reference_wrapper< const int * > cipr
std::reference_wrapper< const int const *const > cicpcr
std::reference_wrapper< int > ir
auto class_traits_i(T &inst)
Get class_traits instance of class.

References Spices::inst.