[ITC][capi-maps-service][Non-ACR][Fixed failed TCs]
authormanu.tiwari <manu.tiwari@samsung.com>
Wed, 5 Oct 2016 12:24:19 +0000 (17:54 +0530)
committermanu.tiwari <manu.tiwari@samsung.com>
Wed, 5 Oct 2016 12:42:28 +0000 (18:12 +0530)
Change-Id: Ie9813819f7c0f381a7faee8d0ee3c1c482c42537
Signed-off-by: manu.tiwari <manu.tiwari@samsung.com>
src/itc/capi-maps-service/ITs-capi-maps-view-object.c
src/itc/capi-maps-service/ITs-capi-maps-view.c

index e8d80330d38d7caccb05c127277b0d914968a041..6cd52f8ba0ef7414101b08f877d02df2fbdf0956 100755 (executable)
@@ -1564,50 +1564,55 @@ int ITc_maps_view_object_create_overlay_p(void)
        maps_view_object_h hOverlay = NULL;
        double dX = 0.0, dY = 0.0;
        int nLoopCount;
-       Evas_Object *win = NULL;
+       elm_init(0, NULL);
+       elm_config_accel_preference_set("opengl");
+       elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
        
-       win = elm_win_add(NULL, "sample", ELM_WIN_BASIC);
+       Evas_Object * win = elm_win_add(NULL, "sample", ELM_WIN_BASIC);
        elm_win_autodel_set(win, TRUE);
        
        Evas_Object *object = elm_button_add(win);
        
        bool bMapsFeatureSupported = TCTCheckSystemInfoFeatureSupported(MAPS_FEATURE, API_NAMESPACE);
        
+       
        maps_view_overlay_type_e eMapViewOverlayType[] = {  MAPS_VIEW_OVERLAY_NORMAL,   /**< Indicates the normal type */
-                                                                                                               MAPS_VIEW_OVERLAY_BUBBLE,       /**< Indicates the bubble type */
+                                                                                                       MAPS_VIEW_OVERLAY_BUBBLE,       /**< Indicates the bubble type */
                                                                                                                MAPS_VIEW_OVERLAY_BOX};         /**< Indicates the box type */
 
        int nMapViewOverlayArraySize = sizeof(eMapViewOverlayType) / sizeof(eMapViewOverlayType[0]);
        
-       int nRet = maps_coordinates_create(dX, dY, &hCoord);
-       if ( false == bMapsFeatureSupported)
-       {
-               if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
-               {
-                       FPRINTF("[Line : %d][%s] maps_coordinates_create API call returned mismatch %s error for unsupported maps feature\\n", __LINE__, API_NAMESPACE, MapServiceGetError(nRet));
-                       return 1;
-               }
-               else
-               {
-                       FPRINTF("[Line : %d][%s] maps_coordinates_create API call correctly returned %s error for unsupported maps feature\\n", __LINE__, API_NAMESPACE, MapServiceGetError(nRet));
-                       return 0;
-               }
-       }
-       PRINT_RESULT(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet));
-       CHECK_HANDLE(hCoord, "maps_coordinates_create");
+       
        
        for(nLoopCount = 0; nLoopCount < nMapViewOverlayArraySize; nLoopCount++)
        {
+               int nRet = maps_coordinates_create(0.0,0.0, &hCoord);
+               if ( false == bMapsFeatureSupported)
+               {
+                       if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
+                       {
+                               FPRINTF("[Line : %d][%s] maps_coordinates_create API call returned mismatch %s error for unsupported maps feature\\n", __LINE__, API_NAMESPACE, MapServiceGetError(nRet));
+                               return 1;
+                       }
+                       else
+                       {
+                               FPRINTF("[Line : %d][%s] maps_coordinates_create API call correctly returned %s error for unsupported maps feature\\n", __LINE__, API_NAMESPACE, MapServiceGetError(nRet));
+                               return 0;
+                       }
+               }
+               PRINT_RESULT(MAPS_ERROR_NONE, nRet, "maps_coordinates_create", MapServiceGetError(nRet));
+               CHECK_HANDLE(hCoord, "maps_coordinates_create");
+               
                nRet = maps_view_object_create_overlay(hCoord, object, eMapViewOverlayType[nLoopCount], &hOverlay);
+
                PRINT_RESULT_CLEANUP(MAPS_ERROR_NONE, nRet, "maps_view_object_create_overlay", MapServiceGetError(nRet), maps_coordinates_destroy(hCoord));
                CHECK_HANDLE_CLEANUP(hOverlay, "maps_view_object_create_overlay", maps_coordinates_destroy(hCoord));
                        
                nRet = maps_view_object_destroy(hOverlay);
                PRINT_RESULT_NORETURN(MAPS_ERROR_NONE, nRet, "maps_view_object_destroy", MapServiceGetError(nRet));
        }
