diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-10 05:23:04 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-10 05:32:55 (GMT) |
commit | 829265b98a6c7c3856f3504e29209bff38c95ce9 (patch) | |
tree | c1f3d84f3a5a8baee98dc35c23d129ffde0ea08b /tests | |
parent | 6125645db9ddb8bc614f79961138d5371b8717d6 (diff) | |
download | Qt-829265b98a6c7c3856f3504e29209bff38c95ce9.zip Qt-829265b98a6c7c3856f3504e29209bff38c95ce9.tar.gz Qt-829265b98a6c7c3856f3504e29209bff38c95ce9.tar.bz2 |
Match drop shadow bounding rectangle unit test to the new implementation
Reviewed-by: Sarah Smith
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp b/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp index a80c787..3f5c3d3 100644 --- a/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp +++ b/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp @@ -390,24 +390,24 @@ void tst_QPixmapFilter::dropShadowBoundingRectFor() const QRectF rect3(2.2, 6.3, 11.4, 47.5); filter.setOffset(QPointF(0,0)); - QCOMPARE(filter.boundingRectFor(rect1), rect1); - QCOMPARE(filter.boundingRectFor(rect2), rect2); - QCOMPARE(filter.boundingRectFor(rect3), rect3); + QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-2, -2, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-2, -2, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-2, -2, 2, 2)); filter.setOffset(QPointF(1,1)); QCOMPARE(filter.offset(), QPointF(1, 1)); - QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(0, 0, 1, 1)); - QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(0, 0, 1, 1)); - QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(0, 0, 1, 1)); + QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-2, -2, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-2, -2, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-2, -2, 2, 2)); filter.setOffset(QPointF(-1,-1)); - QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-1, -1, 0, 0)); - QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-1, -1, 0, 0)); - QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-1, -1, 0, 0)); + QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-2, -2, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-2, -2, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-2, -2, 2, 2)); filter.setBlurRadius(2); filter.setOffset(QPointF(0,0)); - int delta = 2 * 2; + int delta = 2 + 1; QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-delta, -delta, delta, delta)); QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-delta, -delta, delta, delta)); QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-delta, -delta, delta, delta)); @@ -418,9 +418,9 @@ void tst_QPixmapFilter::dropShadowBoundingRectFor() QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-delta + 1, -delta + 1, delta + 1, delta + 1)); filter.setOffset(QPointF(-10,-10)); - QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-delta - 10, -delta - 10, 0, 0)); - QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-delta - 10, -delta - 10, 0, 0)); - QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-delta - 10, -delta - 10, 0, 0)); + QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-delta - 10, -delta - 10, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-delta - 10, -delta - 10, 2, 2)); + QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-delta - 10, -delta - 10, 2, 2)); } |