[DEBUG] build back sample

This commit is contained in:
Edouard DUPIN 2017-11-07 10:19:31 +01:00
parent 8e594532a1
commit b872ff3646

View File

@ -107,6 +107,23 @@ TEST(TestShared, setInVoid) {
EXPECT_EQ(data.useCount(), 3);
}
class basicClass {
};
class heritedClass : public basicClass {
};
TEST(TestShared, heritage) {
ememory::SharedPtr<heritedClass> data = ememory::makeShared<heritedClass>();
ememory::SharedPtr<basicClass> data2 = data;
ememory::SharedPtr<basicClass> data3(data);
EXPECT_NE(data, nullptr);
EXPECT_NE(data2, nullptr);
EXPECT_NE(data3, nullptr);
}