summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/text/qstatictext/tst_qstatictext.cpp')
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp35
1 files changed, 11 insertions, 24 deletions
diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
index b8134291af..4992d6927b 100644
--- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
@@ -43,18 +43,22 @@
// #define DEBUG_SAVE_IMAGE
+static inline QImage blankSquare()
+{
+ // a "blank" square; we compare against in our testfunctions to verify
+ // that we have actually painted something
+ QPixmap pm(1000, 1000);
+ pm.fill(Qt::white);
+ return pm.toImage();
+}
+
class tst_QStaticText: public QObject
{
Q_OBJECT
public:
- tst_QStaticText() {}
+ tst_QStaticText() : m_whiteSquare(blankSquare()) {}
private slots:
- void initTestCase();
-
- void init();
- void cleanup();
-
void constructionAndDestruction();
void drawToPoint_data();
void drawToPoint();
@@ -96,28 +100,11 @@ private slots:
private:
bool supportsTransformations() const;
- QImage const m_whiteSquare;
+ const QImage m_whiteSquare;
};
Q_DECLARE_METATYPE(QImage::Format);
-void tst_QStaticText::initTestCase()
-{
- // a "blank" square; we compare against in our testfunctions to verify
- // that we have actually painted something
- QPixmap pm(1000, 1000);
- pm.fill(Qt::white);
- const_cast<QImage&>(m_whiteSquare) = pm.toImage();
-}
-
-void tst_QStaticText::init()
-{
-}
-
-void tst_QStaticText::cleanup()
-{
-}
-
void tst_QStaticText::constructionAndDestruction()
{
QStaticText text("My text");