5 #include <gtest/gtest.h>
9 TEST(LazyConstructor, Basic)
11 using ::uavcan::LazyConstructor;
13 LazyConstructor<std::string> a;
14 LazyConstructor<std::string> b;
17 ASSERT_FALSE(b.isConstructed());
24 b.construct<
const char*>(
"Hello world");
27 ASSERT_TRUE(b.isConstructed());
30 ASSERT_STRNE(a->c_str(), b->c_str());
33 ASSERT_EQ(*b,
"Hello world");
40 ASSERT_EQ(*a,
"Hello world");
42 LazyConstructor<std::string> c(a);