[UTC][location-manager][Non-ACR][fixed that crash issues even happened although all...
authorchanywa <cbible.kim@samsung.com>
Mon, 18 Jul 2016 02:01:59 +0000 (11:01 +0900)
committerchanywa <cbible.kim@samsung.com>
Mon, 18 Jul 2016 02:01:59 +0000 (11:01 +0900)
Change-Id: I9b9d5cfc738bfc6acb7c592564da16c402f674b6
Signed-off-by: chanywa <cbible.kim@samsung.com>
src/utc/location-manager/utc-location-manager-batch.c
src/utc/location-manager/utc-location-manager.c

index db2acde..00d0b64 100755 (executable)
@@ -50,12 +50,12 @@ static void __location_batch_cb(int num_of_location, void *user_data)
                g_main_loop_quit(g_mainloop);
                g_mainloop = NULL;
        }
-
 }
 
 static bool __get_batch_cb(double latitude, double longitude, double altitude, double speed, double direction, double horizontal, double vertical, time_t timestamp, void *user_data)
 {
        __get_batch = true;
+       return true;
 }
 
 void utc_location_manager_batch_startup(void)
index ce9feff..6a7461b 100755 (executable)
@@ -1301,13 +1301,12 @@ int utc_location_manager_set_mock_location_p(void)
                ret = location_manager_unset_service_state_changed_cb(manager2);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
 
-               ret = location_manager_destroy(manager2);
-               assert_eq(ret, LOCATIONS_ERROR_NONE);
-               manager2 = NULL;
-
                ret = location_manager_enable_mock_location(false);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
 
+               ret = location_manager_destroy(manager2);
+               assert_eq(ret, LOCATIONS_ERROR_NONE);
+               manager2 = NULL;
        } else {
                ret = location_manager_set_mock_location(manager2, latitude, longitude, altitude, speed, direction, accuracy);
                assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED);
@@ -1363,6 +1362,8 @@ int utc_location_manager_clear_mock_location_p(void)
        double speed = 4.0;
        double direction = 50.1;
        double accuracy = 6.0;
+       time_t timestamp = 0.0;
+       service_enabled = false;
 
        if (is_location_supported) {
 
@@ -1372,24 +1373,39 @@ int utc_location_manager_clear_mock_location_p(void)
                        manager = NULL;
                }
 
-               ret = location_manager_enable_mock_location(true);
+               ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
 
-               ret = location_manager_create(LOCATIONS_METHOD_MOCK, &manager2);
+               ret = location_manager_enable_mock_location(true);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
 
                ret = location_manager_set_mock_location(manager2, latitude, longitude, altitude, speed, direction, accuracy);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
 
-               ret = location_manager_clear_mock_location(manager2);
+               ret = location_manager_set_service_state_changed_cb(manager2, __service_state_changed_cb, NULL);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
 
-               ret = location_manager_destroy(manager2);
+               ret = location_manager_start(manager2);
+               assert_eq(ret, LOCATIONS_ERROR_NONE);
+
+               wait_for_service();
+               assert(service_enabled);
+
+               ret = location_manager_get_position(manager2, &altitude, &latitude, &longitude, &timestamp);
+               assert_eq(ret, LOCATIONS_ERROR_NONE);
+
+               ret = location_manager_stop(manager2);
+               assert_eq(ret, LOCATIONS_ERROR_NONE);
+               
+               ret = location_manager_clear_mock_location(manager2);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
-               manager2 = NULL;
 
                ret = location_manager_enable_mock_location(false);
                assert_eq(ret, LOCATIONS_ERROR_NONE);
+
+               ret = location_manager_destroy(manager2);
+               assert_eq(ret, LOCATIONS_ERROR_NONE);
+               manager2 = NULL;
        } else {
                ret = location_manager_clear_mock_location(manager2);
                assert_eq(ret, LOCATIONS_ERROR_NOT_SUPPORTED);