summaryrefslogtreecommitdiff
path: root/tests/auto/qgeoaddress
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2012-02-06 14:24:39 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-07 15:25:51 +0100
commit7c4d304db929b70144f00bf6d0ab3f0a78d9b13f (patch)
tree4faa2a2a733def276d803ecfa7a2a60a66609837 /tests/auto/qgeoaddress
parentdf51c688868c2155288da378d98f1b1511cb96e5 (diff)
downloadqtlocation-7c4d304db929b70144f00bf6d0ab3f0a78d9b13f.tar.gz
Add formattedAddress property to address.
The formatted address provides a formatted address in the format that one would find on an envelope. Task-number: QTBUG-23499 Change-Id: I176ad03a8666737a2db1d542c4f768c2116aba32 Reviewed-by: Alex <alex.blasche@nokia.com>
Diffstat (limited to 'tests/auto/qgeoaddress')
-rw-r--r--tests/auto/qgeoaddress/tst_qgeoaddress.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qgeoaddress/tst_qgeoaddress.cpp b/tests/auto/qgeoaddress/tst_qgeoaddress.cpp
index 8f52fae2..85abd079 100644
--- a/tests/auto/qgeoaddress/tst_qgeoaddress.cpp
+++ b/tests/auto/qgeoaddress/tst_qgeoaddress.cpp
@@ -55,6 +55,7 @@ public:
private Q_SLOTS:
void constructorTest();
+ void formattedAddress();
//TODO: there are various field we don't have yet in QGeoAddress
// will need to either remove or enable these tests
// void additionalDataTest();
@@ -90,6 +91,14 @@ void tst_QGeoAddress::constructorTest()
delete testObjPtr;
}
+void tst_QGeoAddress::formattedAddress()
+{
+ QGeoAddress address;
+ QVERIFY(address.formattedAddress().isEmpty());
+ address.setFormattedAddress(QLatin1String("123 Fake Street\nSpringfield"));
+ QCOMPARE(address.formattedAddress(), QLatin1String("123 Fake Street\nSpringfield"));
+}
+
void tst_QGeoAddress::cityTest()
{
QGeoAddress testObj;
@@ -238,6 +247,10 @@ void tst_QGeoAddress::emptyClearTest()
QVERIFY(!testObj.isEmpty());
testObj.clear();
+ testObj.setFormattedAddress(QLatin1String("formatted address"));
+ QVERIFY(!testObj.isEmpty());
+ testObj.clear();
+
QVERIFY(testObj.isEmpty());
}