summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-08-21 11:34:15 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-08-25 09:55:40 +0000
commite9ccb51aabad92f0d4630f4a918c27db06a45b71 (patch)
tree2867042ed5870f41b1767d6d28ba2120e63e030f /tests
parent33d57f8018535dfe4ac316fc0f2ebe69fb5ade1c (diff)
downloadqtlocation-e9ccb51aabad92f0d4630f4a918c27db06a45b71.tar.gz
Fix routing test for OSX
OSX test machines seem to have trouble with correct timer invocations. This patch makes the failing code point less reliant on timeing issues. Change-Id: If70d3c763336a5993fc75ecb66db6fbcf20453a6 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative_core/tst_routing.qml19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/auto/declarative_core/tst_routing.qml b/tests/auto/declarative_core/tst_routing.qml
index fc936f32..96a4a10f 100644
--- a/tests/auto/declarative_core/tst_routing.qml
+++ b/tests/auto/declarative_core/tst_routing.qml
@@ -750,23 +750,20 @@ Item {
// Autoupdate
automaticRoutesSpy.clear();
filledRouteQuery.numberAlternativeRoutes = 1 // 'altroutes - 70' is the echoed errorcode
- wait (300)
- compare(automaticRoutesSpy.count, 1);
+ tryCompare (automaticRoutesSpy, "count", 1) // 5 sec
compare(routeModelAutomatic.count, 1) // There should be a route already
compare (routeModelAutomatic.get(0).path.length, 5)
compare (routeModelAutomatic.get(0).path[0].latitude, filledRouteQuery.waypoints[0].latitude)
// Remove a waypoint and check that autoupdate works
filledRouteQuery.removeWaypoint(fcoordinate2)
- wait(300)
- compare(automaticRoutesSpy.count, 2);
+ tryCompare (automaticRoutesSpy, "count", 2)
compare (routeModelAutomatic.get(0).path.length, 4)
compare (routeModelAutomatic.get(0).path[0].latitude, fcoordinate1.latitude)
// Add a waypoint and check that autoupdate works
filledRouteQuery.addWaypoint(fcoordinate2);
- wait(300);
- compare(automaticRoutesSpy.count, 3);
+ tryCompare (automaticRoutesSpy, "count", 3)
compare(routeModelAutomatic.count, 1);
compare(routeModelAutomatic.get(0).path.length, 5);
compare(routeModelAutomatic.get(0).path[0].latitude, filledRouteQuery.waypoints[0].latitude);
@@ -779,15 +776,13 @@ Item {
{ latitude: 65, longitude: 66 },
{ latitude: 67, longitude: 68 }
];
- wait(300)
- compare(automaticRoutesSpy.count, 4);
+ tryCompare (automaticRoutesSpy, "count", 4)
compare(routeModelAutomatic.get(0).path[0].latitude, fcoordinate1.latitude + 1) // new value should be echoed
// Change query
routeModelAutomatic.query = filledRouteQuery2
filledRouteQuery2.numberAlternativeRoutes = 3
- wait(300)
- compare(automaticRoutesSpy.count, 5);
+ tryCompare (automaticRoutesSpy, "count", 5)
compare (routeModelAutomatic.get(0).path.length, 3)
// Verify that the old query is disconnected internally ie. does not trigger update
@@ -798,8 +793,8 @@ Item {
{ latitude: 65, longitude: 66 },
{ latitude: 67, longitude: 68 }
];
- wait(300)
- compare(automaticRoutesSpy.count, 5);
+ wait(800) // wait to hope no further updates comes through
+ compare (automaticRoutesSpy.count, 5)
compare(routeModelAutomatic.get(0).path.length, 3);
}