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;
}
/**
* @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
*/
/**
* @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
*/
g_main_loop_quit(g_pLocationManagerMainLoop);
}
return;
-}
+}
/**
* @function ITs_location_manager_startup
// 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 )
{
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 )
{
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);
* @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
LOCATIONS_METHOD_GPS,
LOCATIONS_METHOD_WPS,
LOCATIONS_METHOD_HYBRID,
- LOCATIONS_METHOD_MOCK
};
int nEnumSize = sizeof(location_method) / sizeof(location_method[0]);
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);
* @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
//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 )
{
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;
//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 )
{
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);
* @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
* 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()
* @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
* @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
* @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
* @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
* @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
* @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
* @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
// 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 )
{
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
/**
* @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
eTestLocationMethod = location_method[nEnumCounter];
}
}
-
+
if ( eTestLocationMethod != -1 )
{
g_bCallbackHit = false;
return 0;
}
-//& purpose: Request to update current location once.
+//& purpose: Request to update current location once.
//& type: auto
/**
* @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
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
/**
* @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
* @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
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;
}
* @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
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;
}
* @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
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;
}
* @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
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;
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;
}
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);
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);
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);
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);
{"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},
{"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},
{"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},
{"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},
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);
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);
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);
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);
{"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},
{"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},
{"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},
{"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},
}
/**
- * @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
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
}
/**
- * @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
}
/**
- * @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
}
/**
+ * @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
*/
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;
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);
}
*/
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;
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);
}