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>
This commit is contained in:
Marc Mutz 2016-03-14 14:51:45 +01:00
parent b4fa18a996
commit 5784c064a9

View File

@ -3171,8 +3171,7 @@ void tst_QRect::newMoveTopLeft_data()
} }
{ {
QTest::newRow("LargestCoordQRect_NullQPoint") << getQRectCase(LargestCoordQRect) << getQPointCase(NullQPoint) // QTest::newRow("LargestCoordQRect_NullQPoint") -- Not tested as it would cause an overflow
<< QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN)));
QTest::newRow("LargestCoordQRect_SmallestCoordQPoint") << getQRectCase(LargestCoordQRect) << getQPointCase(SmallestCoordQPoint) QTest::newRow("LargestCoordQRect_SmallestCoordQPoint") << getQRectCase(LargestCoordQRect) << getQPointCase(SmallestCoordQPoint)
<< QRect(QPoint(INT_MIN,INT_MIN), QPoint(INT_MAX,INT_MAX)); << QRect(QPoint(INT_MIN,INT_MIN), QPoint(INT_MAX,INT_MAX));
// QTest::newRow("LargestCoordQRect_MiddleNegCoordQPoint") -- Not tested as it would cause an overflow // QTest::newRow("LargestCoordQRect_MiddleNegCoordQPoint") -- Not tested as it would cause an overflow