summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlqt
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-12 08:02:05 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-12 08:02:05 (GMT)
commit67e42ba2eb8ab2115e929791cb67a8e9ba413e80 (patch)
treef2d3b38c76c858e6012b6b6c1b9ecb128be3db04 /tests/auto/declarative/qmlqt
parent8905d8445dfe8977441302003fa21dde140fa0fe (diff)
downloadQt-67e42ba2eb8ab2115e929791cb67a8e9ba413e80.zip
Qt-67e42ba2eb8ab2115e929791cb67a8e9ba413e80.tar.gz
Qt-67e42ba2eb8ab2115e929791cb67a8e9ba413e80.tar.bz2
Qt.md5() method
Diffstat (limited to 'tests/auto/declarative/qmlqt')
-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"