diff options
Diffstat (limited to 'test/navigation/test-route-calculation-capi.py')
-rwxr-xr-x | test/navigation/test-route-calculation-capi.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/navigation/test-route-calculation-capi.py b/test/navigation/test-route-calculation-capi.py index 31e8b0c..1c44d10 100755 --- a/test/navigation/test-route-calculation-capi.py +++ b/test/navigation/test-route-calculation-capi.py @@ -38,11 +38,13 @@ import xml.dom.minidom import argparse import sys import errno - -import pdb; +#import pdb; #pdb.set_trace() - from pip import locations +from dltTrigger import * + +#name of the test +test_name = "route calculation" #constants as defined in the Navigation API GENIVI_NAVIGATIONCORE_LATITUDE = 0x00a0 @@ -138,7 +140,7 @@ def session_signals_handler(sessionHandle): print 'Test PASSED' else: print 'Test FAILED' - loop.quit() + exit() def route_deleted_signals_handler(routeHandle): print('Route handle deleted: '+str(routeHandle)) @@ -159,6 +161,10 @@ bus.add_signal_receiver(session_signals_handler, \ def timeout(): print 'Timeout Expired' print '\nTest FAILED' + exit() + +def exit(): + stopTrigger(test_name) loop.quit() def launch_route_calculation(route): @@ -187,11 +193,11 @@ def launch_route_calculation(route): dbus.Dictionary({dbus.Int32(GENIVI_NAVIGATIONCORE_LATITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data][0])]),dbus.Int32(GENIVI_NAVIGATIONCORE_LONGITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("start")[0].childNodes[0].data][1])])}), \ dbus.Dictionary({dbus.Int32(GENIVI_NAVIGATIONCORE_LATITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("destination")[0].childNodes[0].data][0])]),dbus.Int32(GENIVI_NAVIGATIONCORE_LONGITUDE):dbus.Struct([dbus.Byte(waypointDoubleCapiType),dbus.Double(locations[routes[g_current_route].getElementsByTagName("destination")[0].childNodes[0].data][1])])}) \ ]) \ - ) - + ) #calculate route g_routing_interface.calculateRoute(dbus.UInt32(g_session_handle),dbus.UInt32(g_route_handle)) +startTrigger(test_name) session = bus.get_object('org.genivi.navigation.navigationcore.Session.v4_0_Session','/Session') g_session_interface = dbus.Interface(session, dbus_interface='org.genivi.navigation.navigationcore.Session.v4_0') |