summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpicture
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qpicture')
-rw-r--r--tests/auto/qpicture/tst_qpicture.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qpicture/tst_qpicture.cpp b/tests/auto/qpicture/tst_qpicture.cpp
index 09f6503..10e5961 100644
--- a/tests/auto/qpicture/tst_qpicture.cpp
+++ b/tests/auto/qpicture/tst_qpicture.cpp
@@ -64,6 +64,7 @@ private slots:
void devType();
void paintingActive();
void boundingRect();
+ void swap();
void operator_lt_lt();
void save_restore();
@@ -155,6 +156,18 @@ void tst_QPicture::boundingRect()
}
}
+void tst_QPicture::swap()
+{
+ QPicture p1, p2;
+ QPainter(&p1).drawLine(0, 0, 5, 5);
+ QPainter(&p2).drawLine(0, 3, 3, 0);
+ QCOMPARE(p1.boundingRect(), QRect(0,0,5,5));
+ QCOMPARE(p2.boundingRect(), QRect(0,0,3,3));
+ p1.swap(p2);
+ QCOMPARE(p1.boundingRect(), QRect(0,0,3,3));
+ QCOMPARE(p2.boundingRect(), QRect(0,0,5,5));
+}
+
// operator<< and operator>>
void tst_QPicture::operator_lt_lt()
{