From: Jason McDonald Date: Wed, 11 May 2011 02:00:40 +0000 (+1000) Subject: Remove Q_ASSERT's from qsharedmemory autotest X-Git-Tag: qt-v5.0.0-alpha1~4297^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1661205dd7f774c91631e38d7a1360a82d363af2;p=profile%2Fivi%2Fqtbase.git Remove Q_ASSERT's from qsharedmemory autotest Report a fatal error rather than ignoring the error in non-debug builds. Change-Id: Ib6ef993e6e0c65bd9adea994ea7b454cc147f3d4 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit 637456edef085d1825f15429cd921f2f0d4bd6a2) --- diff --git a/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp index 6db84dd..647d857 100644 --- a/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp @@ -207,7 +207,8 @@ bool QSystemLockPrivate::modifySemaphore(QSystemLockPrivate::Operation op, if ((lockCount == 0 && op == Lock) || (lockCount > 0 && op == Unlock)) { if (op == Unlock) { --lockCount; - Q_ASSERT(lockCount >= 0); + if (lockCount < 0) + qFatal("%s: lockCount must not be negative", Q_FUNC_INFO); if (lockCount > 0) return true; } diff --git a/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp index f6803f7..f7e4ab2 100644 --- a/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp +++ b/tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp @@ -157,7 +157,8 @@ bool QSystemLockPrivate::modifySemaphore(QSystemLockPrivate::Operation op, if ((lockCount == 0 && op == Lock) || (lockCount > 0 && op == Unlock)) { if (op == Unlock) { --lockCount; - Q_ASSERT(lockCount >= 0); + if (lockCount < 0) + qFatal("%s: lockCount must not be negative", Q_FUNC_INFO); if (lockCount > 0) return true; }