ret = location_manager_unset_service_state_changed_cb(manager2);
assert_eq(ret, LOCATIONS_ERROR_NONE);
- ret = location_manager_destroy(manager2);
- assert_eq(ret, LOCATIONS_ERROR_NONE);
- manager2 = NULL;
-
ret = location_manager_enable_mock_location(false);
assert_eq(ret, LOCATIONS_ERROR_NONE);
+ ret = location_manager_destroy(manager2);
+ assert_eq(ret, LOCATIONS_ERROR_NONE);
+ manager2 = NULL;
} else {
ret = location_manager_set_mock_location(manager2, latitude, longitude, altitude, speed, direction, accuracy);
assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED);
double speed = 4.0;
double direction = 50.1;
double accuracy = 6.0;
+ time_t timestamp = 0.0;
+ service_enabled = false;
if (is_location_supported) {
manager = NULL;
}
- ret = location_manager_enable_mock_location(true);
+ ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2);
assert_eq(ret, LOCATIONS_ERROR_NONE);
- ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2);
+ ret = location_manager_enable_mock_location(true);
assert_eq(ret, LOCATIONS_ERROR_NONE);
ret = location_manager_set_mock_location(manager2, latitude, longitude, altitude, speed, direction, accuracy);
assert_eq(ret, LOCATIONS_ERROR_NONE);
- ret = location_manager_clear_mock_location(manager2);
+ ret = location_manager_set_service_state_changed_cb(manager2, __service_state_changed_cb, NULL);
assert_eq(ret, LOCATIONS_ERROR_NONE);
- ret = location_manager_destroy(manager2);
+ ret = location_manager_start(manager2);
+ assert_eq(ret, LOCATIONS_ERROR_NONE);
+
+ wait_for_service();
+ assert(service_enabled);
+
+ ret = location_manager_get_position(manager2, &altitude, &latitude, &longitude, ×tamp);
+ assert_eq(ret, LOCATIONS_ERROR_NONE);
+
+ ret = location_manager_stop(manager2);
+ assert_eq(ret, LOCATIONS_ERROR_NONE);
+
+ ret = location_manager_clear_mock_location(manager2);
assert_eq(ret, LOCATIONS_ERROR_NONE);
- manager2 = NULL;
ret = location_manager_enable_mock_location(false);
assert_eq(ret, LOCATIONS_ERROR_NONE);
+
+ ret = location_manager_destroy(manager2);
+ assert_eq(ret, LOCATIONS_ERROR_NONE);
+ manager2 = NULL;
} else {
ret = location_manager_clear_mock_location(manager2);
assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED);