[ITC][capi-ui-gesture][ACR-1585][Add new TCs for APIs of gesture recognition] 10/244610/2
authorABHISHEK JAIN <j.abhishek@samsung.com>
Tue, 22 Sep 2020 09:11:14 +0000 (14:41 +0530)
committershobhit verma <shobhit.v@samsung.com>
Tue, 22 Sep 2020 09:31:21 +0000 (09:31 +0000)
Change-Id: I0cdb69793eb56d29cd5fff003ddfcfd8d9a48f8e
Signed-off-by: ABHISHEK JAIN <j.abhishek@samsung.com>
packaging/itc/native-capi-ui-gesture-itc.xml [new file with mode: 0644]
src/itc/capi-ui-gesture/CMakeLists.txt [new file with mode: 0644]
src/itc/capi-ui-gesture/ITs-capi-ui-gesture-common.c [new file with mode: 0644]
src/itc/capi-ui-gesture/ITs-capi-ui-gesture-common.h [new file with mode: 0644]
src/itc/capi-ui-gesture/ITs-capi-ui-gesture.c [new file with mode: 0644]
src/itc/capi-ui-gesture/tct-capi-ui-gesture-native.c [new file with mode: 0644]
src/itc/capi-ui-gesture/tct-capi-ui-gesture-native_wearable.h [new file with mode: 0644]
tct_unsupported.txt

