Skip to content

Commit 880ac5b

Browse files
committed
add FP test
1 parent 7521123 commit 880ac5b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/testclass.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class TestClass : public TestFixture {
6363
TEST_CASE(copyConstructor5); // multiple inheritance
6464
TEST_CASE(copyConstructor6); // array of pointers
6565
TEST_CASE(copyConstructor7);
66+
TEST_CASE(copyConstructor8);
6667
TEST_CASE(deletedMemberPointer); // deleted member pointer in destructor
6768
TEST_CASE(noOperatorEq); // class with memory management should have operator eq
6869
TEST_CASE(noDestructor); // class with memory management should have destructor
@@ -1105,6 +1106,15 @@ class TestClass : public TestFixture {
11051106
ASSERT_EQUALS("[test.cpp:2:30]: (warning) Struct 'S' does not have a copy constructor which is recommended since it has dynamic memory/resource management. [noCopyConstructor]\n", errout_str());
11061107
}
11071108

1109+
void copyConstructor8() {
1110+
checkCopyConstructor("struct S {\n"
1111+
" S() : m_ptr(new int) {}\n"
1112+
" ~S();\n"
1113+
" std::unique_ptr<int> m_ptr;\n"
1114+
"};\n");
1115+
ASSERT_EQUALS("", errout_str());
1116+
}
1117+
11081118
void deletedMemberPointer() {
11091119

11101120
// delete ...

0 commit comments

Comments
 (0)