Remove Q_ASSERT's from exceptionsafety_objects test
authorJason McDonald <jason.mcdonald@nokia.com>
Wed, 4 May 2011 06:25:14 +0000 (16:25 +1000)
committerRohan McGovern <rohan.mcgovern@nokia.com>
Wed, 18 May 2011 00:46:45 +0000 (10:46 +1000)
Report a fatal error in all builds, not just in debug builds.

Change-Id: Iad990e2d3b29a55e995254d466e967a4a722bb23
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
(cherry picked from commit a212b402da4b4af9d453fa96dbfa2d32271e857d)

tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp

index 2f094f3..d167228 100644 (file)
@@ -371,7 +371,8 @@ struct WidgetCreator : public AbstractTester
 {
     void operator()(QObject *parent)
     {
-        Q_ASSERT(!parent || parent->isWidgetType());
+        if (parent && !parent->isWidgetType())
+            qFatal("%s: parent must be either null or a widget type", Q_FUNC_INFO);
         QScopedPointer<T> ptr(parent ? new T(static_cast<QWidget *>(parent)) : new T);
     }
 };
@@ -381,7 +382,8 @@ template <> struct WidgetCreator<QSizeGrip> : public AbstractTester
 {
     void operator()(QObject *parent)
     {
-        Q_ASSERT(!parent || parent->isWidgetType());
+        if (parent && !parent->isWidgetType())
+            qFatal("%s: parent must be either null or a widget type", Q_FUNC_INFO);
         QScopedPointer<QSizeGrip> ptr(new QSizeGrip(static_cast<QWidget *>(parent)));
     }
 };
@@ -391,7 +393,8 @@ template <> struct WidgetCreator<QDesktopWidget> : public AbstractTester
 {
     void operator()(QObject *parent)
     {
-        Q_ASSERT(!parent || parent->isWidgetType());
+        if (parent && !parent->isWidgetType())
+            qFatal("%s: parent must be either null or a widget type", Q_FUNC_INFO);
         QScopedPointer<QDesktopWidget> ptr(new QDesktopWidget());
     }
 };