summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qrect/tst_qrect.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-03-14 14:51:45 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-03-15 10:39:38 +0000
commit5784c064a9c89ceb1e6dc9857e2c1ed6edf9a7b8 (patch)
treec85113b6c4c500293e83a498078b8087e0d7b8ca /tests/auto/corelib/tools/qrect/tst_qrect.cpp
parentb4fa18a996bc29bbb04e7358ef57b287076b0aae (diff)
tst_QRect: drop a test that depends on int overflow
The compiler can statically check that this is undefined behavior: tst_qrect.cpp:3173:52: warning: integer overflow in expression [-Woverflow] << QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN))); ~^~ tst_qrect.cpp:3173:72: warning: integer overflow in expression [-Woverflow] << QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN))); ~^~ Fix by skipping the test (like most of the others are in the block). Change-Id: I359a5e16db6c660c9f11d7dd8fbb40730bd63887 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'tests/auto/corelib/tools/qrect/tst_qrect.cpp')
-rw-r--r--tests/auto/corelib/tools/qrect/tst_qrect.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/corelib/tools/qrect/tst_qrect.cpp b/tests/auto/corelib/tools/qrect/tst_qrect.cpp
index 585cf5d4d0..c6907dcac2 100644
--- a/tests/auto/corelib/tools/qrect/tst_qrect.cpp
+++ b/tests/auto/corelib/tools/qrect/tst_qrect.cpp
@@ -3171,8 +3171,7 @@ void tst_QRect::newMoveTopLeft_data()
}
{
- QTest::newRow("LargestCoordQRect_NullQPoint") << getQRectCase(LargestCoordQRect) << getQPointCase(NullQPoint)
- << QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN)));
+ // QTest::newRow("LargestCoordQRect_NullQPoint") -- Not tested as it would cause an overflow
QTest::newRow("LargestCoordQRect_SmallestCoordQPoint") << getQRectCase(LargestCoordQRect) << getQPointCase(SmallestCoordQPoint)
<< QRect(QPoint(INT_MIN,INT_MIN), QPoint(INT_MAX,INT_MAX));
// QTest::newRow("LargestCoordQRect_MiddleNegCoordQPoint") -- Not tested as it would cause an overflow