summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2011-10-17 19:02:16 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-18 09:19:53 +0200
commit62c28a26f856c737902f5b0f6239157fd0be64f0 (patch)
treefce1974b6f9958a9582ffe31180092aa0e0753cf /tests
parentc2863f69b7d8af33f88a42d1e77a6b393786a92e (diff)
downloadqtlocation-62c28a26f856c737902f5b0f6239157fd0be64f0.tar.gz
Fix unit test
Change-Id: I0793cf96bbfa323901f0e742bfbd2dd55ee355ca Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/tst_place.qml40
1 files changed, 35 insertions, 5 deletions
diff --git a/tests/auto/declarative/tst_place.qml b/tests/auto/declarative/tst_place.qml
index e2512de8..051b73dd 100644
--- a/tests/auto/declarative/tst_place.qml
+++ b/tests/auto/declarative/tst_place.qml
@@ -111,17 +111,22 @@ TestCase {
name: "Supplier 1"
supplierId: "supplier-id-1"
url: "http://www.example.com/supplier-id-1/"
- supplierIconUrl: "http://www.example.com/supplier-id-1/icon"
+ icon: Icon{
+ fullUrl: "http://www.example.com/supplier-id-1/icon"
+ plugin: testPlugin
+ }
}
categories: [
Category {
name: "Category 1"
categoryId: "category-id-1"
+ plugin: testPlugin
},
Category {
name: "Category 2"
categoryId: "category-id-2"
+ plugin: testPlugin
}
]
@@ -178,8 +183,20 @@ TestCase {
return false;
if (place1.supplier.url !== place2.supplier.url)
return false;
- if (place1.supplier.supplierIconUrl !== place2.supplier.supplierIconUrl)
+
+ // check supplier icon
+ if (place1.supplier.icon === null && place2.supplier.icon !== null)
+ return false;
+ if (place1.supplier.icon !== null && place2.supplier.icon === null)
return false;
+ if (place1.supplier.icon !== null && place2.supplier.icon !== null) {
+ if (place1.supplier.icon.fullUrl !== place2.supplier.icon.fullUrl)
+ return false;
+ if (place1.supplier.icon.baseUrl !== place2.supplier.icon.baseUrl)
+ return false;
+ if (place1.supplier.icon.plugin !== place2.supplier.icon.plugin)
+ return false;
+ }
}
// check rating
@@ -268,9 +285,22 @@ TestCase {
compare(emptyPlace.visibility, Place.UnspecifiedVisibility);
// complex properties
- compare(emptyPlace.rating, null);
- compare(emptyPlace.location, null);
- compare(emptyPlace.supplier, null);
+ compare(emptyPlace.rating.value, 0);
+ compare(emptyPlace.location.address.street, '');
+ compare(emptyPlace.location.address.district, '');
+ compare(emptyPlace.location.address.city, '');
+ compare(emptyPlace.location.address.county, '');
+ compare(emptyPlace.location.address.state, '');
+ compare(emptyPlace.location.address.country, '');
+
+ compare(emptyPlace.supplier.name, '');
+ compare(emptyPlace.supplier.supplierId, '');
+ compare(emptyPlace.supplier.url, '');
+
+ compare(emptyPlace.supplier.icon.fullUrl, '');
+ compare(emptyPlace.supplier.icon.baseUrl, '');
+ compare(emptyPlace.supplier.icon.plugin, null);
+
compare(emptyPlace.reviewModel.totalCount, -1);
compare(emptyPlace.imageModel.totalCount, -1);
compare(emptyPlace.editorialModel.totalCount, -1);