[ITC][capi-maps-service][ACR-591][Added testcases for new API]
authorArvin Mittal <arvin.mittal@samsung.com>
Wed, 15 Jun 2016 06:57:08 +0000 (12:27 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Wed, 15 Jun 2016 07:32:47 +0000 (00:32 -0700)
Change-Id: If0bd64b830df3a1fbcb787968805e62aad8a5663
Signed-off-by: Arvin Mittal <arvin.mittal@samsung.com>
src/itc/capi-maps-service/ITs-capi-maps-view.c
src/itc/capi-maps-service/tct-capi-maps-service-native_mobile.h
src/itc/capi-maps-service/tct-capi-maps-service-native_wearable.h

index 58e36df..5b5cc68 100644 (file)
@@ -776,7 +776,7 @@ int ITc_maps_view_set_get_gesture_enabled_p(void)
        bool setEnabled = false;
        bool getEnabled;
        int nRet, nLoopCount = 0;
-       maps_view_gesture_e eMapViewGestureType[] = {MAPS_VIEW_GESTURE_NONE, MAPS_VIEW_GESTURE_SCROLL, MAPS_VIEW_GESTURE_ZOOM, MAPS_VIEW_GESTURE_TAP, MAPS_VIEW_GESTURE_DOUBLE_TAP, MAPS_VIEW_GESTURE_2_FINGER_TAP, /* MAPS_VIEW_GESTURE_SINGLE_FINGER_ZOOM,*/ MAPS_VIEW_GESTURE_ROTATE, MAPS_VIEW_GESTURE_LONG_PRESS};
+       maps_view_gesture_e eMapViewGestureType[] = {MAPS_VIEW_GESTURE_NONE, MAPS_VIEW_GESTURE_SCROLL, MAPS_VIEW_GESTURE_ZOOM, MAPS_VIEW_GESTURE_TAP, MAPS_VIEW_GESTURE_DOUBLE_TAP, MAPS_VIEW_GESTURE_2_FINGER_TAP, MAPS_VIEW_GESTURE_ROTATE, MAPS_VIEW_GESTURE_LONG_PRESS};
        int nMapViewGestureArraySize = sizeof(eMapViewGestureType) / sizeof(eMapViewGestureType[0]);
        
        for(nLoopCount = 0; nLoopCount < nMapViewGestureArraySize; nLoopCount++)
@@ -1091,5 +1091,42 @@ int ITc_maps_view_resize_p(void)
        
        return 0;
 }
+
+//& type: auto
+//& purpose:  scenario to indicate and query whether the map should show public transit layer. 
+/**
+* @testcase                    ITc_maps_view_set_get_public_transit_enabled_p
+* @author              SRID(arvin.mittal)
+* @reviewer            SRID(a.pandia)
+* @type                                auto
+* @since_tizen                         3.0
+* @description                 This function is called to indicate or query whether public transit routes should be shown as a layer on the map
+* @scenario                            indicate whether the map should show public transit layer \n
+*                                              query whether the map has public transit layer enabled.
+* @apicovered                  maps_view_set_public_transit_enabled, maps_view_get_public_transit_enabled
+* @passcase                            if maps_view_set_public_transit_enabled and maps_view_get_public_transit_enabled passes
+* @failcase                            if maps_view_set_public_transit_enabled or maps_view_get_public_transit_enabled fails
+* @precondition                        view is created using maps_view_create().
+* @postcondition               NA
+*/
+int ITc_maps_view_set_get_public_transit_enabled_p(void)
+{
+       START_TEST_VIEW(g_CheckInitErr,"maps_view");
+       bool setEnabled = false;
+       bool getEnabled = true;
+       
+       int nRet = maps_view_set_public_transit_enabled(g_HandleMapView, setEnabled);
+       PRINT_RESULT(MAPS_ERROR_NONE, nRet, "maps_view_set_public_transit_enabled", MapServiceGetError(nRet));
+       
+       nRet = maps_view_get_public_transit_enabled(g_HandleMapView, &getEnabled);
+       PRINT_RESULT(MAPS_ERROR_NONE, nRet, "maps_view_get_public_transit_enabled", MapServiceGetError(nRet));
+       if(setEnabled != getEnabled)
+       {
+               FPRINTF("[Line : %d][%s] value mismatch\\n", __LINE__, API_NAMESPACE);
+               return 1;
+       }
+       
+       return 0;
+}
 /** @} */
 /** @} */
index 7858be1..8fbec20 100755 (executable)
@@ -149,6 +149,7 @@ extern int ITc_maps_view_remove_all_objects_p(void);
 extern int ITc_maps_view_move_p(void);
 extern int ITc_maps_view_resize_p(void);
 extern int ITc_maps_view_foreach_object_p(void);
+extern int ITc_maps_view_set_get_public_transit_enabled_p(void);
 
 testcase tc_array[] = {
     {"ITc_maps_address_create_destroy_p", ITc_maps_address_create_destroy_p, ITs_maps_service_address_startup, ITs_maps_service_address_cleanup},
@@ -263,6 +264,7 @@ testcase tc_array[] = {
        {"ITc_maps_view_move_p", ITc_maps_view_move_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
        {"ITc_maps_view_resize_p", ITc_maps_view_resize_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
        {"ITc_maps_view_foreach_object_p", ITc_maps_view_foreach_object_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
+       {"ITc_maps_view_set_get_public_transit_enabled_p", ITc_maps_view_set_get_public_transit_enabled_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
        {NULL, NULL}
 };
 
index 7858be1..8fbec20 100755 (executable)
@@ -149,6 +149,7 @@ extern int ITc_maps_view_remove_all_objects_p(void);
 extern int ITc_maps_view_move_p(void);
 extern int ITc_maps_view_resize_p(void);
 extern int ITc_maps_view_foreach_object_p(void);
+extern int ITc_maps_view_set_get_public_transit_enabled_p(void);
 
 testcase tc_array[] = {
     {"ITc_maps_address_create_destroy_p", ITc_maps_address_create_destroy_p, ITs_maps_service_address_startup, ITs_maps_service_address_cleanup},
@@ -263,6 +264,7 @@ testcase tc_array[] = {
        {"ITc_maps_view_move_p", ITc_maps_view_move_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
        {"ITc_maps_view_resize_p", ITc_maps_view_resize_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
        {"ITc_maps_view_foreach_object_p", ITc_maps_view_foreach_object_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
+       {"ITc_maps_view_set_get_public_transit_enabled_p", ITc_maps_view_set_get_public_transit_enabled_p, ITs_maps_view_startup, ITs_maps_view_cleanup},
        {NULL, NULL}
 };