diff options
-rw-r--r-- | tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index ed9206c..0cb08f9 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -73,6 +73,7 @@ private slots: void forwardDeclaration2(); void memoryManagement(); void downCast(); + void functionCallDownCast(); void upCast(); void qobjectWeakManagement(); void noSharedPointerFromWeakQObject(); @@ -503,6 +504,15 @@ void tst_QSharedPointer::downCast() QCOMPARE(DerivedData::derivedDestructorCounter, destructorCount + 1); } +void functionDataByValue(QSharedPointer<Data> p) { Q_UNUSED(p); }; +void functionDataByRef(const QSharedPointer<Data> &p) { Q_UNUSED(p); }; +void tst_QSharedPointer::functionCallDownCast() +{ + QSharedPointer<DerivedData> p(new DerivedData()); + functionDataByValue(p); + functionDataByRef(p); +} + void tst_QSharedPointer::upCast() { QSharedPointer<Data> baseptr = QSharedPointer<Data>(new DerivedData); |