From: chakradhar Date: Wed, 23 Sep 2020 09:56:52 +0000 (+0530) Subject: [UTC][location-manager][ACR-1593][Added location_manager_get_velocity_accuracy API] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7dba9f0945e02b64dd88285cbd5ef1479cc67ec5;p=test%2Ftct%2Fnative%2Fapi.git [UTC][location-manager][ACR-1593][Added location_manager_get_velocity_accuracy API] Change-Id: I73384f9c5bec7c7f5c9b7892702241b7c93d4611 --- 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 7e7ea383b..724848e3a 100755 --- a/src/utc/location-manager/tct-location-manager-core_mobile.h +++ b/src/utc/location-manager/tct-location-manager-core_mobile.h @@ -50,6 +50,8 @@ extern int utc_location_manager_get_velocity_p(void); extern int utc_location_manager_get_velocity_n(void); extern int utc_location_manager_get_accuracy_p(void); extern int utc_location_manager_get_accuracy_n(void); +extern int utc_location_manager_get_velocity_accuracy_p(void); +extern int utc_location_manager_get_velocity_accuracy_n(void); extern int utc_location_manager_get_last_accuracy_p(void); extern int utc_location_manager_get_last_accuracy_n(void); extern int utc_location_manager_get_accessibility_state_p(void); @@ -213,6 +215,8 @@ testcase tc_array[] = { {"utc_location_manager_get_velocity_n",utc_location_manager_get_velocity_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accuracy_p",utc_location_manager_get_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accuracy_n",utc_location_manager_get_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, + {"utc_location_manager_get_velocity_accuracy_p",utc_location_manager_get_velocity_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, + {"utc_location_manager_get_velocity_accuracy_n",utc_location_manager_get_velocity_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_last_accuracy_p",utc_location_manager_get_last_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_last_accuracy_n",utc_location_manager_get_last_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accessibility_state_p",utc_location_manager_get_accessibility_state_p,utc_location_manager_startup,utc_location_manager_cleanup}, diff --git a/src/utc/location-manager/tct-location-manager-core_tizeniot.h b/src/utc/location-manager/tct-location-manager-core_tizeniot.h index 7e7ea383b..724848e3a 100755 --- a/src/utc/location-manager/tct-location-manager-core_tizeniot.h +++ b/src/utc/location-manager/tct-location-manager-core_tizeniot.h @@ -50,6 +50,8 @@ extern int utc_location_manager_get_velocity_p(void); extern int utc_location_manager_get_velocity_n(void); extern int utc_location_manager_get_accuracy_p(void); extern int utc_location_manager_get_accuracy_n(void); +extern int utc_location_manager_get_velocity_accuracy_p(void); +extern int utc_location_manager_get_velocity_accuracy_n(void); extern int utc_location_manager_get_last_accuracy_p(void); extern int utc_location_manager_get_last_accuracy_n(void); extern int utc_location_manager_get_accessibility_state_p(void); @@ -213,6 +215,8 @@ testcase tc_array[] = { {"utc_location_manager_get_velocity_n",utc_location_manager_get_velocity_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accuracy_p",utc_location_manager_get_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accuracy_n",utc_location_manager_get_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, + {"utc_location_manager_get_velocity_accuracy_p",utc_location_manager_get_velocity_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, + {"utc_location_manager_get_velocity_accuracy_n",utc_location_manager_get_velocity_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_last_accuracy_p",utc_location_manager_get_last_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_last_accuracy_n",utc_location_manager_get_last_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accessibility_state_p",utc_location_manager_get_accessibility_state_p,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 7e7ea383b..724848e3a 100755 --- a/src/utc/location-manager/tct-location-manager-core_wearable.h +++ b/src/utc/location-manager/tct-location-manager-core_wearable.h @@ -50,6 +50,8 @@ extern int utc_location_manager_get_velocity_p(void); extern int utc_location_manager_get_velocity_n(void); extern int utc_location_manager_get_accuracy_p(void); extern int utc_location_manager_get_accuracy_n(void); +extern int utc_location_manager_get_velocity_accuracy_p(void); +extern int utc_location_manager_get_velocity_accuracy_n(void); extern int utc_location_manager_get_last_accuracy_p(void); extern int utc_location_manager_get_last_accuracy_n(void); extern int utc_location_manager_get_accessibility_state_p(void); @@ -213,6 +215,8 @@ testcase tc_array[] = { {"utc_location_manager_get_velocity_n",utc_location_manager_get_velocity_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accuracy_p",utc_location_manager_get_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accuracy_n",utc_location_manager_get_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, + {"utc_location_manager_get_velocity_accuracy_p",utc_location_manager_get_velocity_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, + {"utc_location_manager_get_velocity_accuracy_n",utc_location_manager_get_velocity_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_last_accuracy_p",utc_location_manager_get_last_accuracy_p,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_last_accuracy_n",utc_location_manager_get_last_accuracy_n,utc_location_manager_startup,utc_location_manager_cleanup}, {"utc_location_manager_get_accessibility_state_p",utc_location_manager_get_accessibility_state_p,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 883dfef9f..b0a4cc0d6 100755 --- a/src/utc/location-manager/utc-location-manager.c +++ b/src/utc/location-manager/utc-location-manager.c @@ -712,6 +712,60 @@ int utc_location_manager_get_accuracy_n(void) return 0; } +/** + * @testcase utc_location_manager_get_velocity_accuracy_p + * @since_tizen 6.0 + * @description Gets the current velocity accuracy information + */ +int utc_location_manager_get_velocity_accuracy_p(void) +{ + double velocity_accuracy = 0.0; + service_enabled = false; + + if (is_location_supported) { + ret = location_manager_set_service_state_changed_cb(manager, __service_state_changed_cb, NULL); + assert_eq(ret, LOCATIONS_ERROR_NONE); + + ret = location_manager_start(manager); + assert_eq(ret, LOCATIONS_ERROR_NONE); + + wait_for_service(); + assert(service_enabled); + + ret = location_manager_get_velocity_accuracy(manager, &velocity_accuracy); + assert_eq(ret, LOCATIONS_ERROR_NONE); + + ret = location_manager_stop(manager); + assert_eq(ret, LOCATIONS_ERROR_NONE); + + ret = location_manager_unset_service_state_changed_cb(manager); + assert_eq(ret, LOCATIONS_ERROR_NONE); + } else { + ret = location_manager_get_velocity_accuracy(manager, &velocity_accuracy); + assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED); + } + + return 0; +} + +/** + * @testcase utc_location_manager_get_velocity_accuracy_n + * @since_tizen 6.0 + * @description Gets the current velocity accuracy information with invalid parameters + */ +int utc_location_manager_get_velocity_accuracy_n(void) +{ + double velocity_accuracy = 0.0; + + ret = location_manager_get_velocity_accuracy(NULL, &velocity_accuracy); + CHECK_INVALID_PARAMETER(is_location_supported, ret); + + ret = location_manager_get_velocity_accuracy(manager, NULL); + CHECK_INVALID_PARAMETER(is_location_supported, ret); + + return 0; +} + /** * @testcase utc_location_manager_get_last_accuracy_p * @since_tizen 2.3