From 531240dc58c4d32a0aac4be1499368720e2f243f Mon Sep 17 00:00:00 2001 From: "kj7.sung" Date: Fri, 12 Aug 2016 13:50:33 +0900 Subject: [PATCH] [UTC][location-manager][ACR-716][Fix mock location] Signed-off-by: kj7.sung Change-Id: I0470249cef45df04d8a5243c1ca74f6aa41b8083 --- .../location-manager/ITs-location-manager-common.c | 1 - src/itc/location-manager/ITs-location-manager.c | 152 ++++++++--------- .../tct-location-manager-core_mobile.h | 12 +- .../tct-location-manager-core_wearable.h | 12 +- src/utc/location-manager/utc-location-manager.c | 180 +++++---------------- 5 files changed, 115 insertions(+), 242 deletions(-) diff --git a/src/itc/location-manager/ITs-location-manager-common.c b/src/itc/location-manager/ITs-location-manager-common.c index 207c1da..31703b1 100755 --- a/src/itc/location-manager/ITs-location-manager-common.c +++ b/src/itc/location-manager/ITs-location-manager-common.c @@ -84,7 +84,6 @@ char* LocationManagerGetEnum(int nRet) case LOCATIONS_METHOD_HYBRID: szErrorVal = "LOCATIONS_METHOD_HYBRID"; break; case LOCATIONS_METHOD_GPS: szErrorVal = "LOCATIONS_METHOD_GPS"; break; case LOCATIONS_METHOD_WPS: szErrorVal = "LOCATIONS_METHOD_WPS"; break; - case LOCATIONS_METHOD_MOCK: szErrorVal = "LOCATIONS_METHOD_MOCK"; break; default: szErrorVal = "LOCATIONS_METHOD_NONE"; break; } diff --git a/src/itc/location-manager/ITs-location-manager.c b/src/itc/location-manager/ITs-location-manager.c index b6bd6a3..31ead83 100755 --- a/src/itc/location-manager/ITs-location-manager.c +++ b/src/itc/location-manager/ITs-location-manager.c @@ -186,7 +186,7 @@ static bool LocationBoundsCB(location_bounds_h bounds, void *user_data) /** * @function LocationSettingChangedCB -* @description Called when the user defined zones are entered or exited. +* @description Called when the user defined zones are entered or exited. * @parameter location_method_e method, bool enable, void *user_data * @return NA */ @@ -205,7 +205,7 @@ static void LocationSettingChangedCB(location_method_e method, bool enable, void /** * @function LocationUpdatedCB -* @description Called at defined interval with updated location information +* @description Called at defined interval with updated location information * @parameter location_error_e error, double latitude, double longitude, double altitude, time_t timestamp, double speed, double direction, double climb, void *user_data * @return NA */ @@ -242,7 +242,7 @@ static void LocationChangedCB(double latitude, double longitude, double altitude g_main_loop_quit(g_pLocationManagerMainLoop); } return; -} +} /** * @function ITs_location_manager_startup @@ -337,7 +337,7 @@ int ITc_location_manager_start_stop_p(void) // Target API nRet = location_manager_start(stManager); PRINT_RESULT_CLEANUP(LOCATIONS_ERROR_NONE, nRet, "location_manager_start", LocationManagerGetError(nRet), location_manager_unset_service_state_changed_cb(stManager);location_manager_destroy(stManager)); - + RUN_POLLING_LOOP; if ( g_bCallbackHit != true || g_bCallbackReturnValue != true ) { @@ -350,14 +350,14 @@ int ITc_location_manager_start_stop_p(void) FPRINTF("[Line : %d][%s] location_manager_start failed g_bIsServiceEnabled is false \\n", __LINE__, API_NAMESPACE); location_manager_unset_service_state_changed_cb(stManager); location_manager_destroy(stManager); - return 1; + return 1; } g_bCallbackHit = false; // Target API nRet = location_manager_stop(stManager); PRINT_RESULT_CLEANUP(LOCATIONS_ERROR_NONE, nRet, "location_manager_stop", LocationManagerGetError(nRet), location_manager_unset_service_state_changed_cb(stManager);location_manager_destroy(stManager)); - + RUN_POLLING_LOOP; if ( g_bCallbackHit != true || g_bCallbackReturnValue != true ) { @@ -369,7 +369,7 @@ int ITc_location_manager_start_stop_p(void) FPRINTF("[Line : %d][%s] location_manager_stop failed g_bIsServiceEnabled is false \\n", __LINE__, API_NAMESPACE); location_manager_unset_service_state_changed_cb(stManager); location_manager_destroy(stManager); - return 1; + return 1; } nRet = location_manager_unset_service_state_changed_cb(stManager); @@ -393,7 +393,7 @@ int ITc_location_manager_start_stop_p(void) * @description Create location manager and destroy it * @scenario Create manager\n * Destroy manager -* @apicovered location_manager_create, location_manager_destroy +* @apicovered location_manager_create, location_manager_destroy * @passcase When location_manager_create and location_manager_destroy are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -409,7 +409,6 @@ int ITc_location_manager_create_destroy_p(void) LOCATIONS_METHOD_GPS, LOCATIONS_METHOD_WPS, LOCATIONS_METHOD_HYBRID, - LOCATIONS_METHOD_MOCK }; int nEnumSize = sizeof(location_method) / sizeof(location_method[0]); @@ -444,14 +443,6 @@ int ITc_location_manager_create_destroy_p(void) eTestLocationMethod = location_method[nEnumCounter]; } } - - if ( location_method[nEnumCounter] == LOCATIONS_METHOD_MOCK ) - { - if ( g_bIsLocationFeatureSupported && g_bIsGpsFeatureSupported ) - { - eTestLocationMethod = location_method[nEnumCounter]; - } - } // Target API location_error_e nRet = location_manager_create(location_method[nEnumCounter], &stManager); @@ -487,10 +478,10 @@ int ITc_location_manager_create_destroy_p(void) * @reviewer SRID(gupta.sanjay) * @type auto * @description Registers/Unregisters a callback function to be invoked when the location service state is changed. -* @scenario Registers a callback function to be invoked when the location service state is changed\n +* @scenario Registers a callback function to be invoked when the location service state is changed\n * Check if callback is invoked\n * Unregisters the callback function -* @apicovered location_manager_set_service_state_changed_cb, location_manager_unset_service_state_changed_cb +* @apicovered location_manager_set_service_state_changed_cb, location_manager_unset_service_state_changed_cb * @passcase When location_manager_set_service_state_changed_cb and location_manager_unset_service_state_changed_cb are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -519,7 +510,7 @@ int ITc_location_manager_set_unset_service_state_changed_cb_p(void) //check using callback for start nRet = location_manager_start(stManager); PRINT_RESULT_CLEANUP(LOCATIONS_ERROR_NONE, nRet, "location_manager_start", LocationManagerGetError(nRet), location_manager_unset_service_state_changed_cb(stManager);location_manager_destroy(stManager)); - + RUN_POLLING_LOOP; if ( g_bCallbackHit != true || g_bCallbackReturnValue != true ) { @@ -532,7 +523,7 @@ int ITc_location_manager_set_unset_service_state_changed_cb_p(void) FPRINTF("[Line : %d][%s] location_manager_start failed g_bIsServiceEnabled is false \\n", __LINE__, API_NAMESPACE); location_manager_unset_service_state_changed_cb(stManager); location_manager_destroy(stManager); - return 1; + return 1; } g_bCallbackHit = false; @@ -541,7 +532,7 @@ int ITc_location_manager_set_unset_service_state_changed_cb_p(void) //check using callback for stop nRet = location_manager_stop(stManager); PRINT_RESULT_CLEANUP(LOCATIONS_ERROR_NONE, nRet, "location_manager_stop", LocationManagerGetError(nRet), location_manager_unset_service_state_changed_cb(stManager);location_manager_destroy(stManager)); - + RUN_POLLING_LOOP; if ( g_bCallbackHit != true || g_bCallbackReturnValue != true ) { @@ -553,7 +544,7 @@ int ITc_location_manager_set_unset_service_state_changed_cb_p(void) FPRINTF("[Line : %d][%s] location_manager_stop failed g_bIsServiceEnabled is false \\n", __LINE__, API_NAMESPACE); location_manager_unset_service_state_changed_cb(stManager); location_manager_destroy(stManager); - return 1; + return 1; } nRet = location_manager_unset_service_state_changed_cb(stManager); @@ -576,7 +567,7 @@ int ITc_location_manager_set_unset_service_state_changed_cb_p(void) * @description Gets the current accuracy information * @scenario Create and start location manager\n * Get the current accuracy information\n -* Stop and Destroy location manager +* Stop and Destroy location manager * @apicovered location_manager_get_accuracy * @passcase When location_manager_get_accuracy is successful * @failcase If target API fails or any precondition API fails @@ -848,7 +839,7 @@ int ITc_location_manager_get_location_p(void) * Get the given location manager's method\n * Checks whether the given location method is available or not\n * Stop and Destroy location manager -* @apicovered location_manager_get_method , location_manager_is_supported_method +* @apicovered location_manager_get_method , location_manager_is_supported_method * @passcase When location_manager_get_method, location_manager_is_supported_method are successful * @failcase If target API fails or any precondition API fails * @precondition The location manager's handle must be created by location_manager_create() @@ -882,11 +873,11 @@ int ITc_location_manager_get_is_supported_method_p(void) * @since_tizen 2.3 * @author SRID(sameer.g1) * @reviewer SRID(gupta.sanjay) -* @type auto +* @type auto * @description Gets the current position information * @scenario Create and start location manager\n * Get the current position information\n -* Stop and Destroy location manager +* Stop and Destroy location manager * @apicovered location_manager_get_position * @passcase When location_manager_get_position is successful * @failcase If target API fails or any precondition API fails @@ -963,7 +954,7 @@ int ITc_location_manager_get_velocity_p(void) * @description Adds/Removes bounds for a given location manager. * @scenario Adds bounds for a given location manager\n * Deletes bounds for a given location manager. -* @apicovered location_manager_add_boundary, location_manager_remove_boundary +* @apicovered location_manager_add_boundary, location_manager_remove_boundary * @passcase When location_manager_add_boundary and location_manager_remove_boundary are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -1011,7 +1002,7 @@ int ITc_location_manager_add_remove_boundary_circle_p(void) * @description Adds/Removes bounds for a given location manager. * @scenario Adds bounds for a given location manager\n * Deletes bounds for a given location manager. -* @apicovered location_manager_add_boundary, location_manager_remove_boundary +* @apicovered location_manager_add_boundary, location_manager_remove_boundary * @passcase When location_manager_add_boundary and location_manager_remove_boundary are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -1061,7 +1052,7 @@ int ITc_location_manager_add_remove_boundary_rect_p(void) * @description Adds/Removes bounds for a given location manager. * @scenario Adds bounds for a given location manager\n * Deletes bounds for a given location manager. -* @apicovered location_manager_add_boundary, location_manager_remove_boundary +* @apicovered location_manager_add_boundary, location_manager_remove_boundary * @passcase When location_manager_add_boundary and location_manager_remove_boundary are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -1112,7 +1103,7 @@ int ITc_location_manager_add_remove_boundary_polygon_p(void) * @description Registers/Unregisters a callback function to be invoked periodically with updated position information * @scenario Registers a callback function to be invoked periodically with updated position information\n * Unregisters the callback function -* @apicovered location_manager_set_position_updated_cb, location_manager_unset_position_updated_cb +* @apicovered location_manager_set_position_updated_cb, location_manager_unset_position_updated_cb * @passcase When location_manager_set_position_updated_cb and location_manager_unset_position_updated_cb are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -1147,7 +1138,7 @@ int ITc_location_manager_set_unset_position_updated_cb_p(void) * @description Registers/Unregisters a callback function to be invoked periodically with updated velocity information * @scenario Registers a callback function to be invoked periodically with updated velocity information\n * Unregisters the callback function -* @apicovered location_manager_set_velocity_updated_cb, location_manager_unset_velocity_updated_cb +* @apicovered location_manager_set_velocity_updated_cb, location_manager_unset_velocity_updated_cb * @passcase When location_manager_set_velocity_updated_cb and location_manager_unset_velocity_updated_cb are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -1183,7 +1174,7 @@ int ITc_location_manager_set_unset_velocity_updated_cb(void) * @scenario Registers a callback function to be invoked when the previously set boundary area is entered or left\n * Check if callback is invoked\n * Unregisters the callback function -* @apicovered location_manager_set_zone_changed_cb, location_manager_unset_zone_changed_cb +* @apicovered location_manager_set_zone_changed_cb, location_manager_unset_zone_changed_cb * @passcase When location_manager_set_zone_changed_cb and location_manager_unset_zone_changed_cb are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -1247,7 +1238,7 @@ int ITc_location_manager_foreach_boundary_p(void) // Target API nRet = location_manager_foreach_boundary(g_stManager, LocationBoundsCB, NULL); PRINT_RESULT_CLEANUP(LOCATIONS_ERROR_NONE, nRet, "location_manager_foreach_boundary", LocationManagerGetError(nRet), location_bounds_destroy(bounds_circle)); - + RUN_POLLING_LOOP; if ( g_bCallbackHit != true || g_bCallbackReturnValue != true ) { @@ -1265,7 +1256,7 @@ int ITc_location_manager_foreach_boundary_p(void) return 0; } -//& purpose: Registers/Unregisters a callback function to be invoked when the location setting is changed. +//& purpose: Registers/Unregisters a callback function to be invoked when the location setting is changed. //& type: auto /** @@ -1273,11 +1264,11 @@ int ITc_location_manager_foreach_boundary_p(void) * @since_tizen 2.3 * @author SRID(sameer.g1) * @reviewer SRID(gupta.sanjay) -* @type auto -* @description Registers/Unregisters a callback function to be invoked when the location setting is changed. +* @type auto +* @description Registers/Unregisters a callback function to be invoked when the location setting is changed. * @scenario Registers a callback function to be invoked when the location setting is changed\n * Unregisters the callback function -* @apicovered location_manager_set_setting_changed_cb, location_manager_unset_setting_changed_cb +* @apicovered location_manager_set_setting_changed_cb, location_manager_unset_setting_changed_cb * @passcase When location_manager_set_setting_changed_cb and location_manager_unset_setting_changed_cb are successful * @failcase If target API fails or any precondition API fails * @precondition None @@ -1321,7 +1312,7 @@ int ITc_location_manager_set_unset_setting_changed_cb_p(void) eTestLocationMethod = location_method[nEnumCounter]; } } - + if ( eTestLocationMethod != -1 ) { g_bCallbackHit = false; @@ -1339,7 +1330,7 @@ int ITc_location_manager_set_unset_setting_changed_cb_p(void) return 0; } -//& purpose: Request to update current location once. +//& purpose: Request to update current location once. //& type: auto /** @@ -1348,7 +1339,7 @@ int ITc_location_manager_set_unset_setting_changed_cb_p(void) * @author SRID(sameer.g1) * @reviewer SRID(gupta.sanjay) * @type auto -* @description Request to update current location once. +* @description Request to update current location once. * @scenario Create location manager\n * Request to update current location once\n * check callback\n @@ -1362,25 +1353,25 @@ int ITc_location_manager_set_unset_setting_changed_cb_p(void) int ITc_location_manager_request_single_location_p(void) { START_TEST_MANAGER; - + int nTimeoutId = 0; int nTimeout = 30; - + // Target API int nRet = location_manager_request_single_location(g_stManager, nTimeout, LocationUpdatedCB, NULL); PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_request_single_location", LocationManagerGetError(nRet)); - + RUN_POLLING_LOOP; if ( g_bCallbackHit != true || g_bCallbackReturnValue != true ) { FPRINTF("[Line : %d][%s] Callback failed\\n", __LINE__, API_NAMESPACE); return 1; } - + return 0; } -//& purpose: Checks whether the given location method is enabled or not on setting. +//& purpose: Checks whether the given location method is enabled or not on setting. //& type: auto /** @@ -1389,7 +1380,7 @@ int ITc_location_manager_request_single_location_p(void) * @author SRID(sameer.g1) * @reviewer SRID(gupta.sanjay) * @type auto -* @description Checks whether the given location method is enabled or not on setting. +* @description Checks whether the given location method is enabled or not on setting. * @scenario Create manager\n * Check whether the given location method is enabled or not\n * Destroy manager @@ -1423,11 +1414,11 @@ int ITc_location_manager_is_enabled_method_p(void) * @since_tizen 2.4 * @author SRID(arjun.kumar) * @reviewer SRID(gupta.sanjay) - * @type auto + * @type auto * @description Registers/unregistered a callback function to be invoked at defined interval with updated location information. * @scenario Registers a callback function to be invoked at defined interval with updated location information. \n * Unregisters the callback function - * @apicovered location_manager_set_location_changed_cb , location_manager_unset_location_changed_cb + * @apicovered location_manager_set_location_changed_cb , location_manager_unset_location_changed_cb * @passcase When location_manager_set_location_changed_cb and location_manager_unset_location_changed_cb are successful. * @failcase If target api fails or any precondition api fails. * @precondition None @@ -1436,17 +1427,17 @@ int ITc_location_manager_is_enabled_method_p(void) int ITc_location_manager_set_unset_location_changed_cb_p(void) { START_TEST_MANAGER; - + int nTimeout = 1; - + // Set location changed Target API location_error_e nRet = location_manager_set_location_changed_cb(g_stManager, LocationChangedCB, nTimeout, NULL); - PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_set_location_changed_cb", LocationManagerGetError(nRet)); - + PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_set_location_changed_cb", LocationManagerGetError(nRet)); + // unset location changed Target API nRet = location_manager_unset_location_changed_cb(g_stManager); - PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_unset_location_changed_cb", LocationManagerGetError(nRet)); - + PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_unset_location_changed_cb", LocationManagerGetError(nRet)); + return 0; } @@ -1457,11 +1448,11 @@ int ITc_location_manager_set_unset_location_changed_cb_p(void) * @since_tizen 2.4 * @author SRID(arjun.kumar) * @reviewer SRID(gupta.sanjay) - * @type auto + * @type auto * @description Registers/unregisters a callback function to be invoked at minimum interval or minimum distance with updated position information. * @scenario Registers a callback function to be invoked at minimum interval or minimum distance with updated position information\n * Unregisters the callback function - * @apicovered location_manager_set_distance_based_location_changed_cb , location_manager_unset_distance_based_location_changed_cb + * @apicovered location_manager_set_distance_based_location_changed_cb , location_manager_unset_distance_based_location_changed_cb * @passcase When location_manager_set_location_changed_cb and location_manager_unset_location_changed_cb are successful. * @failcase If target api fails or any precondition api fails. * @precondition None @@ -1470,18 +1461,18 @@ int ITc_location_manager_set_unset_location_changed_cb_p(void) int ITc_location_manager_set_unset_distance_based_location_changed_cb_p(void) { START_TEST_MANAGER; - + int nInterval = 1; int nDistance = 1; - + // Set Distance based location changed Target API location_error_e nRet = location_manager_set_distance_based_location_changed_cb(g_stManager, LocationChangedCB, nInterval,nDistance,NULL); - PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_set_distance_based_location_changed_cb", LocationManagerGetError(nRet)); - + PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_set_distance_based_location_changed_cb", LocationManagerGetError(nRet)); + // unset Distance based location changed Target API nRet = location_manager_unset_distance_based_location_changed_cb(g_stManager); PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_unset_distance_based_location_changed_cb", LocationManagerGetError(nRet)); - + return 0; } @@ -1492,10 +1483,10 @@ int ITc_location_manager_set_unset_distance_based_location_changed_cb_p(void) * @since_tizen 3.0 * @author SRID(nibha.sharma) * @reviewer SRID(parshant.v) - * @type auto + * @type auto * @description enable the mock location when developer mode is enable * @scenario enable the mock location when developer mode is enable - * @apicovered location_manager_enable_mock_location + * @apicovered location_manager_enable_mock_location * @passcase When location_manager_enable_mock_location is successful. * @failcase If target api fails or any precondition api fails. * @precondition None @@ -1504,13 +1495,13 @@ int ITc_location_manager_set_unset_distance_based_location_changed_cb_p(void) int ITc_location_manager_enable_mock_location_p(void) { START_TEST_MANAGER; - + bool bIsEnable = false; - + //Target API int nRet = location_manager_enable_mock_location(bIsEnable); PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_enable_mock_location", LocationManagerGetError(nRet)); - + return 0; } @@ -1521,10 +1512,10 @@ int ITc_location_manager_enable_mock_location_p(void) * @since_tizen 3.0 * @author SRID(nibha.sharma) * @reviewer SRID(parshant.v) - * @type auto + * @type auto * @description Sets and clears a mock location for the given location method * @scenario Sets and clears a mock location for the given location method - * @apicovered location_manager_set_mock_location and location_manager_clear_mock_location + * @apicovered location_manager_set_mock_location and location_manager_clear_mock_location * @passcase When location_manager_set_mock_location and location_manager_clear_mock_location are successful. * @failcase If target api fails or any precondition api fails. * @precondition enable mock location and create location manager for mock location @@ -1533,8 +1524,7 @@ int ITc_location_manager_enable_mock_location_p(void) int ITc_location_manager_set_clear_mock_location_p(void) { START_TEST_MANAGER; - - location_manager_h hLocManagerHandle = {0}; + bool bIsEnable = true; bool bIsDisable = false; const double nLatitude = 10.0; @@ -1543,30 +1533,20 @@ int ITc_location_manager_set_clear_mock_location_p(void) const double nSpeed = 30.0; const double nDirection = 40.0; const double nAccuracy = 50.0; - - LocationManagerStopDestroy(&g_stManager); - g_bCleanupNotRequired = true; int nRet = location_manager_enable_mock_location(bIsEnable); PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_enable_mock_location", LocationManagerGetError(nRet)); - - nRet = location_manager_create(LOCATIONS_METHOD_MOCK, &hLocManagerHandle); - PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_create", LocationManagerGetError(nRet)); - CHECK_HANDLE(hLocManagerHandle,"location_manager_create"); - + //Target API - nRet = location_manager_set_mock_location(hLocManagerHandle, nLatitude, nLongitude, nAltitude, nSpeed, nDirection, nAccuracy); + nRet = location_manager_set_mock_location(g_stManager, nLatitude, nLongitude, nAltitude, nSpeed, nDirection, nAccuracy); PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_set_mock_location", LocationManagerGetError(nRet)); - + //Target API - nRet = location_manager_clear_mock_location(hLocManagerHandle); + nRet = location_manager_clear_mock_location(g_stManager); PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_clear_mock_location", LocationManagerGetError(nRet)); - + nRet = location_manager_enable_mock_location(bIsDisable); PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_enable_mock_location", LocationManagerGetError(nRet)); - - nRet = location_manager_destroy(hLocManagerHandle); - PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_destroy", LocationManagerGetError(nRet)); return 0; } diff --git a/src/utc/location-manager/tct-location-manager-core_mobile.h b/src/utc/location-manager/tct-location-manager-core_mobile.h index 0cfd5cb..92355f8 100755 --- a/src/utc/location-manager/tct-location-manager-core_mobile.h +++ b/src/utc/location-manager/tct-location-manager-core_mobile.h @@ -118,13 +118,11 @@ extern int utc_location_manager_unset_location_changed_cb_p(void); extern int utc_location_manager_unset_location_changed_cb_n(void); extern int utc_location_manager_create_p(void); extern int utc_location_manager_create_p2(void); -extern int utc_location_manager_create_p3(void); extern int utc_location_manager_create_n(void); extern int utc_location_manager_create_n2(void); extern int utc_location_manager_get_method_p(void); extern int utc_location_manager_get_method_p2(void); extern int utc_location_manager_get_method_p3(void); -extern int utc_location_manager_get_method_p4(void); extern int utc_location_manager_get_method_n(void); extern int utc_location_manager_get_position_p(void); extern int utc_location_manager_get_position_n(void); @@ -147,7 +145,6 @@ extern int utc_location_manager_get_last_velocity_n(void); extern int utc_location_manager_is_supported_method_p(void); extern int utc_location_manager_is_supported_method_p2(void); extern int utc_location_manager_is_supported_method_p3(void); -extern int utc_location_manager_is_supported_method_p4(void); extern int utc_location_manager_is_supported_method_n(void); extern int utc_location_manager_destroy_p(void); extern int utc_location_manager_destroy_n(void); @@ -156,7 +153,6 @@ extern int utc_location_manager_get_distance_n(void); extern int utc_location_manager_is_enabled_method_p(void); extern int utc_location_manager_is_enabled_method_p2(void); extern int utc_location_manager_is_enabled_method_p3(void); -extern int utc_location_manager_is_enabled_method_p4(void); extern int utc_location_manager_is_enabled_method_n(void); extern int utc_location_manager_is_enabled_method_n2(void); extern int utc_location_manager_request_single_location_p(void); @@ -164,6 +160,8 @@ extern int utc_location_manager_request_single_location_p2(void); extern int utc_location_manager_request_single_location_n(void); extern int utc_location_manager_request_single_location_n2(void); extern int utc_location_manager_request_single_location_n3(void); +extern int utc_location_manager_is_enabled_mock_location_p(void); +extern int utc_location_manager_is_enabled_mock_location_n(void); extern int utc_location_manager_enable_mock_location_p(void); extern int utc_location_manager_set_mock_location_p(void); extern int utc_location_manager_set_mock_location_n(void); @@ -282,13 +280,11 @@ testcase tc_array[] = { {"utc_location_manager_unset_location_changed_cb_n", utc_location_manager_unset_location_changed_cb_n, utc_location_manager_cb_startup, utc_location_manager_cb_cleanup}, {"utc_location_manager_create_p", utc_location_manager_create_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_create_p2", utc_location_manager_create_p2, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_create_p3", utc_location_manager_create_p3, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_create_n", utc_location_manager_create_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_create_n2", utc_location_manager_create_n2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_p", utc_location_manager_get_method_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_p2", utc_location_manager_get_method_p2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_p3", utc_location_manager_get_method_p3, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_get_method_p4", utc_location_manager_get_method_p4, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_n", utc_location_manager_get_method_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_position_p", utc_location_manager_get_position_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_position_n", utc_location_manager_get_position_n, utc_location_manager_startup, utc_location_manager_cleanup}, @@ -311,7 +307,6 @@ testcase tc_array[] = { {"utc_location_manager_is_supported_method_p", utc_location_manager_is_supported_method_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_supported_method_p2", utc_location_manager_is_supported_method_p2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_supported_method_p3", utc_location_manager_is_supported_method_p3, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_is_supported_method_p4", utc_location_manager_is_supported_method_p4, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_supported_method_n", utc_location_manager_is_supported_method_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_destroy_p", utc_location_manager_destroy_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_destroy_n", utc_location_manager_destroy_n, utc_location_manager_startup, utc_location_manager_cleanup}, @@ -320,7 +315,6 @@ testcase tc_array[] = { {"utc_location_manager_is_enabled_method_p", utc_location_manager_is_enabled_method_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_p2", utc_location_manager_is_enabled_method_p2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_p3", utc_location_manager_is_enabled_method_p3, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_is_enabled_method_p4", utc_location_manager_is_enabled_method_p4, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_n", utc_location_manager_is_enabled_method_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_n2", utc_location_manager_is_enabled_method_n2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_request_single_location_p", utc_location_manager_request_single_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, @@ -328,6 +322,8 @@ testcase tc_array[] = { {"utc_location_manager_request_single_location_n", utc_location_manager_request_single_location_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_request_single_location_n2", utc_location_manager_request_single_location_n2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_request_single_location_n3", utc_location_manager_request_single_location_n3, utc_location_manager_startup, utc_location_manager_cleanup}, + {"utc_location_manager_is_enabled_mock_location_p", utc_location_manager_is_enabled_mock_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, + {"utc_location_manager_is_enabled_mock_location_n", utc_location_manager_is_enabled_mock_location_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_enable_mock_location_p", utc_location_manager_enable_mock_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_set_mock_location_p", utc_location_manager_set_mock_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_set_mock_location_n", utc_location_manager_set_mock_location_n, utc_location_manager_startup, utc_location_manager_cleanup}, diff --git a/src/utc/location-manager/tct-location-manager-core_wearable.h b/src/utc/location-manager/tct-location-manager-core_wearable.h index 0cfd5cb..92355f8 100755 --- a/src/utc/location-manager/tct-location-manager-core_wearable.h +++ b/src/utc/location-manager/tct-location-manager-core_wearable.h @@ -118,13 +118,11 @@ extern int utc_location_manager_unset_location_changed_cb_p(void); extern int utc_location_manager_unset_location_changed_cb_n(void); extern int utc_location_manager_create_p(void); extern int utc_location_manager_create_p2(void); -extern int utc_location_manager_create_p3(void); extern int utc_location_manager_create_n(void); extern int utc_location_manager_create_n2(void); extern int utc_location_manager_get_method_p(void); extern int utc_location_manager_get_method_p2(void); extern int utc_location_manager_get_method_p3(void); -extern int utc_location_manager_get_method_p4(void); extern int utc_location_manager_get_method_n(void); extern int utc_location_manager_get_position_p(void); extern int utc_location_manager_get_position_n(void); @@ -147,7 +145,6 @@ extern int utc_location_manager_get_last_velocity_n(void); extern int utc_location_manager_is_supported_method_p(void); extern int utc_location_manager_is_supported_method_p2(void); extern int utc_location_manager_is_supported_method_p3(void); -extern int utc_location_manager_is_supported_method_p4(void); extern int utc_location_manager_is_supported_method_n(void); extern int utc_location_manager_destroy_p(void); extern int utc_location_manager_destroy_n(void); @@ -156,7 +153,6 @@ extern int utc_location_manager_get_distance_n(void); extern int utc_location_manager_is_enabled_method_p(void); extern int utc_location_manager_is_enabled_method_p2(void); extern int utc_location_manager_is_enabled_method_p3(void); -extern int utc_location_manager_is_enabled_method_p4(void); extern int utc_location_manager_is_enabled_method_n(void); extern int utc_location_manager_is_enabled_method_n2(void); extern int utc_location_manager_request_single_location_p(void); @@ -164,6 +160,8 @@ extern int utc_location_manager_request_single_location_p2(void); extern int utc_location_manager_request_single_location_n(void); extern int utc_location_manager_request_single_location_n2(void); extern int utc_location_manager_request_single_location_n3(void); +extern int utc_location_manager_is_enabled_mock_location_p(void); +extern int utc_location_manager_is_enabled_mock_location_n(void); extern int utc_location_manager_enable_mock_location_p(void); extern int utc_location_manager_set_mock_location_p(void); extern int utc_location_manager_set_mock_location_n(void); @@ -282,13 +280,11 @@ testcase tc_array[] = { {"utc_location_manager_unset_location_changed_cb_n", utc_location_manager_unset_location_changed_cb_n, utc_location_manager_cb_startup, utc_location_manager_cb_cleanup}, {"utc_location_manager_create_p", utc_location_manager_create_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_create_p2", utc_location_manager_create_p2, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_create_p3", utc_location_manager_create_p3, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_create_n", utc_location_manager_create_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_create_n2", utc_location_manager_create_n2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_p", utc_location_manager_get_method_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_p2", utc_location_manager_get_method_p2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_p3", utc_location_manager_get_method_p3, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_get_method_p4", utc_location_manager_get_method_p4, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_method_n", utc_location_manager_get_method_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_position_p", utc_location_manager_get_position_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_get_position_n", utc_location_manager_get_position_n, utc_location_manager_startup, utc_location_manager_cleanup}, @@ -311,7 +307,6 @@ testcase tc_array[] = { {"utc_location_manager_is_supported_method_p", utc_location_manager_is_supported_method_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_supported_method_p2", utc_location_manager_is_supported_method_p2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_supported_method_p3", utc_location_manager_is_supported_method_p3, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_is_supported_method_p4", utc_location_manager_is_supported_method_p4, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_supported_method_n", utc_location_manager_is_supported_method_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_destroy_p", utc_location_manager_destroy_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_destroy_n", utc_location_manager_destroy_n, utc_location_manager_startup, utc_location_manager_cleanup}, @@ -320,7 +315,6 @@ testcase tc_array[] = { {"utc_location_manager_is_enabled_method_p", utc_location_manager_is_enabled_method_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_p2", utc_location_manager_is_enabled_method_p2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_p3", utc_location_manager_is_enabled_method_p3, utc_location_manager_startup, utc_location_manager_cleanup}, - {"utc_location_manager_is_enabled_method_p4", utc_location_manager_is_enabled_method_p4, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_n", utc_location_manager_is_enabled_method_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_is_enabled_method_n2", utc_location_manager_is_enabled_method_n2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_request_single_location_p", utc_location_manager_request_single_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, @@ -328,6 +322,8 @@ testcase tc_array[] = { {"utc_location_manager_request_single_location_n", utc_location_manager_request_single_location_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_request_single_location_n2", utc_location_manager_request_single_location_n2, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_request_single_location_n3", utc_location_manager_request_single_location_n3, utc_location_manager_startup, utc_location_manager_cleanup}, + {"utc_location_manager_is_enabled_mock_location_p", utc_location_manager_is_enabled_mock_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, + {"utc_location_manager_is_enabled_mock_location_n", utc_location_manager_is_enabled_mock_location_n, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_enable_mock_location_p", utc_location_manager_enable_mock_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_set_mock_location_p", utc_location_manager_set_mock_location_p, utc_location_manager_startup, utc_location_manager_cleanup}, {"utc_location_manager_set_mock_location_n", utc_location_manager_set_mock_location_n, utc_location_manager_startup, utc_location_manager_cleanup}, diff --git a/src/utc/location-manager/utc-location-manager.c b/src/utc/location-manager/utc-location-manager.c index 6a7461b..5c7a8cd 100755 --- a/src/utc/location-manager/utc-location-manager.c +++ b/src/utc/location-manager/utc-location-manager.c @@ -156,34 +156,6 @@ int utc_location_manager_create_p2(void) } /** - * @testcase utc_location_manager_create_p3 - * @since_tizen 3.0 - * @description Creates a new location manager handle for MOCK - */ -int utc_location_manager_create_p3(void) -{ - location_manager_h manager2 = NULL; - - ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2); - if (is_location_supported) { - assert_eq(ret, LOCATIONS_ERROR_NONE); - - ret = location_manager_destroy(manager2); - assert_eq(ret, LOCATIONS_ERROR_NONE); - manager2 = NULL; - - if (manager) { - ret = location_manager_destroy(manager); - assert_eq(ret, LOCATIONS_ERROR_NONE); - manager = NULL; - } - } else { - assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED); - } - return 0; -} - -/** * @testcase utc_location_manager_create_n * @since_tizen 2.3 * @description Creates a new location manager handle with invalid parameter @@ -306,36 +278,6 @@ int utc_location_manager_get_method_p3(void) return 0; } -/** - * @testcase utc_location_manager_get_method_p4 - * @since_tizen 3.0 - * @description Gets the given location manager's method - */ -int utc_location_manager_get_method_p4(void) -{ - location_method_e method; - location_manager_h manager2 = NULL; - - if (is_location_supported) { - ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2); - assert_eq(ret, LOCATIONS_ERROR_NONE); - - ret = location_manager_get_method(manager2, &method); - assert_eq(ret, LOCATIONS_ERROR_NONE); - assert_eq(method, LOCATIONS_METHOD_MOCK); - - if (manager2) { - ret = location_manager_destroy(manager2); - assert_eq(ret, LOCATIONS_ERROR_NONE); - manager2 = NULL; - } - } else { - ret = location_manager_get_method(manager2, &method); - assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED); - } - return 0; -} - /** * @testcase utc_location_manager_get_method_n @@ -940,27 +882,6 @@ int utc_location_manager_is_supported_method_p3(void) } /** - * @testcase utc_location_manager_is_supported_method_p4 - * @since_tizen 3.0 - * @description Checks whether the given location method is available - */ -int utc_location_manager_is_supported_method_p4(void) -{ - bool ret_bool = false; - ret_bool = location_manager_is_supported_method(LOCATIONS_METHOD_MOCK); - ret = get_last_result(); - - if (is_location_supported) { - assert_eq(ret_bool, true); - assert_eq(ret, LOCATIONS_ERROR_NONE); - } else { - assert_eq(ret_bool, false); - assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED); - } - return 0; -} - -/** * @testcase utc_location_manager_is_supported_method_n * @since_tizen 2.3 * @description Checks whether the given location method is available @@ -1097,20 +1018,6 @@ int utc_location_manager_is_enabled_method_p3(void) } /** - * @testcase utc_location_manager_is_enabled_method_p4 - * @since_tizen 3.0 - * @description Checks whether the given location method is enabled or not on setting - */ -int utc_location_manager_is_enabled_method_p4(void) -{ - bool enabled = false; - - ret = location_manager_is_enabled_method(LOCATIONS_METHOD_MOCK, &enabled); - CHECK_ERROR_NONE(is_location_supported, ret); - return 0; -} - -/** * @testcase utc_location_manager_is_enabled_method_n * @since_tizen 2.3 * @description Checks the method is available or not with invalid parameter @@ -1232,6 +1139,31 @@ int utc_location_manager_request_single_location_n3(void) } /** + * @testcase utc_location_manager_is_enabled_mock_location_p + * @since_tizen 3.0 + * @description Checks whether the mock location is enabled or not + */ +int utc_location_manager_is_enabled_mock_location_p(void) +{ + bool enabled = false; + ret = location_manager_is_enabled_mock_location(&enabled); + CHECK_ERROR_NONE(is_location_supported, ret); + return 0; +} + +/** + * @testcase utc_location_manager_is_enabled_mock_location_n + * @since_tizen 3.0 + * @description Checks whether the mock location is enabled or not + */ +int utc_location_manager_is_enabled_mock_location_n(void) +{ + ret = location_manager_is_enabled_mock_location(NULL); + CHECK_INVALID_PARAMETER(is_location_supported, ret); + return 0; +} + +/** * @testcase utc_location_manager_enable_mock_location_p * @since_tizen 3.0 * @description Enable mock location @@ -1253,7 +1185,6 @@ int utc_location_manager_enable_mock_location_p(void) */ int utc_location_manager_set_mock_location_p(void) { - location_manager_h manager2 = NULL; double latitude = 10.0; double longitude = 20.0; double altitude = 30.0; @@ -1264,51 +1195,37 @@ int utc_location_manager_set_mock_location_p(void) service_enabled = false; if (is_location_supported) { - - if (manager) { - ret = location_manager_destroy(manager); - assert_eq(ret, LOCATIONS_ERROR_NONE); - manager = NULL; - } - - ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2); - assert_eq(ret, LOCATIONS_ERROR_NONE); - 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); + ret = location_manager_set_mock_location(manager, latitude, longitude, altitude, speed, direction, accuracy); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_set_service_state_changed_cb(manager2, __service_state_changed_cb, NULL); + ret = location_manager_set_service_state_changed_cb(manager, __service_state_changed_cb, NULL); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_start(manager2); + ret = location_manager_start(manager); assert_eq(ret, LOCATIONS_ERROR_NONE); wait_for_service(); assert(service_enabled); - ret = location_manager_get_position(manager2, &altitude, &latitude, &longitude, ×tamp); + ret = location_manager_get_position(manager, &altitude, &latitude, &longitude, ×tamp); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_stop(manager2); + ret = location_manager_stop(manager); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_clear_mock_location(manager2); + ret = location_manager_clear_mock_location(manager); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_unset_service_state_changed_cb(manager2); + ret = location_manager_unset_service_state_changed_cb(manager); assert_eq(ret, LOCATIONS_ERROR_NONE); 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); + ret = location_manager_set_mock_location(manager, latitude, longitude, altitude, speed, direction, accuracy); assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED); } @@ -1355,7 +1272,6 @@ int utc_location_manager_set_mock_location_n(void) */ int utc_location_manager_clear_mock_location_p(void) { - location_manager_h manager2 = NULL; double latitude = 10.0; double longitude = 20.0; double altitude = 30.0; @@ -1366,48 +1282,34 @@ int utc_location_manager_clear_mock_location_p(void) service_enabled = false; if (is_location_supported) { - - if (manager) { - ret = location_manager_destroy(manager); - assert_eq(ret, LOCATIONS_ERROR_NONE); - manager = NULL; - } - - ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2); - assert_eq(ret, LOCATIONS_ERROR_NONE); - 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); + ret = location_manager_set_mock_location(manager, latitude, longitude, altitude, speed, direction, accuracy); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_set_service_state_changed_cb(manager2, __service_state_changed_cb, NULL); + ret = location_manager_set_service_state_changed_cb(manager, __service_state_changed_cb, NULL); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_start(manager2); + ret = location_manager_start(manager); assert_eq(ret, LOCATIONS_ERROR_NONE); wait_for_service(); assert(service_enabled); - ret = location_manager_get_position(manager2, &altitude, &latitude, &longitude, ×tamp); + ret = location_manager_get_position(manager, &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); + ret = location_manager_stop(manager); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_enable_mock_location(false); + ret = location_manager_clear_mock_location(manager); assert_eq(ret, LOCATIONS_ERROR_NONE); - ret = location_manager_destroy(manager2); + ret = location_manager_enable_mock_location(false); assert_eq(ret, LOCATIONS_ERROR_NONE); - manager2 = NULL; } else { - ret = location_manager_clear_mock_location(manager2); + ret = location_manager_clear_mock_location(manager); assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED); } -- 2.7.4