Remove Q_ASSERT from algorithms autotest
authorJason McDonald <jason.mcdonald@nokia.com>
Fri, 6 May 2011 04:43:03 +0000 (14:43 +1000)
committerRohan McGovern <rohan.mcgovern@nokia.com>
Wed, 18 May 2011 00:46:46 +0000 (10:46 +1000)
Report a meaningful warning message rather than aborting in a debug
build and failing silently in a release build.

Change-Id: Ic77589143ff0d22c95c7b10f2e511f68b3da4d86
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
(cherry picked from commit 75767c69fbba3149a4505287ed441886188a9fd3)

tests/auto/qalgorithms/tst_qalgorithms.cpp

index d0d8e9a..f14ba1f 100644 (file)
@@ -241,7 +241,8 @@ QList<ResultSet> testAlgorithm(Algorithm &algorithm,  QStringList dataSetTypes,
     foreach(QString dataSetType, dataSetTypes) {
         QVector<DataType> container = generateData<DataType>(dataSetType, size);
         results.append(testRun(container, algorithm, time));
-        Q_ASSERT(isSorted(container));
+        if (!isSorted(container))
+            qWarning("%s: container is not sorted after test", Q_FUNC_INFO);
     }
     return results;
 }