summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-10 14:58:06 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-10 15:02:57 (GMT)
commit060727ed4f8b1ffea58229817640a03be5b095ed (patch)
tree6a4e3865c251c1a895ff528b5cb1ec52527c7d30 /tests
parent4a8a851315ba10824ac107084ccff9de649418ea (diff)
downloadQt-060727ed4f8b1ffea58229817640a03be5b095ed.zip
Qt-060727ed4f8b1ffea58229817640a03be5b095ed.tar.gz
Qt-060727ed4f8b1ffea58229817640a03be5b095ed.tar.bz2
Adding support in QVariant for conversions between QUrl and QString
Reviewed-by: ogoffart
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index 0ede920..2d26914 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -2449,14 +2449,22 @@ void tst_QVariant::saveLoadCustomTypes()
void tst_QVariant::url()
{
- QUrl url("http://www.trolltech.com");
+ QString str("http://www.trolltech.com");
+ QUrl url(str);
- QVariant v(url);
+ QVariant v(url); //built with a QUrl
QVariant v2 = v;
- QVERIFY(v2.toUrl() == url);
+ QVariant v3(str); //built with a QString
+ QCOMPARE(v2.toUrl(), url);
+ QVERIFY(qVariantCanConvert<QUrl>(v3));
+ QCOMPARE(v2.toUrl(), v3.toUrl());
+
+ QVERIFY(qVariantCanConvert<QString>(v2));
+ QCOMPARE(v2.toString(), str);
+ QCOMPARE(v3.toString(), str);
}
void tst_QVariant::globalColor()