From: Jason McDonald Date: Tue, 3 May 2011 06:14:03 +0000 (+1000) Subject: Remove Q_ASSERT from QSharedPointer autotest X-Git-Tag: qt-v5.0.0-alpha1~4297^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42d6820c7c1f43b7fd633579c1ba494212d0176f;p=profile%2Fivi%2Fqtbase.git Remove Q_ASSERT from QSharedPointer autotest Report a meaningful fatal error instead of aborting in debug mode builds and failing silently in release mode builds. Change-Id: I0f939dc40810f072a3e24aeba085191793c49ef3 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit b988b2f9f04ac0ebce7a779cd9bd5d394bfa1c95) --- diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index bb04621..96d0873 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -139,7 +139,8 @@ public: virtual ~Data() { - Q_ASSERT_X(generation > 0, "tst_QSharedPointer", "Double deletion!"); + if (generation <= 0) + qFatal("tst_qsharedpointer: Double deletion!"); generation = 0; ++destructorCounter; }