diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-07-24 16:10:52 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-27 03:27:23 +0200 |
commit | 9784dd8d06565177a302d4dabec0b6555a958e53 (patch) | |
tree | c6746ade9a3cb2327a13d471c351fbd58ed16b4a /tests/auto/gui | |
parent | 17c74529e4d343424c53e6630cd8c14d8d4d3313 (diff) |
Implement implicit constructors for built-in classes.
Change-Id: I6b0b104bc1da3252d014615c50b81830de42e722
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 301d8891bb..5a8ff7b760 100644 --- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp +++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp @@ -59,6 +59,8 @@ #include <qvector3d.h> #include <qvector4d.h> #include <qquaternion.h> +#include <qtextdocument.h> +#include <qtextformat.h> #include <qfont.h> #include "tst_qvariant_common.h" @@ -118,6 +120,8 @@ private slots: void debugStream_data(); void debugStream(); + void implicitConstruction(); + void guiVariantAtExit(); }; @@ -626,6 +630,49 @@ void tst_QGuiVariant::debugStream() QVERIFY(msgHandler.testPassed()); } +void tst_QGuiVariant::implicitConstruction() +{ + // This is a compile-time test + QVariant v; + +#define FOR_EACH_GUI_CLASS(F) \ + F(Font) \ + F(Pixmap) \ + F(Brush) \ + F(Color) \ + F(Palette) \ + F(Icon) \ + F(Image) \ + F(Polygon) \ + F(Region) \ + F(Bitmap) \ + F(Cursor) \ + F(KeySequence) \ + F(Pen) \ + F(TextLength) \ + F(TextFormat) \ + F(Matrix) \ + F(Transform) \ + F(Matrix4x4) \ + F(Vector2D) \ + F(Vector3D) \ + F(Vector4D) \ + F(Quaternion) \ + F(PolygonF) \ + +#define CONSTRUCT(TYPE) \ + { \ + Q##TYPE t; \ + v = t; \ + QVERIFY(true); \ + } + + FOR_EACH_GUI_CLASS(CONSTRUCT) + +#undef CONSTRUCT +#undef FOR_EACH_GUI_CLASS +} + void tst_QGuiVariant::guiVariantAtExit() { // crash test, it should not crash at QGuiApplication exit |