diff --git a/packaging/itc/native-capi-ui-gesture-itc.xml b/packaging/itc/native-capi-ui-gesture-itc.xml
new file mode 100644 (file)
index 0000000..2a8204a
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="native-capi-ui-gesture-itc" version="0.1.0" api-version="3.0">
+    <label>NativeCapiUiGestureTest</label>
+    <author email="mymail@tizentest.com" href="www.tizentest.com">test</author>
+    <description>Native API test Application</description>
+    <ui-application appid="native.capi-ui-gesture-itc" exec="/usr/apps/native-capi-ui-gesture-itc/bin/tct-capi-ui-gesture-native" nodisplay="false" multiple="false" type="capp" taskmanage="true">
+    <background-category value="background-network"/>
+       <background-category value="download"/>
+       <background-category value="iot-communication"/>
+       <background-category value="location"/>
+       <background-category value="media"/>
+       <background-category value="sensor"/>
+       </ui-application>
+    <privileges>
+       <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+       <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+    </privileges>
+</manifest>
diff --git a/src/itc/capi-ui-gesture/CMakeLists.txt b/src/itc/capi-ui-gesture/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8e0b8ee
--- /dev/null
@@ -0,0 +1,42 @@
+SET(PKG_NAME "capi-ui-gesture")
+
+SET(EXEC_NAME "tct-${PKG_NAME}-native")
+SET(RPM_NAME "native-${PKG_NAME}-itc")
+
+SET(CAPI_LIB "capi-ui-gesture-client")
+SET(TC_SOURCES
+       ITs-capi-ui-gesture-common.c
+       ITs-capi-ui-gesture.c
+)
+
+PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
+    ${CAPI_LIB}
+       capi-appfw-application
+       glib-2.0
+       bundle
+       capi-system-info
+       dlog
+       elementary
+)
+
+INCLUDE_DIRECTORIES(
+    ${${CAPI_LIB}_INCLUDE_DIRS}
+)
+
+ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.c ${TC_SOURCES} ${COMMON_FILE})
+TARGET_LINK_LIBRARIES(${EXEC_NAME}
+    ${${CAPI_LIB}_LIBRARIES}
+    bundle
+)
+
+INSTALL(PROGRAMS ${EXEC_NAME}
+    DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
+)
+
+IF( DEFINED ASAN )
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address")
+ELSE()
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
+ENDIF()
diff --git a/src/itc/capi-ui-gesture/ITs-capi-ui-gesture-common.c b/src/itc/capi-ui-gesture/ITs-capi-ui-gesture-common.c
new file mode 100644 (file)
index 0000000..b9fc5a7
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "ITs-capi-ui-gesture-common.h"
+
+/** @addtogroup itc-capi-ui-gesture
+*  @ingroup itc
+*  @{
+*/
+
+//Add helper function definitions here
+/**
+* @function            GestureGetError
+* @description         Maps error enums to string values
+* @parameter           nRet: error code returned
+* @return              error string
+*/
+char* GestureGetError(int nRet)
+{
+       char *szErrorVal = "Unknown error code";
+       switch ( nRet )
+       {
+               case HAND_GESTURE_ERROR_NONE:                   szErrorVal = "HAND_GESTURE_ERROR_NONE";                 break;
+               case HAND_GESTURE_ERROR_INVALID_PARAMETER:      szErrorVal = "HAND_GESTURE_ERROR_INVALID_PARAMETER";                    break;
+               case HAND_GESTURE_ERROR_INVALID_OPERATION:      szErrorVal = "HAND_GESTURE_ERROR_INVALID_OPERATION";                    break;
+               case HAND_GESTURE_ERROR_OUT_OF_MEMORY:          szErrorVal = "HAND_GESTURE_ERROR_OUT_OF_MEMORY";                        break;
+               case HAND_GESTURE_ERROR_PERMISSION_DENIED:      szErrorVal = "HAND_GESTURE_ERROR_PERMISSION_DENIED";                    break;
+               case HAND_GESTURE_ERROR_NOT_SUPPORTED:          szErrorVal = "HAND_GESTURE_ERROR_NOT_SUPPORTED";                        break;
+               case HAND_GESTURE_ERROR_ALREADY_STARTED:        szErrorVal = "HAND_GESTURE_ERROR_ALREADY_STARTED";                      break;
+               case HAND_GESTURE_ERROR_NOT_STARTED:            szErrorVal = "HAND_GESTURE_ERROR_NOT_STARTED";                  break;
+               case HAND_GESTURE_ERROR_OPERATION_FAILED:       szErrorVal = "HAND_GESTURE_ERROR_OPERATION_FAILED";                     break;
+       }
+
+       return szErrorVal;
+}
+
+/** @} */
diff --git a/src/itc/capi-ui-gesture/ITs-capi-ui-gesture-common.h b/src/itc/capi-ui-gesture/ITs-capi-ui-gesture-common.h
new file mode 100644 (file)
index 0000000..4c0b9a4
--- /dev/null
@@ -0,0 +1,68 @@
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef _ITS_CAPI_UI_GESTURE_COMMON_H_
+#define _ITS_CAPI_UI_GESTURE_COMMON_H_
+
+//Add test package related includes here
+
+#include <system_info.h>
+#include <dlog.h>
+
+#include "tct_common.h"
+#include <app.h>
+#include <app_common.h>
+#include <gesture.h>
+
+#include <glib.h>
+#include <glib-object.h>
+/** @addtogroup itc-%{capi-ui-gesture}
+*  @ingroup itc
+*  @{
+*/
+
+//Add helper function declarations here
+#define API_NAMESPACE                  "GESTURE_ITC"
+#define GESTURE_FEATURE                        "tizen.org/feature/sensor.gesture_recognition"
+
+#define START_TEST {\
+       FPRINTF("[Line:%d][%s] Starting test check initialize : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
+       dlog_print(DLOG_INFO, "NativeTCT", "[Line:%d][%s] Starting test check initialize : %s", __LINE__, API_NAMESPACE, __FUNCTION__);\
+       if ( g_bIsFeatureMismatched ) {\
+               FPRINTF("[Line:%d][%s] Feature Mismatch Error\\n", __LINE__, API_NAMESPACE);\
+               dlog_print(DLOG_ERROR, "NativeTCT", "[Line:%d][%s] Feature Mismatch Error", __LINE__, API_NAMESPACE);\
+               return 1;\
+       }\
+       if ( !g_bIsGestureFeatureSupported ) {\
+               FPRINTF("[Line : %d][%s] Feature Unsupported\\n", __LINE__, API_NAMESPACE);\
+               dlog_print(DLOG_ERROR, "NativeTCT", "[Line:%d][%s] Feature Unsupported", __LINE__, API_NAMESPACE);\
+               return 0;\
+       }\
+       if ( !g_bGestureHandleCreated ) {\
+               FPRINTF("[Line:%d][%s] Precondition gesture handle creation Failed\\n", __LINE__, API_NAMESPACE);\
+               dlog_print(DLOG_ERROR,"NativeTCT", "[Line:%d][%s] Precondition Failed", __LINE__, API_NAMESPACE);\
+               return 1;\
+       }\
+}
+
+bool g_bIsFeatureMismatched;
+bool g_bIsGestureFeatureSupported;
+bool g_bGestureHandleCreated;
+hand_gesture_h g_hHandGesture;
+
+char* GestureGetError(int nRet);
+
+/** @} */
+#endif  //_ITS_CAPI_UI_GESTURE_COMMON_H_
diff --git a/src/itc/capi-ui-gesture/ITs-capi-ui-gesture.c b/src/itc/capi-ui-gesture/ITs-capi-ui-gesture.c
new file mode 100644 (file)
index 0000000..adfd633
--- /dev/null
@@ -0,0 +1,345 @@
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "ITs-capi-ui-gesture-common.h"
+
+//& set: CapiUi-gesture
+
+/** @addtogroup itc-capi-ui-gesture
+*  @ingroup itc
+*  @{
+*/
+
+/**
+ * @function           ITs_capi_ui_gesture_startup
+ * @description                Called before each test
+ * @parameter          NA
+ * @return             NA
+ */
+void ITs_capi_ui_gesture_startup(void)
+{
+       struct stat stBuff;
+       if ( stat(ERR_LOG, &stBuff) == 0 )
+       {
+               remove(ERR_LOG);
+       }
+
+#if DEBUG
+       FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_capi_ui_gesture_startup\\n", __LINE__, API_NAMESPACE);
+#endif
+
+       g_bIsFeatureMismatched = false;
+       g_bIsGestureFeatureSupported = false;
+       g_hHandGesture = NULL;
+       int nRet = HAND_GESTURE_ERROR_NONE;
+
+       g_bIsGestureFeatureSupported = TCTCheckSystemInfoFeatureSupported(GESTURE_FEATURE, API_NAMESPACE);
+
+       nRet = hand_gesture_create(&g_hHandGesture);
+       if(!g_bIsGestureFeatureSupported)
+       {
+               if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
+               {
+                       FPRINTF("[%s:%d] hand_gesture_create failed to return TIZEN_ERROR_NOT_SUPPORTED for unsupported feature, error returned = (%d)\\n", __FILE__, __LINE__,nRet);
+                       dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] hand_gesture_create failed to return TIZEN_ERROR_NOT_SUPPORTED for unsupported feature, error returned = (%d)", __FILE__, __LINE__, nRet);
+                       g_bIsFeatureMismatched = true;
+                       return;
+               }
+
+               FPRINTF("[%s:%d] hand_gesture_create is unsupported\\n", __FILE__, __LINE__);
+               dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] hand_gesture_create is unsupported", __FILE__, __LINE__);
+               g_bIsFeatureMismatched = false;
+               return;
+       }
+       else if ( nRet != HAND_GESTURE_ERROR_NONE )
+       {
+               FPRINTF("[%s:%d] hand_gesture_create failed, error returned =(%d)\\n", __FILE__, __LINE__, nRet);
+               dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] hand_gesture_create failed, error returned = (%d)", __FILE__, __LINE__,  nRet);
+               g_bGestureHandleCreated = false;
+                return;
+       }
+       if (g_hHandGesture == NULL)
+       {
+               g_bGestureHandleCreated = false;
+               return;
+       }
+       g_bGestureHandleCreated = true;
+}
+
+/**
+ * @function           ITs_capi_ui_gesture_cleanup
+ * @description                Called after each test
+ * @parameter          NA
+ * @return             NA
+ */
+void ITs_capi_ui_gesture_cleanup(void)
+{
+       int nRet = HAND_GESTURE_ERROR_NONE;
+
+       if (g_hHandGesture)
+       {
+               nRet = hand_gesture_destroy(g_hHandGesture);
+               if ( nRet != HAND_GESTURE_ERROR_NONE )
+               {
+                       FPRINTF("[%s:%d] hand_gesture_destroy failed, error returned =(%d)\\n", __FILE__, __LINE__, nRet);
+               }
+       }
+       return;
+}
+
+/**
+* @function            HandGestureStartRecognitionCB
+* @description         Callback function
+* @parameter[IN]       hand_gesture_h hHandGesture, hand_gesture_type_e eTypeGesture,
+*                      double dnTimestamp, hand_gesture_error_e eGestureError, void *pszUserData
+* @return              NA
+*/
+static void HandGestureStartRecognitionCB(hand_gesture_h hHandGesture, hand_gesture_type_e eTypeGesture, double dnTimestamp, hand_gesture_error_e eGestureError, void *pszUserData)
+{
+#if DEBUG
+       FPRINTF("[Line : %d][%s] HandGestureStartRecognitionCB is called\\n", __LINE__, API_NAMESPACE);
+       FPRINTF("[Line : %d][%s] In start recognition for HAND_GESTURE_WRIST_UP gesture type recieved error is %s \\n", __LINE__, API_NAMESPACE, GestureGetError(eGestureError));
+#endif
+}
+
+/**
+* @function            HandGestureErrorCB
+* @description         Callback function
+* @parameter[IN]       hand_gesture_h hHandGesture, hand_gesture_error_e eGestureError,
+*                      const char *pszMsg, void *pszUserData
+* @return              NA
+*/
+static void HandGestureErrorCB(hand_gesture_h hHandGesture, hand_gesture_error_e eGestureError, const char *pszMsg, void *pszUserData)
+{
+#if DEBUG
+       FPRINTF("[Line : %d][%s] HandGestureErrorCB is called\\n", __LINE__, API_NAMESPACE);
+#endif
+}
+
+
+/** @addtogroup itc-capi-ui-gesture-testcases
+*  @brief      Integration testcases for module capi-ui-gesture
+*  @ingroup    itc-capi-ui-gesture
+*  @{
+*/
+
+
+//& purpose: To Creates and Destroy a gesture handle
+//& type: auto
+/**
+* @testcase                    ITc_hand_gesture_create_destroy_p
+* @since_tizen                         6.0
+* @author                      SRID(j.abhishek)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @description                 Creates and destroy hand gesture handle.
+* @scenario                    Creates a gesture handle and destroy if successfully created
+* @apicovered                  hand_gesture_create, hand_gesture_destroy
+* @passcase                    If hand_gesture_create and hand_gesture_destroy are successfull
+* @failcase                    If hand_gesture_create or hand_gesture_destroy fails
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_hand_gesture_create_destroy_p(void)
+{
+       START_TEST;
+
+       int nRet = HAND_GESTURE_ERROR_NONE;
+       hand_gesture_h hHandGesture = NULL;
+
+       nRet = hand_gesture_create(&hHandGesture);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_create", GestureGetError(nRet));
+       CHECK_HANDLE(hHandGesture, "hand_gesture_create");
+
+       nRet = hand_gesture_destroy(hHandGesture);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_destroy", GestureGetError(nRet));
+
+       return 0;
+}
+
+//& purpose: To check whether a gesture is supported or not.
+//& type: auto
+/**
+* @testcase                    ITc_hand_gesture_is_supported_type_p
+* @since_tizen                         6.0
+* @author                      SRID(j.abhishek)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @description                 Checks whether a gesture is supported or not.
+* @scenario                    create gesture handle and check if supported,
+*                              destroy handle before cleanup.
+* @apicovered                  hand_gesture_is_supported_type
+* @passcase                    hand_gesture_create and hand_gesture_is_supported_type passed
+* @failcase                    hand_gesture_create or hand_gesture_is_supported_type failed
+* @precondition                        NA
+* @postcondition               NA
+*/
+
+int ITc_hand_gesture_is_supported_type_p(void)
+{
+       START_TEST;
+
+       int nRet = HAND_GESTURE_ERROR_NONE;
+       bool bIsSupported = false;
+
+       //Target API
+       nRet = hand_gesture_is_supported_type(g_hHandGesture, HAND_GESTURE_WRIST_UP, &bIsSupported);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_is_supported_type", GestureGetError(nRet));
+
+       return 0;
+}
+
+//& purpose: To set an option for gesture recognition.
+//& type: auto
+/**
+* @testcase                    ITc_hand_gesture_set_option_p
+* @since_tizen                         6.0
+* @author                      SRID(j.abhishek)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @description                 Sets an option for gesture recognition.
+* @scenario                    Creates and destroy hand gesture handle and set option.
+* @apicovered                  hand_gesture_create, hand_gesture_set_option
+* @passcase                    hand_gesture_create and hand_gesture_set_option passed
+* @failcase                    hand_gesture_create or hand_gesture_set_option fail
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_hand_gesture_set_option_p(void)
+{
+       START_TEST;
+
+       int nRet = HAND_GESTURE_ERROR_NONE;
+
+       hand_gesture_option_e eHandGastureOption[] =
+       {
+               HAND_GESTURE_OPTION_DEFAULT,
+               HAND_GESTURE_OPTION_ALWAYS_ON
+       };
+
+       int nEnumSize = sizeof(eHandGastureOption) / sizeof(eHandGastureOption[0]);
+       int nEnumCounter;
+
+       for (nEnumCounter = 0; nEnumCounter < nEnumSize; nEnumCounter++)
+       {
+               //Target API
+               nRet = hand_gesture_set_option(g_hHandGesture, eHandGastureOption[nEnumCounter]);
+               PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_set_option", GestureGetError(nRet));
+       }
+
+       return 0;
+}
+
+//& purpose: To check start and stop to recognize a gesture.
+//& type: auto
+/**
+* @testcase                    ITc_hand_gesture_start_stop_recognition_p
+* @since_tizen                         6.0
+* @author                      SRID(j.abhishek)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @description                 Starts and stops to recognize a gesture.
+* @scenario                    Creates and destroy hand gesture handle and check the start recognition
+*                              with the help of registered callback
+* @apicovered                  hand_gesture_start_recognition, hand_gesture_stop_recognition
+* @passcase                    hand_gesture_start_recognition and hand_gesture_stop_recognition passed
+* @failcase                    hand_gesture_start_recognition or hand_gesture_stop_recognition fail
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_hand_gesture_start_stop_recognition_p(void)
+{
+       START_TEST;
+
+       int nRet = HAND_GESTURE_ERROR_NONE;
+
+       //Target API
+       nRet = hand_gesture_start_recognition(g_hHandGesture, HAND_GESTURE_WRIST_UP, HandGestureStartRecognitionCB, NULL);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_start_recognition", GestureGetError(nRet));
+
+       //Target API
+       nRet = hand_gesture_stop_recognition(g_hHandGesture);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_stop_recognition", GestureGetError(nRet));
+
+       return 0;
+}
+
+//& purpose: To get a gesture engine information.
+//& type: auto
+/**
+* @testcase                    ITc_hand_gesture_get_engine_info_p
+* @since_tizen                         6.0
+* @author                      SRID(j.abhishek)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @description                 Gets a gesture engine information.
+* @scenario                    Creates hand gesture handle and get engine info.
+* @apicovered                  hand_gesture_get_engine_info
+* @passcase                    hand_gesture_get_engine_info is passed
+* @failcase                    hand_gesture_get_engine_info failed.
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_hand_gesture_get_engine_info_p(void)
+{
+       START_TEST;
+
+       int nRet = HAND_GESTURE_ERROR_NONE;
+       char *pszEngineAppID = NULL;
+       char *pszEngineName = NULL;
+
+       //Target API
+       nRet = hand_gesture_get_engine_info(g_hHandGesture, &pszEngineAppID, &pszEngineName);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_get_engine_info", GestureGetError(nRet));
+       CHECK_HANDLE(pszEngineAppID, "hand_gesture_get_engine_info");
+       CHECK_HANDLE(pszEngineName, "hand_gesture_get_engine_info");
+
+       return 0;
+}
+
+//& purpose: To set and unset a callback function to be invoked when an error is occurred.
+//& type: auto
+/**
+* @testcase                    ITc_hand_gesture_set_unset_error_cb_p
+* @since_tizen                         6.0
+* @author                      SRID(j.abhishek)
+* @reviewer                    SRID(shobhit.v)
+* @type                        auto
+* @description                 Sets and Unsets a callback function to be invoked when an error is occurred.
+* @scenario                    Creates hand gesture handle and set and unset callback function.
+* @apicovered                  hand_gesture_get_engine_info
+* @passcase                    hand_gesture_set_error_cb and hand_gesture_unset_error_cb
+* @failcase                    hand_gesture_set_error_cb or hand_gesture_unset_error_cb failed
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_hand_gesture_set_unset_error_cb_p(void)
+{
+       START_TEST;
+
+       int nRet = HAND_GESTURE_ERROR_NONE;
+
+       //Target API
+       nRet = hand_gesture_set_error_cb(g_hHandGesture, HandGestureErrorCB, NULL);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_set_error_cb", GestureGetError(nRet));
+
+       //Target API
+       nRet = hand_gesture_unset_error_cb(g_hHandGesture);
+       PRINT_RESULT(HAND_GESTURE_ERROR_NONE, nRet, "hand_gesture_unset_error_cb", GestureGetError(nRet));
+       return 0;
+}
+
+/** @} */
+/** @} */
diff --git a/src/itc/capi-ui-gesture/tct-capi-ui-gesture-native.c b/src/itc/capi-ui-gesture/tct-capi-ui-gesture-native.c
new file mode 100644 (file)
index 0000000..12610cc
--- /dev/null
@@ -0,0 +1,131 @@
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#include "tct_common.h"
+
+#ifdef WEARABLE        //Starts WEARABLE
+#include "tct-capi-ui-gesture-native_wearable.h"
+#endif  //WEARABLE     //End WEARABLE
+
+#include <stdio.h>
+#include <string.h>
+#include <malloc.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <glib.h>
+#include <stdbool.h>
+#include <app.h>
+#include <dlog.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+
+#include <Elementary.h>
+
+typedef struct appdata {
+       Evas_Object *win;
+       Evas_Object *conform;
+       Evas_Object *label;
+} appdata_s;
+
+static bool app_create(void *data)
+{
+       return true;
+}
+
+static void app_control(app_control_h app_control, void *data)
+{
+       char* pszGetTCName = NULL;
+       int i=0, result=0, nRet=0;
+       nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName);
+       if(nRet != APP_CONTROL_ERROR_NONE)
+       {
+               dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet);
+               PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__);
+               PRINT_TC_RESULT("%d",1);
+               FREE_MEMORY_TC(pszGetTCName);
+               return;
+       }
+
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);
+       for ( i = 0; tc_array[i].name; i++ )
+       {
+               if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) )
+               {
+                       if ( tc_array[i].startup )
+                       {
+                               dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName);
+                               tc_array[i].startup();
+                       }
+
+                       dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName);
+                       result = tc_array[i].function();
+                       dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result);
+
+                       if ( tc_array[i].cleanup )
+                       {
+                               dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName);
+                               tc_array[i].cleanup();
+                       }
+
+                       PRINT_TC_RESULT("%d",result);
+                       FREE_MEMORY_TC(pszGetTCName);
+                       return;
+               }
+       }
+
+       dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName);
+       PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName);
+       PRINT_TC_RESULT("%d",1);
+       FREE_MEMORY_TC(pszGetTCName);
+       return;
+}
+
+static void app_terminate(void *data)
+{
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__);
+}
+
+int main(int argc, char *argv[])
+{
+       int ret = 0;
+       appdata_s ad = {0,};
+
+       ui_app_lifecycle_callback_s event_callback = {0,};
+       event_callback.create = app_create;
+       event_callback.terminate = app_terminate;
+       event_callback.app_control = app_control;
+
+       //setting gcda file location for coverage
+       setenv("GCOV_PREFIX","/tmp",1);
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__);
+
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__);
+       ret = ui_app_main(argc, argv, &event_callback, &ad);
+       if (ret != APP_ERROR_NONE)
+       {
+               dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret);
+               PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret);
+               PRINT_TC_RESULT("%d",1);
+               return ret;
+       }
+
+       dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__);
+       return ret;
+}
diff --git a/src/itc/capi-ui-gesture/tct-capi-ui-gesture-native_wearable.h b/src/itc/capi-ui-gesture/tct-capi-ui-gesture-native_wearable.h
new file mode 100644 (file)
index 0000000..811d555
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// Copyright (c) 2020 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef __TCT_CAPI_UI_GESTURE_NATIVE_H__
+#define __TCT_CAPI_UI_GESTURE_NATIVE_H__
+
+#include "testcase.h"
+#include "tct_common.h"
+
+extern void ITs_capi_ui_gesture_startup(void);
+extern void ITs_capi_ui_gesture_cleanup(void);
+
+extern int ITc_hand_gesture_create_destroy_p(void);
+extern int ITc_hand_gesture_is_supported_type_p(void);
+extern int ITc_hand_gesture_set_option_p(void);
+extern int ITc_hand_gesture_start_stop_recognition_p(void);
+extern int ITc_hand_gesture_get_engine_info_p(void);
+extern int ITc_hand_gesture_set_unset_error_cb_p(void);
+
+testcase tc_array[] = {
+    {"ITc_hand_gesture_create_destroy_p", ITc_hand_gesture_create_destroy_p, ITs_capi_ui_gesture_startup, ITs_capi_ui_gesture_cleanup},
+    {"ITc_hand_gesture_is_supported_type_p", ITc_hand_gesture_is_supported_type_p, ITs_capi_ui_gesture_startup, ITs_capi_ui_gesture_cleanup},
+    {"ITc_hand_gesture_set_option_p", ITc_hand_gesture_set_option_p, ITs_capi_ui_gesture_startup, ITs_capi_ui_gesture_cleanup},
+    {"ITc_hand_gesture_start_stop_recognition_p", ITc_hand_gesture_start_stop_recognition_p, ITs_capi_ui_gesture_startup, ITs_capi_ui_gesture_cleanup},
+    {"ITc_hand_gesture_get_engine_info_p", ITc_hand_gesture_get_engine_info_p, ITs_capi_ui_gesture_startup, ITs_capi_ui_gesture_cleanup},
+    {"ITc_hand_gesture_set_unset_error_cb_p", ITc_hand_gesture_set_unset_error_cb_p, ITs_capi_ui_gesture_startup, ITs_capi_ui_gesture_cleanup},
+    {NULL, NULL}
+};
+
+#endif // __TCT_CAPI_UI_GESTURE_NATIVE_H__
index c3890bf96e9d070713fe0267e1d13c2e2777f4d6..a60fbbe1e938645914cc91318261b0b77d034f4b 100755 (executable)
@@ -207,10 +207,6 @@ wearable:armv7l:itc:usb-host;
 wearable:aarch64:itc:usb-host;
 wearable:x86:itc:usb-host;
 wearable:x86_64:itc:usb-host;
