Fail test in preference to calling qFatal.
authorJason McDonald <jason.mcdonald@nokia.com>
Fri, 7 Oct 2011 01:26:37 +0000 (11:26 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 7 Oct 2011 02:30:30 +0000 (04:30 +0200)
Calling qFatal may result in test output not being well-formed.

Change-Id: Ia16bade4d3311485c6ba4dd23d5624d18b192b71
Reviewed-on: http://codereview.qt-project.org/6190
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

index 5ad0b1c..ff776b9 100644 (file)
@@ -817,10 +817,8 @@ void tst_QSharedPointer::differentPointers()
 
         // ensure that this compiler isn't broken
         if (*reinterpret_cast<quintptr *>(&aData) == *reinterpret_cast<quintptr *>(&aBase))
-            qFatal("Something went very wrong -- we couldn't create two different pointers to the same object");
-        if (aData != aBase)
-            QSKIP("Broken compiler", SkipAll);
-        if (aBase != aData)
+            QFAIL("Something went very wrong -- we couldn't create two different pointers to the same object");
+        if (aData != aBase || aBase != aData)
             QSKIP("Broken compiler", SkipAll);
 
         QSharedPointer<DiffPtrDerivedData> ptr = QSharedPointer<DiffPtrDerivedData>(aData);