diff options
Diffstat (limited to 'src/testlib/qtest_gui.h')
-rw-r--r-- | src/testlib/qtest_gui.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h index d848f08d55..f56aa60949 100644 --- a/src/testlib/qtest_gui.h +++ b/src/testlib/qtest_gui.h @@ -122,25 +122,25 @@ template<> inline char *toString(const QRegion ®ion) #ifndef QT_NO_VECTOR2D template<> inline char *toString(const QVector2D &v) { - QByteArray result = "QVector2D(" + QByteArray::number(v.x()) + ", " - + QByteArray::number(v.y()) + ')'; + QByteArray result = "QVector2D(" + QByteArray::number(double(v.x())) + ", " + + QByteArray::number(double(v.y())) + ')'; return qstrdup(result.constData()); } #endif // !QT_NO_VECTOR2D #ifndef QT_NO_VECTOR3D template<> inline char *toString(const QVector3D &v) { - QByteArray result = "QVector3D(" + QByteArray::number(v.x()) + ", " - + QByteArray::number(v.y()) + ", " + QByteArray::number(v.z()) + ')'; + QByteArray result = "QVector3D(" + QByteArray::number(double(v.x())) + ", " + + QByteArray::number(double(v.y())) + ", " + QByteArray::number(double(v.z())) + ')'; return qstrdup(result.constData()); } #endif // !QT_NO_VECTOR3D #ifndef QT_NO_VECTOR4D template<> inline char *toString(const QVector4D &v) { - QByteArray result = "QVector4D(" + QByteArray::number(v.x()) + ", " - + QByteArray::number(v.y()) + ", " + QByteArray::number(v.z()) - + ", " + QByteArray::number(v.w()) + ')'; + QByteArray result = "QVector4D(" + QByteArray::number(double(v.x())) + ", " + + QByteArray::number(double(v.y())) + ", " + QByteArray::number(double(v.z())) + + ", " + QByteArray::number(double(v.w())) + ')'; return qstrdup(result.constData()); } #endif // !QT_NO_VECTOR4D @@ -164,24 +164,24 @@ inline bool qCompare(QImage const &t1, QImage const &t2, qsnprintf(msg, 1024, "Compared QImages differ.\n" " Actual (%s).isNull(): %d\n" " Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null); - return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line); + return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line); } if (t1Null && t2Null) - return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line); + return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line); if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QImages differ in size.\n" " Actual (%s): %dx%d\n" " Expected (%s): %dx%d", actual, t1.width(), t1.height(), expected, t2.width(), t2.height()); - return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line); + return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line); } if (t1.format() != t2.format()) { qsnprintf(msg, 1024, "Compared QImages differ in format.\n" " Actual (%s): %d\n" " Expected (%s): %d", actual, t1.format(), expected, t2.format()); - return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line); + return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line); } return compare_helper(t1 == t2, "Compared values are not the same", toString(t1), toString(t2), actual, expected, file, line); @@ -198,17 +198,17 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c qsnprintf(msg, 1024, "Compared QPixmaps differ.\n" " Actual (%s).isNull(): %d\n" " Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null); - return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line); + return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line); } if (t1Null && t2Null) - return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line); + return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line); if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n" " Actual (%s): %dx%d\n" " Expected (%s): %dx%d", actual, t1.width(), t1.height(), expected, t2.width(), t2.height()); - return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line); + return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line); } return qCompare(t1.toImage(), t2.toImage(), actual, expected, file, line); } |