From 1661205dd7f774c91631e38d7a1360a82d363af2 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 11 May 2011 12:00:40 +1000 Subject: [PATCH] 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) --- tests/auto/qtipc/qsharedmemory/src/qsystemlock_unix.cpp | 3 ++- tests/auto/qtipc/qsharedmemory/src/qsystemlock_win.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.7.4