summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2011-11-08 14:42:08 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-08 07:43:00 +0100
commit78542c62757566c75908ae112312d677f032af6a (patch)
treeb47b2a03a58b9445acf2709391680f7357038466 /tests
parent63eae1bd15ea8aa1e4fc460194e34ecb5fc55b3a (diff)
QPainterPath: Fix copy constructor again.
The previous fix a05270f435483937e76d18fa6e512dc0394507d1 is not correct, QPainterPathPrivate(other) should be QPainterPathPrivate(), as there is only a default ctor for QPainterPathPrivate and ref is initialized there, use copy ctor just copies the ref value which makes all detach() calls broken. Add an unit test for this as well. Change-Id: I658f0a977664d5ec523af3f8a48c1a866eda6ab0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 33315adc06..08c08649d6 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -742,7 +742,11 @@ void tst_QPainterPath::closing()
triangle.lineTo(200, 200);
QCOMPARE(triangle.elementCount(), 3);
+ //add this line to make sure closeSubpath() also calls detach() and detached properly
+ QPainterPath copied = triangle;
triangle.closeSubpath();
+ QCOMPARE(copied.elementCount(), 3);
+
QCOMPARE(triangle.elementCount(), 4);
QCOMPARE(triangle.elementAt(3).type, QPainterPath::LineToElement);