diff options
-rw-r--r-- | tests/auto/qpointer/tst_qpointer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qpointer/tst_qpointer.cpp b/tests/auto/qpointer/tst_qpointer.cpp index b8a3da2..7bc5fb6 100644 --- a/tests/auto/qpointer/tst_qpointer.cpp +++ b/tests/auto/qpointer/tst_qpointer.cpp @@ -121,6 +121,13 @@ void tst_QPointer::assignment_operators() QCOMPARE(p2, QPointer<QObject>(object)); QCOMPARE(p1, QPointer<QObject>(p2)); + // Test assignment with the same pointer that's already guarded + p1 = object; + p2 = p1; + QCOMPARE(p1, QPointer<QObject>(object)); + QCOMPARE(p2, QPointer<QObject>(object)); + QCOMPARE(p1, QPointer<QObject>(p2)); + // Cleanup delete object; } |