From 72fb8797642ec4c9151fcd805e377bd52e4c1756 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 6 May 2011 14:43:03 +1000 Subject: Remove Q_ASSERT from algorithms autotest 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qalgorithms/tst_qalgorithms.cpp b/tests/auto/qalgorithms/tst_qalgorithms.cpp index d0d8e9aead..f14ba1f140 100644 --- a/tests/auto/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/qalgorithms/tst_qalgorithms.cpp @@ -241,7 +241,8 @@ QList testAlgorithm(Algorithm &algorithm, QStringList dataSetTypes, foreach(QString dataSetType, dataSetTypes) { QVector container = generateData(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; } -- cgit v1.2.3