diff options
Diffstat (limited to 'tests/auto/qsharedpointer/tst_qsharedpointer.cpp')
-rw-r--r-- | tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index 452e658..54fe65e 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -1755,6 +1755,13 @@ void tst_QSharedPointer::invalidConstructs_data() "QSharedPointer<Data> ptr1 = QSharedPointer<Data>(aData);\n" "QSharedPointer<Data> ptr2 = QSharedPointer<Data>(aData);\n"; + // two QObjects with the same pointer + QTest::newRow("same-pointer-to-qobject") + << &QTest::QExternalTest::tryRunFail + << "QObject *anObj = new QObject;\n" + "QSharedPointer<QObject> ptr1 = QSharedPointer<QObject>(anObj);\n" + "QSharedPointer<QObject> ptr2 = QSharedPointer<QObject>(anObj);\n"; + // re-creation: QTest::newRow("re-creation") << &QTest::QExternalTest::tryRunFail |