diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-04-12 04:53:36 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-04-12 05:38:20 (GMT) |
commit | 3475168550c1a804f04f2a4edfeb30c04cd36551 (patch) | |
tree | ec1587bdc87e6f554c31e09cb1a3a2e26f16b181 /tests/auto/qsharedpointer | |
parent | 78722d6b6e9ba0f6de1a4eba232aad2f96a339f2 (diff) | |
download | Qt-3475168550c1a804f04f2a4edfeb30c04cd36551.zip Qt-3475168550c1a804f04f2a4edfeb30c04cd36551.tar.gz Qt-3475168550c1a804f04f2a4edfeb30c04cd36551.tar.bz2 |
Reduce usage of Q_ASSERT in autotests.
Using Q_ASSERT does nothing in release-mode builds, and in debug builds
it causes tests to terminate prematurely. It is much better to use
QVERIFY or QCOMPARE.
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/qsharedpointer')
-rw-r--r-- | tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index bb04621..f25f8e8 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -283,8 +283,8 @@ void tst_QSharedPointer::operators() QSharedPointer<char> p1; QSharedPointer<char> p2(new char); qptrdiff diff = p2.data() - p1.data(); - Q_ASSERT(p1.data() != p2.data()); - Q_ASSERT(diff != 0); + QVERIFY(p1.data() != p2.data()); + QVERIFY(diff != 0); // operator- QCOMPARE(p2 - p1.data(), diff); @@ -867,8 +867,8 @@ void tst_QSharedPointer::differentPointers() { DiffPtrDerivedData *aData = new DiffPtrDerivedData; Data *aBase = aData; - Q_ASSERT(aData == aBase); - Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); + QVERIFY(aData == aBase); + QVERIFY(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); QSharedPointer<Data> baseptr = QSharedPointer<Data>(aData); QSharedPointer<DiffPtrDerivedData> ptr = qSharedPointerCast<DiffPtrDerivedData>(baseptr); @@ -885,8 +885,8 @@ void tst_QSharedPointer::differentPointers() { DiffPtrDerivedData *aData = new DiffPtrDerivedData; Data *aBase = aData; - Q_ASSERT(aData == aBase); - Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); + QVERIFY(aData == aBase); + QVERIFY(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); QSharedPointer<DiffPtrDerivedData> ptr = QSharedPointer<DiffPtrDerivedData>(aData); QSharedPointer<Data> baseptr = ptr; @@ -908,8 +908,8 @@ void tst_QSharedPointer::virtualBaseDifferentPointers() { VirtualDerived *aData = new VirtualDerived; Data *aBase = aData; - Q_ASSERT(aData == aBase); - Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); + QVERIFY(aData == aBase); + QVERIFY(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); QSharedPointer<VirtualDerived> ptr = QSharedPointer<VirtualDerived>(aData); QSharedPointer<Data> baseptr = qSharedPointerCast<Data>(ptr); @@ -928,8 +928,8 @@ void tst_QSharedPointer::virtualBaseDifferentPointers() { VirtualDerived *aData = new VirtualDerived; Data *aBase = aData; - Q_ASSERT(aData == aBase); - Q_ASSERT(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); + QVERIFY(aData == aBase); + QVERIFY(*reinterpret_cast<quintptr *>(&aData) != *reinterpret_cast<quintptr *>(&aBase)); QSharedPointer<VirtualDerived> ptr = QSharedPointer<VirtualDerived>(aData); QSharedPointer<Data> baseptr = ptr; @@ -1605,7 +1605,7 @@ void hashAndMapTest() QVERIFY(it != c.find(Key())); if (Ordered) { - Q_ASSERT(k0 < k1); + QVERIFY(k0 < k1); it = c.begin(); QCOMPARE(it.key(), k0); |