-wearable:armv7l:itc:capi-ui-gesture;
-wearable:aarch64:itc:capi-ui-gesture;
-wearable:x86:itc:capi-ui-gesture;
-wearable:x86_64:itc:capi-ui-gesture;
 
 ## ctc ##
 wearable:armv7l:ctc:video-util;
@@ -225,10 +221,6 @@ wearable:armv7l:ctc:vulkan;
 wearable:aarch64:ctc:vulkan;
 wearable:x86:ctc:vulkan;
 wearable:x86_64:ctc:vulkan;
-wearable:armv7l:ctc:capi-ui-gesture;
-wearable:aarch64:ctc:capi-ui-gesture;
-wearable:x86:ctc:capi-ui-gesture;
-wearable:x86_64:ctc:capi-ui-gesture;
 
 
 ##################
@@ -300,10 +292,6 @@ tizeniot:armv7l:ctc:vulkan;
 tizeniot:aarch64:ctc:vulkan;
 tizeniot:x86:ctc:vulkan;
 tizeniot:x86_64:ctc:vulkan;
-tizeniot:armv7l:ctc:capi-ui-gesture;
-tizeniot:aarch64:ctc:capi-ui-gesture;
-tizeniot:x86:ctc:capi-ui-gesture;
-tizeniot:x86_64:ctc:capi-ui-gesture;
 
 ##################
 ##### tv #####
@@ -396,6 +384,7 @@ tv:armv7l:itc:attach-panel;
 tv:armv7l:itc:watchface-complication;
 tv:armv7l:itc:appcore-watch;
 tv:armv7l:itc:battery-monitor;
+tv:armv7l:itc:capi-ui-gesture;
 
 ## ctc ##
 tv:armv7l:ctc:telephony;