[CTC]][platform-permission][Non-ACR][Addition of precondition check in testcases] 81/244381/2
authorchakradhar <v.pogiri@samsung.com>
Fri, 18 Sep 2020 04:03:40 +0000 (09:33 +0530)
committershobhit verma <shobhit.v@samsung.com>
Fri, 18 Sep 2020 12:50:36 +0000 (12:50 +0000)
Change-Id: I1609a9209b6fcc40b0511f85751fcde67b0dd877

src/ctc/platform-permission/CTs-platform-permission-location-manager.c

index 6736549742ee07298ac397c02fe524591256e22d..037450ba8f8bea98995d49c3659d8e18e4131751 100755 (executable)
@@ -279,9 +279,11 @@ int CTc_Location_PrivilegeLocation_set_mock_location(void)
        location_manager_h hLocationManager = NULL;
        int nRet = location_manager_create(eLocationMethod, &hLocationManager);
        PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_create", LocationManagerGetError(nRet));
-                       
-       //Target API
-       nRet = location_manager_set_mock_location(hLocationManager, nLatitude, nLongitude, nAltitude, nSpeed, nDirection, nAccuracy);
+
+       nRet = location_manager_enable_mock_location(true);
+       if(nRet == LOCATIONS_ERROR_NONE)
+               //Target API
+               nRet = location_manager_set_mock_location(hLocationManager, nLatitude, nLongitude, nAltitude, nSpeed, nDirection, nAccuracy);
        PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, nRet, "location_manager_set_mock_location", LocationManagerGetError(nRet), location_manager_destroy(hLocationManager));
        location_manager_destroy(hLocationManager);
        
@@ -326,7 +328,9 @@ int CTc_Location_PrivilegeLocation_clear_mock_location(void)
        int nRet = location_manager_create(eLocationMethod, &hLocationManager);
        PRINT_RESULT(LOCATIONS_ERROR_NONE, nRet, "location_manager_create", LocationManagerGetError(nRet));     
 
-       nRet = location_manager_clear_mock_location(hLocationManager);
+       nRet = location_manager_enable_mock_location(true);
+       if(nRet == LOCATIONS_ERROR_NONE)
+               nRet = location_manager_clear_mock_location(hLocationManager);
        PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, nRet, "location_manager_clear_mock_location", LocationManagerGetError(nRet), location_manager_destroy(hLocationManager));
        location_manager_destroy(hLocationManager);