Use QVERIFY2 to output verbose failure messages.
authorJason McDonald <jason.mcdonald@nokia.com>
Thu, 29 Dec 2011 03:34:25 +0000 (13:34 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 30 Dec 2011 01:07:50 +0000 (02:07 +0100)
Change-Id: I2ce96d9d9f582e99c1d9f6dd6e6e80ce42d6e61d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp

index d1350ba..d5b58c8 100644 (file)
@@ -446,8 +446,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
         } catch (const Exception &) {
             caught = true;
         }
-        if (!caught)
-            QFAIL("did not get exception");
+        QVERIFY2(caught, "did not get exception");
     }
 
     // Blocking mode:
@@ -460,9 +459,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
         } catch (const Exception &) {
             caught = true;
         }
-
-        if (!caught)
-            QFAIL("did not get exception");
+        QVERIFY2(caught, "did not get exception");
     }
 
     // test throwing the exception from the main thread (different code path)
@@ -474,9 +471,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
         } catch (const Exception &) {
             caught = true;
         }
-
-        if (!caught)
-            QFAIL("did not get exception");
+        QVERIFY2(caught, "did not get exception");
     }
 
     // Asynchronous mode:
@@ -489,8 +484,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
         } catch (const QtConcurrent::UnhandledException &) {
             caught = true;
         }
-        if (!caught)
-            QFAIL("did not get exception");
+        QVERIFY2(caught, "did not get exception");
     }
 
     // Blocking mode:
@@ -503,9 +497,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
         } catch (const QtConcurrent::UnhandledException &) {
             caught = true;
         }
-
-        if (!caught)
-            QFAIL("did not get exception");
+        QVERIFY2(caught, "did not get exception");
     }
 
     // test throwing the exception from the main thread (different code path)
@@ -517,9 +509,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
         } catch (const QtConcurrent::UnhandledException &) {
             caught = true;
         }
-
-        if (!caught)
-            QFAIL("did not get exception");
+        QVERIFY2(caught, "did not get exception");
     }
 }