summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmlqt/tst_qmlqt.cpp')
-rw-r--r--tests/auto/declarative/qmlqt/tst_qmlqt.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
index e9c9052..13f4904 100644
--- a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
+++ b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
@@ -46,6 +46,7 @@
#include <QmlComponent>
#include <QDir>
#include <QVector3D>
+#include <QCryptographicHash>
class tst_qmlqt : public QObject
{
@@ -67,6 +68,7 @@ private slots:
void closestAngle();
void playSound();
void openUrlExternally();
+ void md5();
private:
QmlEngine engine;
@@ -279,6 +281,19 @@ void tst_qmlqt::openUrlExternally()
QVERIFY(false);
}
+void tst_qmlqt::md5()
+{
+ QmlComponent component(&engine, TEST_FILE("md5.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toString(), QLatin1String(QCryptographicHash::hash(QByteArray(), QCryptographicHash::Md5).toHex()));
+ QCOMPARE(object->property("test2").toString(), QLatin1String(QCryptographicHash::hash("Hello World", QCryptographicHash::Md5).toHex()));
+
+ delete object;
+}
+
+
QTEST_MAIN(tst_qmlqt)
#include "tst_qmlqt.moc"