-       
-       nRet = maps_coordinates_destroy(hCoord);
-       PRINT_RESULT_NORETURN(MAPS_ERROR_NONE, nRet, "maps_coordinates_destroy", MapServiceGetError(nRet));
+       elm_shutdown();
+       win = NULL;
        
        return 0;
 }
@@ -1777,11 +1782,15 @@ int ITc_maps_view_object_overlay_set_get_min_zoom_level_p(void)
        int nSetZoomLevel = 2;
        int nGetZoomLevel;
        bool bMapsFeatureSupported = TCTCheckSystemInfoFeatureSupported(MAPS_FEATURE, API_NAMESPACE);
-       
+
+       elm_init(0, NULL);
+       elm_config_accel_preference_set("opengl");
+
+       elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
        win = elm_win_add(NULL, "sample", ELM_WIN_BASIC);
        elm_win_autodel_set(win, TRUE);
        Evas_Object *object = elm_button_add(win);
-       
+
        int nRet = maps_coordinates_create(dX, dY, &hCoord);
        if ( false == bMapsFeatureSupported)
        {
@@ -1812,16 +1821,12 @@ int ITc_maps_view_object_overlay_set_get_min_zoom_level_p(void)
        {
                FPRINTF("[Line : %d][%s] Mismatch in set and get zoom level \\n", __LINE__, API_NAMESPACE);
                maps_view_object_destroy(hOverlay);
-               maps_coordinates_destroy(hCoord);
                return 1;
        }
        
        nRet = maps_view_object_destroy(hOverlay);
        PRINT_RESULT_NORETURN(MAPS_ERROR_NONE, nRet, "maps_view_object_destroy", MapServiceGetError(nRet));
-       
-       nRet = maps_coordinates_destroy(hCoord);
-       PRINT_RESULT_NORETURN(MAPS_ERROR_NONE, nRet, "maps_coordinates_destroy", MapServiceGetError(nRet));
-       
+
        return 0;
 }
 
index 6760aa7b03a079126bdf152b281ce9344ea75ae8..4b8bfcd9c4eead52145728f8041adacba7cc3cda 100755 (executable)
@@ -57,11 +57,14 @@ void ITs_maps_view_startup(void)
                remove(ERR_LOG);
        }
        
+       
        bool bMapsFeatureSupported = TCTCheckSystemInfoFeatureSupported(MAPS_FEATURE, API_NAMESPACE);
+       
        elm_init(0,NULL);
        elm_config_accel_preference_set("opengl");
 
        elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+       
        g_pEvasWin  = elm_win_add(NULL, "sample", ELM_WIN_BASIC);
        if(g_pEvasWin == NULL)
        {
@@ -126,7 +129,8 @@ void ITs_maps_view_startup(void)
                g_CheckInitErr = false;
                return;
        }
-       nRet = maps_view_create(g_HandleMapService, g_hImage, &g_HandleMapView);
+       nRet = maps_view_create(g_HandleMapService, g_pEvasWin, &g_HandleMapView);
+       
        if ( nRet != MAPS_ERROR_NONE || g_HandleMapView == NULL)
        {
                FPRINTF("[Line : %d][%s] maps_service_create fail in startup error returned : %s \\n", __LINE__, API_NAMESPACE , MapServiceGetError(nRet));
@@ -1371,7 +1375,7 @@ int ITc_maps_view_set_unset_event_cb_p(void)
        int nRet = maps_view_set_event_cb(g_HandleMapView, MAPS_VIEW_EVENT_GESTURE, MapsViewEventCb, NULL);
        PRINT_RESULT(MAPS_ERROR_NONE, nRet, "maps_view_set_event_cb", MapServiceGetError(nRet));
        
-       nRet = maps_view_unset_event_cb(MapsViewEventCb, MAPS_VIEW_EVENT_GESTURE);
+       nRet = maps_view_unset_event_cb(g_HandleMapView, MAPS_VIEW_EVENT_GESTURE);
        PRINT_RESULT(MAPS_ERROR_NONE, nRet, "maps_view_unset_event_cb", MapServiceGetError(nRet));
        
        return 0;