From: shobhitv Date: Fri, 11 Oct 2024 05:18:59 +0000 (+0530) Subject: [ITC][mmi-framework][ACR-1867] Added new test cases for new apis X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=810898cfb011092f70d033e4588a66bda2775f18;p=test%2Ftct%2Fnative%2Fapi.git [ITC][mmi-framework][ACR-1867] Added new test cases for new apis Change-Id: I5abf5259eb43b0a22f19741bb56dadd0af5ee3ff Signed-off-by: shobhitv --- diff --git a/packaging/itc/native-mmi-itc.xml b/packaging/itc/native-mmi-itc.xml new file mode 100755 index 000000000..297d67176 --- /dev/null +++ b/packaging/itc/native-mmi-itc.xml @@ -0,0 +1,14 @@ + + + + test + Native API test Application + + + + + + + + + diff --git a/src/itc/mmi/CMakeLists.txt b/src/itc/mmi/CMakeLists.txt new file mode 100755 index 000000000..c69f89058 --- /dev/null +++ b/src/itc/mmi/CMakeLists.txt @@ -0,0 +1,42 @@ +SET(PKG_NAME "mmi") + +SET(EXEC_NAME "tct-${PKG_NAME}-native") +SET(RPM_NAME "native-${PKG_NAME}-itc") + +SET(CAPI_LIB "mmi") +SET(TC_SOURCES + ITs-mmi-common.c + ITs-mmi.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/mmi/ITs-mmi-common.c b/src/itc/mmi/ITs-mmi-common.c new file mode 100755 index 000000000..8811a34cd --- /dev/null +++ b/src/itc/mmi/ITs-mmi-common.c @@ -0,0 +1,53 @@ +// +// Copyright (c) 2024 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-mmi-common.h" + +/** @addtogroup itc-mmi +* @ingroup itc +* @{ +*/ + +//Add helper function definitions here + +/** +* @function MmiGetError +* @description Maps error enums to string values +* @parameter nRet : error code returned +* @return error string +**/ +char* MmiGetError(int nRet) +{ + char *szErrorVal = NULL; + + switch(nRet) + { + case MMI_ERROR_NONE : szErrorVal = "MMI_ERROR_NONE" ; break; + case MMI_ERROR_INVALID_PARAMETER : szErrorVal = "MMI_ERROR_INVALID_PARAMETER" ; break; + case MMI_ERROR_OUT_OF_MEMORY : szErrorVal = "MMI_ERROR_OUT_OF_MEMORY" ; break; + case MMI_ERROR_IO_ERROR : szErrorVal = "MMI_ERROR_IO_ERROR" ; break; + case MMI_ERROR_TIMED_OUT : szErrorVal = "MMI_ERROR_TIMED_OUT" ; break; + case MMI_ERROR_OPERATION_FAILED : szErrorVal = "MMI_ERROR_OPERATION_FAILED" ; break; + case MMI_ERROR_PERMISSION_DENIED : szErrorVal = "MMI_ERROR_PERMISSION_DENIED" ; break; + case MMI_ERROR_NOT_SUPPORTED : szErrorVal = "MMI_ERROR_NOT_SUPPORTED" ; break; + case MMI_ERROR_RESOURCE_BUSY : szErrorVal = "MMI_ERROR_RESOURCE_BUSY"; break; + default : szErrorVal = "MMI_ERROR_UNKNOWN" ; break; + } + + return szErrorVal; +} + + +/** @} */ diff --git a/src/itc/mmi/ITs-mmi-common.h b/src/itc/mmi/ITs-mmi-common.h new file mode 100755 index 000000000..73afc7000 --- /dev/null +++ b/src/itc/mmi/ITs-mmi-common.h @@ -0,0 +1,75 @@ +// +// Copyright (c) 2024 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_MMI_COMMON_H_ +#define _ITS_MMI_COMMON_H_ + +//Add test package related includes here +#include "tct_common.h" +#include "assert.h" +#include +#include +#include +#include +#include +#include + +#define API_NAMESPACE "MMI_ITC" +/** @addtogroup itc-%{MODULE_NAME} +* @ingroup itc +* @{ +*/ +#define MULTIMODLE_INTERACTION_FEATURE "http://tizen.org/feature/multimodal_interaction" +//Add helper function declarations here + +#define START_TEST {\ + FPRINTF("[Line : %d] [%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\ + if ( g_bFeatureMismatch )\ +{\ + return 1;\ +}\ + if ( g_bFeatureNotSupported )\ +{\ + return 0;\ +}\ + if ( !g_bMmiInitialize )\ +{\ + FPRINTF("[Line : %d] [%s] Precondition of mmi failed so leaving test\\n", __LINE__, API_NAMESPACE);\ + return 1;\ +}\ +} + +#define CHECK_GET_VALUE(value1, value2, API) {\ + if ( value1 != value2 )\ +{\ + FPRINTF("[Line : %d][%s] %s failed, Reveived value is incorrect\\n", __LINE__, API_NAMESPACE, API);\ + return 1;\ +}\ +} + +#define CHECK_HANDLE_CLEANUP(Handle, API, FreeResource) {\ + if ( Handle == NULL )\ +{\ + FPRINTF("[Line : %d][%s] %s failed, error returned = Handle returned is NULL\\n", __LINE__, API_NAMESPACE, API);\ + FreeResource;\ + return 1;\ +}\ +} + + +char* MmiGetError(int nRet); + +/** @} */ +#endif //_ITS_MMI_COMMON_H_ diff --git a/src/itc/mmi/ITs-mmi.c b/src/itc/mmi/ITs-mmi.c new file mode 100755 index 000000000..afdef4878 --- /dev/null +++ b/src/itc/mmi/ITs-mmi.c @@ -0,0 +1,3671 @@ +// +// Copyright (c) 2024 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-mmi-common.h" + +//& set: Mmi + +/** @addtogroup itc-mmi +* @ingroup itc +* @{ +*/ + +bool g_bFeatureSupported = false; +bool g_bFeatureMismatch = false; +bool g_bFeatureNotSupported = false; +bool g_bMmiInitialize = false; + +#define MAX_ARRAY_LENGTH 5 +#define DATA_LENGTH 10 +#define COUNT_ELEMENTS 2 + +static mmi_data_h g_hMmiData = NULL; +static mmi_data_h g_hArrayElement[MAX_ARRAY_LENGTH] = {NULL, }; +static mmi_attribute_h g_hMmiAttribute = NULL; +static mmi_attribute_h g_hCloned_attribute = NULL; +static mmi_primitive_value_h g_hPrimitiveValue = NULL; +static mmi_primitive_value_h g_hArrayElement1 = NULL; +static mmi_primitive_value_h g_hArrayElement2 = NULL; + + +//Callbacks + +static int MMi_state_changed_cb(mmi_state_e state, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_state_changed_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + +void MMi_workflow_output_cb(mmi_workflow_instance_h instance, const char *name, mmi_data_h data, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_workflow_output_cb callback invoked\\n", __LINE__, API_NAMESPACE); +} + + +static int MMi_node_initialized_cb(mmi_node_instance_h instance, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_node_initialized_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + +static int MMi_node_deinitialized_cb(mmi_node_instance_h instance, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_node_deinitialized_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + +static int MMi_node_attribute_set_cb(mmi_node_instance_h instance, mmi_attribute_h attribute, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_node_attribute_set_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + +static int MMi_node_activated_cb(mmi_node_instance_h instance, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_node_activated_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + +static int MMi_node_deactivated_cb(mmi_node_instance_h instance, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_node_deactivated_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + +static int MMi_node_signal_received_cb(mmi_node_instance_h instance, mmi_signal_h signal, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_node_signal_received_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + +static int MMi_port_input_data_received_cb(mmi_port_instance_h instance, mmi_data_h data, void *user_data) +{ + FPRINTF("[Line : %d][%s] MMi_port_input_data_received_cb callback invoked\\n", __LINE__, API_NAMESPACE); + return 0; +} + + +/** + * @function ITs_mmi_startup + * @description Called before each test + * @parameter NA + * @return NA + */ +void ITs_mmi_startup(void) +{ + struct stat stBuff; + g_bMmiInitialize = false; + if ( stat(ERR_LOG, &stBuff) == 0 ) + { + remove(ERR_LOG); + } + g_bFeatureSupported = TCTCheckSystemInfoFeatureSupported(MULTIMODLE_INTERACTION_FEATURE, API_NAMESPACE); + int nRet = mmi_initialize(); + if ( !g_bFeatureSupported ) + { + if ( nRet != TIZEN_ERROR_NOT_SUPPORTED ) + { + FPRINTF("[Line : %d][%s] mmi_init returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, MmiGetError(nRet)); + g_bFeatureMismatch = true; + } + else + { + FPRINTF("[Line : %d][%s] mmi_init correctly returned TIZEN_ERROR_NOT_SUPPORTED for unsupported feature\\n", __LINE__, API_NAMESPACE); + g_bFeatureNotSupported = true; + } + return; + } + + if ( nRet != MMI_ERROR_NONE ) + { + FPRINTF("[Line : %d][%s] Unable to initialize mmi, error id: = %s \\n", __LINE__, API_NAMESPACE, MmiGetError(nRet)); + } + else + { + FPRINTF("[Line : %d][%s] mmi initialized successfully \\n", __LINE__, API_NAMESPACE); + g_bMmiInitialize = true; + } + return; +} + + +/** + * @function ITs_mmi_cleanup + * @description Called after each test + * @parameter NA + * @return NA + */ +void ITs_mmi_cleanup(void) +{ + if (NULL != g_hMmiData) { + mmi_data_destroy(g_hMmiData); + g_hMmiData = NULL; + } + + for (size_t i = 0; i < MAX_ARRAY_LENGTH; i++) { + if (NULL != g_hArrayElement[i]) { + mmi_data_destroy(g_hArrayElement[i]); + g_hArrayElement[i] = NULL; + } + } + + if (NULL != g_hMmiAttribute) { + mmi_attribute_destroy(g_hMmiAttribute); + g_hMmiAttribute = NULL; + } + + if (NULL != g_hCloned_attribute) { + mmi_attribute_destroy(g_hCloned_attribute); + g_hCloned_attribute = NULL; + } + + if (NULL != g_hPrimitiveValue) { + mmi_primitive_value_destroy(g_hPrimitiveValue); + g_hPrimitiveValue = NULL; + } + + if (NULL != g_hArrayElement1) { + mmi_primitive_value_destroy(g_hArrayElement1); + g_hArrayElement1 = NULL; + } + + if (NULL != g_hArrayElement2) { + mmi_primitive_value_destroy(g_hArrayElement2); + g_hArrayElement2 = NULL; + } + + int nRet = mmi_deinitialize(); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_deinitialize", MmiGetError(nRet)); + return; +} + +/** @addtogroup itc-mmi-testcases +* @brief Integration testcases for module mmi +* @ingroup itc-mmi +* @{ +*/ + +//& purpose: initialize and deinitialize mmi +//& type : auto +/** +* @testcase ITc_mmi_initialize_deinitialize_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @description initialize and deinitialize mmi +* @scenario Initialize mmi & deinitialize +* @apicovered mmi_initialize, mmi_deinitialize +* @passcase When mmi_initialize and mmi_deinitialize pass +* @failcase When mmi_initialize Or mmi_deinitialize fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_initialize_deinitialize_p(void) +{ + START_TEST; + + int nRet = mmi_deinitialize(); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_deinitialize", MmiGetError(nRet)); + + nRet = mmi_initialize(); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_initialize", MmiGetError(nRet)); + + nRet = mmi_deinitialize(); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_deinitialize", MmiGetError(nRet)); + + nRet = mmi_initialize(); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_initialize", MmiGetError(nRet)); + return 0; +} + +//& purpose: Set and Unset mmi state change callback APIs +//& type : auto +/** +* @testcase ITc_mmi_set_unset_state_changed_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set and Unset mmi state change callback APIs +* @apicovered mmi_set_state_changed, mmi_unset_state_changed +* @passcase When mmi_set_state_changed, mmi_unset_state_changed pass +* @failcase When mmi_set_state_changed Or mmi_unset_state_changed fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_set_unset_state_changed_cb_p(void) +{ + START_TEST; + + int nRet = mmi_set_state_changed_cb(MMi_state_changed_cb, NULL); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_set_state_changed_cb", MmiGetError(nRet)); + + nRet = mmi_unset_state_changed_cb(MMi_state_changed_cb); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_unset_state_changed_cb", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Create and Destroy statdard and custom workflow instance +//& type : auto +/** +* @testcase ITc_mmi_standard_custom_workflow_instance_create_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Create statdard and custom workflow instances and then destroy +* @apicovered mmi_standard_workflow_instance_create, mmi_custom_workflow_instance_create and mmi_workflow_instance_destroy +* @passcase When mmi_standard_workflow_instance_create, mmi_custom_workflow_instance_create and mmi_workflow_instance_destroy pass +* @failcase When mmi_standard_workflow_instance_create or mmi_custom_workflow_instance_create or mmi_workflow_instance_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_standard_custom_workflow_instance_create_destroy_p(void) +{ + START_TEST; + mmi_workflow_instance_h h_Instance = NULL; + mmi_workflow_h h_Workflow = NULL; + + int nRet = mmi_standard_workflow_instance_create(MMI_STANDARD_WORKFLOW_VOICE_TOUCH, &h_Instance); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_standard_workflow_instance_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Instance,"mmi_standard_workflow_instance_create"); + + nRet = mmi_workflow_instance_destroy(h_Instance); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_destroy", MmiGetError(nRet)); + h_Instance = NULL; + + nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + nRet = mmi_custom_workflow_instance_create(h_Workflow, &h_Instance); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_custom_workflow_instance_create", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(h_Instance, "mmi_custom_workflow_instance_create", mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_instance_destroy(h_Instance); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_destroy", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Activate and Deactivate workflow instance +//& type : auto +/** +* @testcase ITc_mmi_workflow_instance_activate_deactivate_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Activate and Deactivate workflow instance +* @apicovered mmi_workflow_instance_activate, mmi_workflow_instance_deactivate +* @passcase When mmi_workflow_instance_activate, mmi_workflow_instance_deactivate pass +* @failcase When mmi_workflow_instance_activate or mmi_workflow_instance_deactivate fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_instance_activate_deactivate_p(void) +{ + START_TEST; + mmi_workflow_instance_h h_Instance = NULL; + + int nRet = mmi_standard_workflow_instance_create(MMI_STANDARD_WORKFLOW_VOICE_TOUCH, &h_Instance); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_standard_workflow_instance_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Instance,"mmi_standard_workflow_instance_create"); + + nRet = mmi_workflow_instance_activate(h_Instance); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_activate", MmiGetError(nRet), mmi_workflow_instance_destroy(h_Instance)); + + nRet = mmi_workflow_instance_deactivate(h_Instance); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_deactivate", MmiGetError(nRet), mmi_workflow_instance_destroy(h_Instance)); + + nRet = mmi_workflow_instance_destroy(h_Instance); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Set an attribute of a workflow instance +//& type : auto +/** +* @testcase ITc_mmi_workflow_instance_set_attribute_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set an attribute of a workflow instance +* @apicovered mmi_workflow_instance_set_attribute +* @passcase When mmi_workflow_instance_set_attribute pass +* @failcase When mmi_workflow_instance_set_attribute fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_instance_set_attribute_p(void) +{ + START_TEST; + mmi_workflow_instance_h h_Instance = NULL; + const int nSourceInt = 5; + const char *pszName = "Attribute"; + + int nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + nRet = mmi_attribute_create(g_hPrimitiveValue, pszName, &g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_attribute_create"); + + nRet = mmi_standard_workflow_instance_create(MMI_STANDARD_WORKFLOW_VOICE_TOUCH, &h_Instance); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_standard_workflow_instance_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Instance,"mmi_standard_workflow_instance_create"); + + //Target API + nRet = mmi_workflow_instance_set_attribute(h_Instance, g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_set_attribute", MmiGetError(nRet)); + + nRet = mmi_workflow_instance_destroy(h_Instance); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Emit a signal to a workflow instance +//& type : auto +/** +* @testcase ITc_mmi_workflow_instance_emit_signal_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Emit a signal to a workflow instance +* @apicovered mmi_workflow_instance_emit_signal +* @passcase When mmi_workflow_instance_emit_signal pass +* @failcase When mmi_workflow_instance_emit_signal fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_instance_emit_signal_p(void) +{ + START_TEST; + mmi_workflow_instance_h h_Instance = NULL; + mmi_signal_h handle = NULL; + + int nRet = mmi_signal_create("signal", &handle); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_create", MmiGetError(nRet)); + CHECK_HANDLE(handle,"mmi_signal_create"); + + nRet = mmi_standard_workflow_instance_create(MMI_STANDARD_WORKFLOW_VOICE_TOUCH, &h_Instance); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_standard_workflow_instance_create", MmiGetError(nRet),mmi_signal_destroy(handle)); + CHECK_HANDLE_CLEANUP(h_Instance,"mmi_standard_workflow_instance_create", mmi_signal_destroy(handle)); + + //Target API + nRet = mmi_workflow_instance_emit_signal(h_Instance, handle); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_emit_signal", MmiGetError(nRet),mmi_workflow_instance_destroy(h_Instance);mmi_signal_destroy(handle)); + + nRet = mmi_workflow_instance_destroy(h_Instance); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_destroy", MmiGetError(nRet)); + + nRet = mmi_signal_destroy(handle); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_signal_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Set a callback function to receive workflow output +//& type : auto +/** +* @testcase ITc_mmi_workflow_instance_set_output_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set a callback function to receive workflow output +* @apicovered mmi_workflow_instance_set_output_cb +* @passcase When mmi_workflow_instance_set_output_cb pass +* @failcase When mmi_workflow_instance_set_output_cb fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_instance_set_output_cb_p(void) +{ + START_TEST; + mmi_workflow_instance_h h_Instance = NULL; + + int nRet = mmi_standard_workflow_instance_create(MMI_STANDARD_WORKFLOW_VOICE_TOUCH, &h_Instance); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_standard_workflow_instance_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Instance,"mmi_standard_workflow_instance_create"); + + //Target API + nRet = mmi_workflow_instance_set_output_cb(h_Instance, "OUTPUT", MMi_workflow_output_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_set_output_cb", MmiGetError(nRet),mmi_workflow_instance_destroy(h_Instance)); + + nRet = mmi_workflow_instance_destroy(h_Instance); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_instance_destroy", MmiGetError(nRet)); + + return 0; +} + + + +//& purpose: Create a workflow prototype and destroy +//& type : auto +/** +* @testcase ITc_mmi_workflow_create_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Create a workflow prototype and destroy +* @apicovered mmi_workflow_create, mmi_workflow_destroy +* @passcase When mmi_workflow_create, mmi_workflow_destroy pass +* @failcase When mmi_workflow_create Or mmi_workflow_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_create_destroy_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Set the type of a workflow prototype and get the same +//& type : auto +/** +* @testcase ITc_mmi_workflow_set_get_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set the type of a workflow prototype and get the same +* @apicovered mmi_workflow_set_type, mmi_workflow_get_type +* @passcase When mmi_workflow_set_type, mmi_workflow_get_type pass +* @failcase When mmi_workflow_set_type Or mmi_workflow_get_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_set_get_type_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + mmi_standard_workflow_type_e getType; + mmi_node_type_e type; + size_t nPortCount = 0; + int nRet = -1; + mmi_standard_workflow_type_e eSetWorkflowType[] = {MMI_STANDARD_WORKFLOW_NONE, MMI_STANDARD_WORKFLOW_VOICE_TOUCH}; + int nEnumSize = sizeof(eSetWorkflowType) / sizeof(eSetWorkflowType[0]); + + for(int nEnumCounter = 0 ; nEnumCounter < nEnumSize; nEnumCounter++) + { + nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + //Target API + nRet = mmi_workflow_set_type(h_Workflow, eSetWorkflowType[nEnumCounter]); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_set_type", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + //Target API + nRet = mmi_workflow_get_type(h_Workflow, &getType); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_get_type", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_GET_VALUE(getType, eSetWorkflowType[nEnumCounter], "mmi_workflow_get_type"); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + } + + return 0; +} + + +//& purpose: Add a node to a workflow prototype and add two nodes by link +//& type : auto +/** +* @testcase ITc_mmi_workflow_node_add_link_nodes_by_names_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Add a node to a workflow prototype and add two nodes by link +* @apicovered mmi_workflow_node_add, mmi_workflow_link_nodes_by_names +* @passcase When mmi_workflow_node_add, mmi_workflow_link_nodes_by_names pass +* @failcase When mmi_workflow_node_add or mmi_workflow_link_nodes_by_names fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_node_add_link_nodes_by_names_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + mmi_node_h h_Node_screen_analyzer = NULL; + mmi_node_h h_Node_match = NULL; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_SCREEN_ANALYZER, &h_Node_screen_analyzer); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(h_Node_screen_analyzer,"mmi_node_create_source", mmi_workflow_destroy(h_Workflow)); + + //Target API + nRet = mmi_workflow_node_add(h_Workflow, "SCREEN_ANALYZER", h_Node_screen_analyzer); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_node_add", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_node_create_logic(MMI_NODE_LOGIC_TYPE_FIXED_STRING_MATCH, &h_Node_match); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_create_logic", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(h_Node_match,"mmi_node_create_logic", mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_node_add(h_Workflow, "MATCH", h_Node_match); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_node_add", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + //Target API + nRet = mmi_workflow_link_nodes_by_names(h_Workflow, "SCREEN_ANALYZER", "SCREEN_INFO", "MATCH", "TEXT"); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_link_nodes_by_names", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_node_destroy(h_Node_match); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_node_destroy(h_Node_screen_analyzer); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Assign an attribute of a workflow to an attribute of a specific node in a workflow prototype +//& type : auto +/** +* @testcase ITc_mmi_workflow_attribute_assign_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Assign an attribute of a workflow to an attribute of a specific node in a workflow prototype +* @apicovered mmi_workflow_attribute_assign +* @passcase When mmi_workflow_attribute_assign pass +* @failcase When mmi_workflow_attribute_assign fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_attribute_assign_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + //Target API + nRet = mmi_workflow_attribute_assign(h_Workflow, "COMMANDS", "MATCH", "CANDIDATES"); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_attribute_assign", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Set the default value of an attribute of a workflow +//& type : auto +/** +* @testcase ITc_mmi_workflow_attribute_set_default_value_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set the default value of an attribute of a workflow +* @apicovered mmi_workflow_attribute_set_default_value +* @passcase When mmi_workflow_attribute_set_default_value pass +* @failcase When mmi_workflow_attribute_set_default_value fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_attribute_set_default_value_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + const int nSourceInt = 5; + const char *pName = "Attribute"; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(g_hPrimitiveValue,"mmi_primitive_value_create_int", mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_attribute_create(g_hPrimitiveValue, pName, &g_hMmiAttribute); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(g_hMmiAttribute,"mmi_attribute_create", mmi_workflow_destroy(h_Workflow)); + + //Target API + nRet = mmi_workflow_attribute_set_default_value(h_Workflow, g_hMmiAttribute); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_attribute_set_default_value", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Assign a signal of a workflow +//& type : auto +/** +* @testcase ITc_mmi_workflow_signal_assign_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Assign a signal of a workflow +* @apicovered mmi_workflow_signal_assign +* @passcase When mmi_workflow_signal_assign pass +* @failcase When mmi_workflow_signal_assign fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_signal_assign_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + //Target API + nRet = mmi_workflow_signal_assign(h_Workflow, "SIGNAL_NAME", "TARGET_NODE", "TARGET_SIGNAL_NAME"); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_signal_assign", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Assign an output of a workflow to a OUT port of a specific node in a workflow prototype and with a port handle +//& type : auto +/** +* @testcase ITc_mmi_workflow_output_assign_assignbyport_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Assign an output of a workflow to a OUT port of a specific node in a workflow prototype and with a port handle +* @apicovered mmi_workflow_output_assign and mmi_workflow_output_assign_by_port +* @passcase When mmi_workflow_output_assign and mmi_workflow_output_assign_by_port pass +* @failcase When mmi_workflow_output_assign Or mmi_workflow_output_assign_by_port fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_output_assign_assignbyport_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + mmi_node_h hNode = NULL; + mmi_port_h hPort = NULL; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + //Target API + nRet = mmi_workflow_output_assign(h_Workflow, "COMMAND", "MATCH", "MATCHED_CANDIDATE"); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_output_assign", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_node_create_logic(MMI_NODE_LOGIC_TYPE_FIXED_STRING_MATCH, &hNode); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_create_logic", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(hNode,"mmi_node_create_logic", mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_port_create(&hPort); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(hPort,"mmi_port_create", mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_node_add_port(hNode, hPort); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_add_port", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_node_add(h_Workflow, "MATCH", hNode); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_node_add", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + //Target API + nRet = mmi_workflow_output_assign_by_port(h_Workflow, "COMMAND", hPort); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_output_assign_by_port", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Register a standard workflow prototype to the workflow manager +//& type : auto +/** +* @testcase ITc_mmi_standard_workflow_register_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Register a standard workflow prototype to the workflow manager +* @apicovered mmi_standard_workflow_register +* @passcase When mmi_standard_workflow_register pass +* @failcase When mmi_standard_workflow_register fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_standard_workflow_register_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + nRet = mmi_workflow_set_type(h_Workflow, MMI_STANDARD_WORKFLOW_VOICE_TOUCH); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_set_type", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + //Target API + nRet = mmi_standard_workflow_register(h_Workflow); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_standard_workflow_register", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Clones a workflow +//& type : auto +/** +* @testcase ITc_mmi_workflow_clone_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Clones a workflow from existing one +* @apicovered mmi_workflow_clone +* @passcase When mmi_workflow_clone pass +* @failcase When mmi_workflow_clone fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_clone_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + mmi_workflow_h hCloned = NULL; + + int nRet = mmi_workflow_create(&h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create"); + + nRet = mmi_workflow_set_type(h_Workflow, MMI_STANDARD_WORKFLOW_VOICE_TOUCH); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_set_type", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + + //Target API + nRet = mmi_workflow_clone(h_Workflow, &hCloned); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_workflow_clone", MmiGetError(nRet), mmi_workflow_destroy(h_Workflow)); + CHECK_HANDLE_CLEANUP(hCloned,"mmi_workflow_clone", mmi_workflow_destroy(h_Workflow)); + + nRet = mmi_workflow_destroy(hCloned); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Create a workflow prototype from a script +//& type : auto +/** +* @testcase ITc_mmi_workflow_create_from_script_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Create a workflow prototype from a script +* @apicovered mmi_workflow_create_from_script +* @passcase When mmi_workflow_create_from_script pass +* @failcase When mmi_workflow_create_from_script fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_workflow_create_from_script_p(void) +{ + START_TEST; + mmi_workflow_h h_Workflow = NULL; + + //Target API + int nRet = mmi_workflow_create_from_script("@workflow", &h_Workflow); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_workflow_create_from_script", MmiGetError(nRet)); + CHECK_HANDLE(h_Workflow,"mmi_workflow_create_from_script"); + + nRet = mmi_workflow_destroy(h_Workflow); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_workflow_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Set Node initialize and deinitialize callbacks +//& type : auto +/** +* @testcase ITc_mmi_node_set_initialized_deinitialized_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set Node initialize and deinitialize callbacks +* @apicovered mmi_node_set_initialized_cb and mmi_node_set_deinitialized_cb +* @passcase When mmi_node_set_initialized_cb and mmi_node_set_deinitialized_cb pass +* @failcase When mmi_node_set_initialized_cb Or mmi_node_set_deinitialized_cb fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_set_initialized_deinitialized_cb_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + + int nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + //Target API + nRet = mmi_node_set_initialized_cb(hNode, MMi_node_initialized_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_set_initialized_cb", MmiGetError(nRet), mmi_node_destroy(hNode)); + + //Target API + nRet = mmi_node_set_deinitialized_cb(hNode, MMi_node_deinitialized_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_set_deinitialized_cb", MmiGetError(nRet), mmi_node_destroy(hNode)); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Set Node attribute callback +//& type : auto +/** +* @testcase ITc_mmi_node_set_attribute_set_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set Node attribute callback +* @apicovered mmi_node_set_attribute_set_cb +* @passcase When mmi_node_set_attribute_set_cb pass +* @failcase When mmi_node_set_attribute_set_cb fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_set_attribute_set_cb_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + + int nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + //Target API + nRet = mmi_node_set_attribute_set_cb(hNode, MMi_node_attribute_set_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_set_attribute_set_cb", MmiGetError(nRet), mmi_node_destroy(hNode)); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Set Node activated and deactivated callbacks +//& type : auto +/** +* @testcase ITc_mmi_node_set_activated_deactivated_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set Node activated and deactivated callbacks +* @apicovered mmi_node_set_activated_cb and mmi_node_set_deactivated_cb +* @passcase When mmi_node_set_activated_cb and mmi_node_set_deactivated_cb pass +* @failcase When mmi_node_set_activated_cb Or mmi_node_set_deactivated_cb fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_set_activated_deactivated_cb_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + + int nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + //Target API + nRet = mmi_node_set_activated_cb(hNode, MMi_node_activated_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_set_activated_cb", MmiGetError(nRet), mmi_node_destroy(hNode)); + + //Target API + nRet = mmi_node_set_deactivated_cb(hNode, MMi_node_deactivated_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_set_deactivated_cb", MmiGetError(nRet), mmi_node_destroy(hNode)); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Set Node signal received Callback +//& type : auto +/** +* @testcase ITc_mmi_node_set_signal_received_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set Node signal received Callback +* @apicovered mmi_node_set_signal_received_cb +* @passcase When mmi_node_set_signal_received_cb pass +* @failcase When mmi_node_set_signal_received_cb fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_set_signal_received_cb_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + + int nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + //Target API + nRet = mmi_node_set_signal_received_cb(hNode, MMi_node_signal_received_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_set_signal_received_cb", MmiGetError(nRet), mmi_node_destroy(hNode)); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Adds a static port to a static node. +//& type : auto +/** +* @testcase ITc_mmi_node_add_find_port_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Adds a static port to a static node +* @apicovered mmi_node_add_port and mmi_node_find_port +* @passcase When mmi_node_add_port and mmi_node_find_port pass +* @failcase When mmi_node_add_port Or mmi_node_find_port fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_add_find_port_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + mmi_port_h hPort = NULL; + mmi_port_h hFound = NULL; + + int nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_SCREEN_ANALYZER, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + nRet = mmi_port_create(&hPort); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_HANDLE_CLEANUP(hPort,"mmi_port_create", mmi_node_destroy(hNode)); + + nRet = mmi_port_set_name(hPort, "MyPort"); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_set_name", MmiGetError(nRet), mmi_node_destroy(hNode)); + + nRet = mmi_port_set_type(hPort, MMI_PORT_TYPE_IN); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_set_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + + //Target API + nRet = mmi_node_add_port(hNode, hPort); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_add_port", MmiGetError(nRet), mmi_node_destroy(hNode)); + + //Target API + nRet = mmi_node_find_port(hNode, MMI_PORT_TYPE_IN, "MyPort", &hFound); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_find_port", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_HANDLE_CLEANUP(hFound,"mmi_node_find_port", mmi_node_destroy(hNode)); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Get port type and count +//& type : auto +/** +* @testcase ITc_mmi_node_get_type_get_port_count_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Get port type and count +* @apicovered mmi_node_get_type and mmi_node_get_port_count +* @passcase When mmi_node_get_type and mmi_node_get_port_count pass +* @failcase When mmi_node_get_type Or mmi_node_get_port_count fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_get_type_get_port_count_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + mmi_node_type_e type; + size_t nPortCount = 0; + int nRet = -1; + mmi_node_type_e eNodeType[] = {MMI_NODE_TYPE_NONE, + MMI_NODE_TYPE_SOURCE, + MMI_NODE_TYPE_PROCESSOR, + MMI_NODE_TYPE_LOGIC, + MMI_NODE_TYPE_CONTROLLER, + MMI_NODE_TYPE_ACTION, + MMI_NODE_TYPE_CUSTOM}; + int nEnumSize = sizeof(eNodeType) / sizeof(eNodeType[0]); + + for(int nEnumCounter = 0 ; nEnumCounter < nEnumSize; nEnumCounter++) + { + //Target API + nRet = mmi_node_create_source(eNodeType[nEnumCounter], &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + //Target API + nRet = mmi_node_get_type(hNode, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_GET_VALUE(type, eNodeType[nEnumCounter], mmi_node_get_type); + + //Target API + nRet = mmi_node_get_port_count(hNode, &nPortCount); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_port_count", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_HANDLE_CLEANUP(hNode,"mmi_node_get_port_count", mmi_node_destroy(hNode)); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + } + + return 0; +} + + +//& purpose: Retrieves the number of ports in a node +//& type : auto +/** +* @testcase ITc_mmi_node_get_port_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Retrieves the number of ports in a node +* @apicovered mmi_node_get_port +* @passcase When mmi_node_get_port pass +* @failcase When mmi_node_get_port fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_get_port_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + mmi_port_h hPort = NULL; + mmi_port_h hFound = NULL; + + int nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + nRet = mmi_port_create(&hPort); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_HANDLE_CLEANUP(hPort,"mmi_port_create", mmi_node_destroy(hNode)); + + nRet = mmi_node_add_port(hNode, hPort); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_add_port", MmiGetError(nRet), mmi_node_destroy(hNode)); + + //Target API + nRet = mmi_node_get_port(hNode, 0, &hFound); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_port", MmiGetError(nRet), mmi_node_destroy(hNode)); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Node Register, Clone and Destroy +//& type : auto +/** +* @testcase ITc_mmi_node_register_clone_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Node Register, Clone and Destroy +* @apicovered mmi_node_register, mmi_node_clone and mmi_node_destroy +* @passcase When mmi_node_register, mmi_node_clone and mmi_node_destroy pass +* @failcase When mmi_node_register or mmi_node_clone or mmi_node_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_register_clone_destroy_p(void) +{ + START_TEST; + mmi_node_h hNode = NULL; + mmi_node_h hCloned = NULL; + + int nRet = mmi_node_create_source(MMI_NODE_SOURCE_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + //Target API + nRet = mmi_node_register(hNode); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_register", MmiGetError(nRet), mmi_node_destroy(hNode)); + + //Target API + nRet = mmi_node_clone(hNode, &hCloned); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_clone", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_HANDLE_CLEANUP(hCloned,"mmi_node_clone", mmi_node_destroy(hNode)); + + //Target API + nRet = mmi_node_destroy(hCloned); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + //Target API + nRet = mmi_node_destroy(hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Provide a attribute to a node instance. +//& type : auto +/** +* @testcase ITc_mmi_node_instance_set_attribute_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Provide a attribute to a node instance +* @apicovered mmi_node_instance_set_attribute +* @passcase When mmi_node_instance_set_attribute pass +* @failcase When mmi_node_instance_set_attribute fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_instance_set_attribute_p(void) +{ + START_TEST; + const int nSourceInt = 0; + const char *pName = "Attribute"; + + int nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + nRet = mmi_attribute_create(g_hPrimitiveValue, pName, &g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiAttribute,"mmi_attribute_create"); + + //Target API + nRet = mmi_node_instance_set_attribute((mmi_node_instance_h)0x1234, g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_instance_set_attribute", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Find port instance and node instance by port and sibling instance +//& type : auto +/** +* @testcase ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Find port instance and node instance by port and sibling instance +* @apicovered mmi_node_instance_find_port_instance, mmi_node_instance_find_by_port_instance and mmi_node_instance_find_sibling_port_instance +* @passcase When mmi_node_instance_find_port_instance, mmi_node_instance_find_by_port_instance and mmi_node_instance_find_sibling_port_instance pass +* @failcase When mmi_node_instance_find_port_instance or mmi_node_instance_find_by_port_instance or mmi_node_instance_find_sibling_port_instance fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p(void) +{ + START_TEST; + mmi_port_instance_h hPort = NULL; + mmi_node_instance_h hNode = NULL; + mmi_port_instance_h hFound = NULL; + + //Target API + int nRet = mmi_node_instance_find_port_instance((mmi_node_instance_h)(0x1234), MMI_PORT_TYPE_IN, "InPort", &hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_instance_find_port_instance", MmiGetError(nRet)); + + nRet = mmi_node_instance_find_by_port_instance((mmi_port_instance_h)(0x1234), &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_instance_find_by_port_instance", MmiGetError(nRet)); + + nRet = mmi_node_instance_find_sibling_port_instance((mmi_port_instance_h)(0x1234), "InPort", &hFound); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_instance_find_sibling_port_instance", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Emits a signal from a node instance +//& type : auto +/** +* @testcase ITc_mmi_node_instance_emit_signal_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Emits a signal from a node instance +* @apicovered mmi_node_instance_emit_signal +* @passcase When mmi_node_instance_emit_signal pass +* @failcase When mmi_node_instance_emit_signal fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_instance_emit_signal_p(void) +{ + START_TEST; + mmi_signal_h handle = NULL; + + int nRet = mmi_signal_create("signal", &handle); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_create", MmiGetError(nRet)); + CHECK_HANDLE(handle,"mmi_signal_create"); + + //Target API + nRet = mmi_node_instance_emit_signal((mmi_node_instance_h)(0x1234), handle); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_instance_emit_signal", MmiGetError(nRet), mmi_signal_destroy(handle)); + + nRet = mmi_signal_destroy(handle); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_signal_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test create bool and get bool APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_bool_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create bool and then get bool APIs +* @apicovered mmi_data_create_bool and mmi_data_create_get_bool +* @passcase When mmi_data_create_bool and mmi_data_create_get_bool pass +* @failcase When mmi_data_create_bool and mmi_data_create_get_bool fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_bool_p(void) +{ + START_TEST; + const bool sourceBool = true; + bool getValue = false; + + //Target API + int nRet = mmi_data_create_bool(sourceBool, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_bool", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_bool"); + + nRet = mmi_data_get_bool(g_hMmiData, &getValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_bool", MmiGetError(nRet)); + if (getValue != sourceBool) + { + FPRINTF("[Line : %d][%s] Set and Get bool value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& purpose: Test create int and get int APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_int_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create int and then get int APIs +* @apicovered mmi_data_create_int and mmi_data_create_get_int +* @passcase When mmi_data_create_int and mmi_data_create_get_int pass +* @failcase When mmi_data_create_int and mmi_data_create_get_int fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_int_p(void) +{ + START_TEST; + const int nSourceInt = 1; + int nGetValue = -1; + + //Target API + int nRet = mmi_data_create_int(nSourceInt, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_int"); + + nRet = mmi_data_get_int(g_hMmiData, &nGetValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_int", MmiGetError(nRet)); + if (nGetValue != nSourceInt) + { + FPRINTF("[Line : %d][%s] Set and Get int value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + + +//& purpose: Test create float and get float APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_float_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create float and then get float APIs +* @apicovered mmi_data_create_float and mmi_data_create_get_float +* @passcase When mmi_data_create_float and mmi_data_create_get_float pass +* @failcase When mmi_data_create_float and mmi_data_create_get_float fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_float_p(void) +{ + START_TEST; + const float fSourceFloat = 2.0f; + float fGetValue = -1.0f; + + //Target API + int nRet = mmi_data_create_float(fSourceFloat, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_float", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_float"); + + nRet = mmi_data_get_float(g_hMmiData, &fGetValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_float", MmiGetError(nRet)); + if (fGetValue != fSourceFloat) + { + FPRINTF("[Line : %d][%s] Set and Get float value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& purpose: Test create text and get text APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_text_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create text and then get text APIs +* @apicovered mmi_data_create_text and mmi_data_create_get_text +* @passcase When mmi_data_create_text and mmi_data_create_get_text pass +* @failcase When mmi_data_create_text and mmi_data_create_get_text fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_text_p(void) +{ + START_TEST; + const char *pSourceText = "Test"; + const char *pGetText = NULL; + + //Target API + int nRet = mmi_data_create_text(pSourceText, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_text", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_text"); + + nRet = mmi_data_get_text(g_hMmiData, &pGetText); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_text", MmiGetError(nRet)); + if ( strcmp(pGetText, pSourceText) != 0) + { + FPRINTF("[Line : %d][%s] Set and Get text value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& purpose: Test create audio and get audio APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_audio_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create audio and then get audio APIs +* @apicovered mmi_data_create_audio and mmi_data_create_get_audio +* @passcase When mmi_data_create_audio and mmi_data_create_get_audio pass +* @failcase When mmi_data_create_audio and mmi_data_create_get_audio fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_audio_p(void) +{ + START_TEST; + const char pszSourceValue[DATA_LENGTH] = {1, }; + const void *pBytes = NULL; + size_t size; + + //Target API + int nRet = mmi_data_create_audio(pszSourceValue, DATA_LENGTH, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_audio", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_audio"); + + nRet = mmi_data_get_audio(g_hMmiData, &pBytes, &size); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_audio", MmiGetError(nRet)); + if ( (size != DATA_LENGTH) || (*((unsigned char*)pBytes) != 1) ) + { + FPRINTF("[Line : %d][%s] Set and Get audio length value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + + +//& purpose: Test create video and get video APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_video_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create video and then get video APIs +* @apicovered mmi_data_create_video and mmi_data_create_get_video +* @passcase When mmi_data_create_video and mmi_data_create_get_video pass +* @failcase When mmi_data_create_video and mmi_data_create_get_video fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_video_p(void) +{ + START_TEST; + const char pszSourceValue[DATA_LENGTH] = {1, }; + const void *pBytes = NULL; + size_t size; + + //Target API + int nRet = mmi_data_create_video(pszSourceValue, DATA_LENGTH, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_video", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_video"); + + nRet = mmi_data_get_video(g_hMmiData, &pBytes, &size); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_video", MmiGetError(nRet)); + if ( (size != DATA_LENGTH) || (*((unsigned char*)pBytes) != 1) ) + { + FPRINTF("[Line : %d][%s] Set and Get video length value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + + +//& purpose: Test create identification and get identification APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_user_get_identification_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create identification and then get identification APIs +* @apicovered mmi_data_create_user_identification and mmi_data_get_user_identification +* @passcase When mmi_data_create_user_identification and mmi_data_get_user_identification pass +* @failcase When mmi_data_create_user_identification and mmi_data_get_user_identification fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_user_get_identification_p(void) +{ + START_TEST; + const char pszSourceValue[DATA_LENGTH] = {1, }; + const void *pBytes = NULL; + size_t size; + + //Target API + int nRet = mmi_data_create_user_identification(pszSourceValue, DATA_LENGTH, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_user_identification", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_user_identification"); + + nRet = mmi_data_get_user_identification(g_hMmiData, &pBytes, &size); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_user_identification", MmiGetError(nRet)); + if ( (size != DATA_LENGTH) || (*((unsigned char*)pBytes) != 1) ) + { + FPRINTF("[Line : %d][%s] mmi_data_get_user_identification failed, Set and Get identification length value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& purpose: Test create coordinate and get coordinate APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_coordinate_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create coordinate and then get coordinate APIs +* @apicovered mmi_data_create_coordinate and mmi_data_create_get_coordinate +* @passcase When mmi_data_create_coordinate and mmi_data_create_get_coordinate pass +* @failcase When mmi_data_create_coordinate and mmi_data_create_get_coordinate fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_coordinate_p(void) +{ + START_TEST; + const int nSourceX = 123; + const int nSourceY = 456; + int nTargetX = -1; + int nTargetY = -1; + + //Target API + int nRet = mmi_data_create_coordinate(nSourceX, nSourceY, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_coordinate", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_coordinate"); + + nRet = mmi_data_get_coordinate(g_hMmiData, &nTargetX, &nTargetY); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_coordinate", MmiGetError(nRet)); + if ( (nSourceX != nTargetX) || (nSourceY != nTargetY) ) + { + FPRINTF("[Line : %d][%s] Set and Get coordinate length value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& purpose: Test create bounding_box and get bounding_box APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_get_bounding_box_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create bounding_box and then get bounding_box APIs +* @apicovered mmi_data_create_bounding_box and mmi_data_create_get_bounding_box +* @passcase When mmi_data_create_bounding_box and mmi_data_create_get_bounding_box pass +* @failcase When mmi_data_create_bounding_box and mmi_data_create_get_bounding_box fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_get_bounding_box_p(void) +{ + START_TEST; + const int nSourceX = 12; + const int nSourceY = 34; + const int nSourceW = 56; + const int nSourceH = 78; + int nTargetX = -1; + int nTargetY = -1; + int nTargetW = -1; + int nTargetH = -1; + + //Target API + int nRet = mmi_data_create_bounding_box(nSourceX, nSourceY, nSourceW, nSourceH, &g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_bounding_box", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_bounding_box"); + + nRet = mmi_data_get_bounding_box(g_hMmiData, &nTargetX, &nTargetY, &nTargetW, &nTargetH); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_bounding_box", MmiGetError(nRet)); + if ( (nSourceX != nTargetX) || (nSourceY != nTargetY) || (nSourceW != nTargetW) || (nSourceH != nTargetH)) + { + FPRINTF("[Line : %d][%s] Set and Get bounding_box length value mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + + +//& purpose: Test create array and get array count APIs +//& type : auto +/** +* @testcase ITc_mmi_data_create_array_get_array_count_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create array and then get array count APIs +* @apicovered mmi_data_create_array and mmi_data_get_array_count +* @passcase When mmi_data_create_array and mmi_data_get_array_count pass +* @failcase When mmi_data_create_array and mmi_data_get_array_count fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_array_get_array_count_p(void) +{ + START_TEST; + const int nSourceArr[COUNT_ELEMENTS] = {1, 2}; + + //Target API + int nRet = mmi_data_create_array(&g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_array", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_array"); + + for (size_t i = 0; i < COUNT_ELEMENTS; i++) + { + nRet = mmi_data_create_int(nSourceArr[i], &g_hArrayElement[i]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + + nRet = mmi_data_add_array_element(g_hMmiData, g_hArrayElement[i]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_add_array_element", MmiGetError(nRet)); + g_hArrayElement[i] = NULL; + } + size_t count = -1; + //Target API + nRet = mmi_data_get_array_count(g_hMmiData, &count); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_array_count", MmiGetError(nRet)); + if (count != COUNT_ELEMENTS) + { + FPRINTF("[Line : %d][%s] Get array count value is not correct: %d\\n", __LINE__, API_NAMESPACE, count) ; + return 1; + } + + return 0; +} + + +//& purpose: Test add array element and get array element APIs +//& type : auto +/** +* @testcase ITc_mmi_data_add_array_element_get_array_element_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call add array element and get array element APIs +* @apicovered mmi_data_add_array_element and mmi_data_get_array_element +* @passcase When mmi_data_add_array_element and mmi_data_get_array_element pass +* @failcase When mmi_data_add_array_element and mmi_data_get_array_element fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_add_array_element_get_array_element_p(void) +{ + START_TEST; + const int nSourceArr[COUNT_ELEMENTS] = {1, 2}; + + int nRet = mmi_data_create_array(&g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_array", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_array"); + + for (size_t i = 0; i < COUNT_ELEMENTS; i++) + { + nRet = mmi_data_create_int(nSourceArr[i], &g_hArrayElement[i]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + + //Target API + nRet = mmi_data_add_array_element(g_hMmiData, g_hArrayElement[i]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_add_array_element", MmiGetError(nRet)); + g_hArrayElement[i] = NULL; + } + size_t count = -1; + nRet = mmi_data_get_array_count(g_hMmiData, &count); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_array_count", MmiGetError(nRet)); + if (count != COUNT_ELEMENTS) + { + FPRINTF("[Line : %d][%s] Get array count value is not correct: %d\\n", __LINE__, API_NAMESPACE, count) ; + return 1; + } + + for (size_t i = 0; i < count; i++) + { + mmi_data_h hElement = NULL; + + //Target API + nRet = mmi_data_get_array_element(g_hMmiData, i, &hElement); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_array_element", MmiGetError(nRet)); + CHECK_HANDLE(hElement,"mmi_data_get_array_element"); + + mmi_data_type_e type = MMI_DATA_TYPE_ANY; + nRet = mmi_data_get_type(hElement, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + if (type != MMI_DATA_TYPE_INTEGER) + { + FPRINTF("[Line : %d][%s] mmi_data_get_type failed. received type is not integer\\n", __LINE__, API_NAMESPACE) ; + return 1; + } + + int nData = 0; + nRet = mmi_data_get_int(hElement, &nData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_int", MmiGetError(nRet)); + if (nData != nSourceArr[i]) + { + FPRINTF("[Line : %d][%s] mmi_data_get_int failed. received type is not correct: %d\\n", __LINE__, API_NAMESPACE, nData) ; + return 1; + } + } + + return 0; +} + + +//& purpose: Test create struct API and destroy API +//& type : auto +/** +* @testcase ITc_mmi_data_create_struct_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create struct API and destroy API +* @apicovered mmi_data_create_struct and mmi_data_destroy +* @passcase When mmi_data_create_struct and mmi_data_destroy pass +* @failcase When mmi_data_create_struct or mmi_data_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_create_struct_destroy_p(void) +{ + START_TEST; + + //Target API + int nRet = mmi_data_create_struct(&g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_struct", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_struct"); + + nRet = mmi_data_destroy(g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + g_hMmiData = NULL; + return 0; +} + + +//& purpose: Test set and get struct API +//& type : auto +/** +* @testcase ITc_mmi_data_set_get_struct_element_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create struct API, set element and get element +* @apicovered mmi_data_set_struct_element and mmi_data_get_struct_element +* @passcase When mmi_data_set_struct_element and mmi_data_get_struct_element pass +* @failcase When mmi_data_set_struct_element or mmi_data_get_struct_element fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_set_get_struct_element_p(void) +{ + START_TEST; + const int nSsourceInt = 1; + const char *pName = "Element"; + mmi_data_h hElement = NULL; + + int nRet = mmi_data_create_struct(&g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_struct", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_struct"); + + nRet = mmi_data_create_int(nSsourceInt, &g_hArrayElement[0]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + + //Target API + nRet = mmi_data_set_struct_element(g_hMmiData, pName, g_hArrayElement[0]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_set_struct_element", MmiGetError(nRet)); + + //Target API + nRet = mmi_data_get_struct_element(g_hMmiData, pName, &hElement); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_struct_element", MmiGetError(nRet)); + CHECK_HANDLE(hElement,"mmi_data_get_struct_element"); + + if (hElement != g_hArrayElement[0] ) + { + FPRINTF("[Line : %d][%s] mmi_data_get_struct_element failed. Set and Get values mismatch\\n", __LINE__, API_NAMESPACE) ; + return 1; + } + g_hArrayElement[0] = NULL; + + return 0; +} + + +//& purpose: Get data type +//& type : auto +/** +* @testcase ITc_mmi_data_get_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call get type API for various types +* @apicovered mmi_data_get_type +* @passcase When mmi_data_get_type pass +* @failcase When mmi_data_get_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_get_type_p(void) +{ + START_TEST; + + mmi_data_h hTempValue = NULL; + mmi_data_type_e type = MMI_DATA_TYPE_ARRAY; + const char pszSourceValue[DATA_LENGTH] = {1, }; + + int nRet = mmi_data_create_int(0, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_int"); + + nRet = mmi_data_get_type(hTempValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_INTEGER, "mmi_data_get_type"); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_data_create_text("Hello", &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_text", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_text"); + + nRet = mmi_data_get_type(hTempValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_TEXT, "mmi_data_get_type"); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_data_create_coordinate(123, 456, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_coordinate", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_coordinate"); + + nRet = mmi_data_get_type(hTempValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_COORDINATE, "mmi_data_get_type"); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_data_create_bounding_box(10, 25, 50, 75, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_bounding_box", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_bounding_box"); + + nRet = mmi_data_get_type(hTempValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_BOUNDING_BOX, "mmi_data_get_type"); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_data_create_audio(pszSourceValue, DATA_LENGTH, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_audio", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_audio"); + + nRet = mmi_data_get_type(hTempValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_AUDIO, "mmi_data_get_type"); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_data_create_array(&hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_array", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_array"); + + nRet = mmi_data_get_type(hTempValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_ARRAY, "mmi_data_get_type"); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_data_create_struct(&hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_struct", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_struct"); + + nRet = mmi_data_get_type(hTempValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_STRUCT, "mmi_data_get_type"); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + return 0; +} + + + +//& purpose: Test Get Struct count, element name and element value APIs +//& type : auto +/** +* @testcase ITc_mmi_data_get_struct_count_element_name_element_value_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call Test Get Struct count, element name and element value APIs +* @apicovered mmi_data_get_struct_count, mmi_data_get_struct_element_name and mmi_data_get_struct_element_value +* @passcase When mmi_data_get_struct_count, mmi_data_get_struct_element_name and mmi_data_get_struct_element_value pass +* @failcase When mmi_data_get_struct_count, mmi_data_get_struct_element_name and mmi_data_get_struct_element_value fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_get_struct_count_element_name_element_value_p(void) +{ + START_TEST; + const int nSsourceInt = 1; + const char *pSourceText = "Hello"; + mmi_data_h hElement = NULL; + const char *pszNameArr[COUNT_ELEMENTS] = {"Element1", "Element2"}; + const char *pElementName = NULL; + mmi_data_h hElementValue = NULL; + + int nRet = mmi_data_create_struct(&g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_struct", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_struct"); + + nRet = mmi_data_create_int(nSsourceInt, &g_hArrayElement[0]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + + nRet = mmi_data_create_text(pSourceText, &g_hArrayElement[1]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_text", MmiGetError(nRet)); + + for (size_t i = 0; i < COUNT_ELEMENTS; i++) + { + nRet = mmi_data_set_struct_element(g_hMmiData, pszNameArr[i], g_hArrayElement[i]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_set_struct_element", MmiGetError(nRet)); + g_hArrayElement[i] = NULL; + } + + size_t count = 0; + //Target API + nRet = mmi_data_get_struct_count(g_hMmiData, &count); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_struct_count", MmiGetError(nRet)); + CHECK_GET_VALUE(count, COUNT_ELEMENTS, "mmi_data_get_struct_count"); + + //Target API + nRet = mmi_data_get_struct_element_name(g_hMmiData, 0, &pElementName); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_struct_element_name", MmiGetError(nRet)); + CHECK_HANDLE(pElementName,"mmi_data_get_struct_element_name"); + if (strcmp(pElementName, "Element1") != 0) + { + FPRINTF("[Line : %d][%s] mmi_data_get_struct_element_name failed, Set and Get element name is failed\\n", __LINE__, API_NAMESPACE); + return 1; + } + + //Target API + nRet = mmi_data_get_struct_element_value(g_hMmiData, 0, &hElementValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_struct_element_value", MmiGetError(nRet)); + CHECK_HANDLE(hElementValue,"mmi_data_get_struct_element_value"); + + int nValue = 0; + nRet = mmi_data_get_int(hElementValue, &nValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_int", MmiGetError(nRet)); + CHECK_GET_VALUE(nValue, nSsourceInt, "mmi_data_get_int"); + + return 0; +} + + +//& purpose: Test data to and from bytes APIs +//& type : auto +/** +* @testcase ITc_mmi_data_to_from_bytes_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call data to byte and from byte APIs +* @apicovered mmi_data_to_bytes and mmi_data_from_bytes +* @passcase When mmi_data_to_bytes and mmi_data_from_bytes pass +* @failcase When mmi_data_to_bytes or mmi_data_from_bytes fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_data_to_from_bytes_p(void) +{ + START_TEST; + const int nSsourceInt = 1; + const char *pName = "Element"; + mmi_data_h hElement = NULL; + unsigned char *bytes = NULL; + size_t length = 0; + mmi_data_h hRestoredValue = NULL; + mmi_data_type_e type = MMI_DATA_TYPE_BOOLEAN; + + int nRet = mmi_data_create_array(&g_hMmiData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_array", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiData,"mmi_data_create_array"); + + const int source[COUNT_ELEMENTS] = {1, 2}; + nRet = mmi_data_create_int(source[0], &g_hArrayElement[0]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + + nRet = mmi_data_create_int(source[1], &g_hArrayElement[1]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + + nRet = mmi_data_add_array_element(g_hMmiData, g_hArrayElement[0]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_add_array_element", MmiGetError(nRet)); + g_hArrayElement[0] = NULL; + + nRet = mmi_data_add_array_element(g_hMmiData, g_hArrayElement[1]); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_add_array_element", MmiGetError(nRet)); + g_hArrayElement[1] = NULL; + + //Target API + nRet = mmi_data_to_bytes(g_hMmiData, &bytes, &length); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_to_bytes", MmiGetError(nRet)); + mmi_data_destroy(g_hMmiData); + g_hMmiData = NULL; + mmi_data_destroy(g_hArrayElement[0]); + g_hArrayElement[0] = NULL; + mmi_data_destroy(g_hArrayElement[1]); + g_hArrayElement[1] = NULL; + + //Target API + nRet = mmi_data_from_bytes(bytes, length, &hRestoredValue); + free(bytes); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_from_bytes", MmiGetError(nRet)); + CHECK_HANDLE(hRestoredValue,"mmi_data_from_bytes"); + + nRet = mmi_data_get_type(hRestoredValue, &type); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_ARRAY, "mmi_data_get_type"); + + size_t count = 0; + nRet = mmi_data_get_array_count(hRestoredValue, &count); + CHECK_GET_VALUE(count, COUNT_ELEMENTS, "mmi_data_get_array_count"); + + for (size_t i = 0; i < count; ++i) + { + int nData = 0; + mmi_data_h hElement = NULL; + nRet = mmi_data_get_array_element(hRestoredValue, i, &hElement); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_array_element", MmiGetError(nRet)); + + nRet = mmi_data_get_type(hElement, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_INTEGER, "mmi_data_get_type"); + + nRet = mmi_data_get_int(hElement, &nData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_get_int", MmiGetError(nRet)); + CHECK_GET_VALUE(nData, source[i], "mmi_data_get_int"); + } + + nRet = mmi_data_destroy(hRestoredValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test MMI attribute create and destroy APIs +//& type : auto +/** +* @testcase ITc_mmi_attribute_create_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call attribute create and destroy APIs +* @apicovered attribute_create_create and attribute_create_destroy +* @passcase When attribute_create_create and attribute_create_destroy pass +* @failcase When attribute_create_create or attribute_create_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_attribute_create_destroy_p(void) +{ + START_TEST; + + const int nSourceInt = 0; + const char *pName = "Attribute"; + + int nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + //Target API + nRet = mmi_attribute_create(g_hPrimitiveValue, pName, &g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiAttribute,"mmi_attribute_create"); + + //Target API + nRet = mmi_attribute_destroy(g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_destroy", MmiGetError(nRet)); + g_hMmiAttribute = NULL; + + return 0; +} + +//& purpose: Test MMI attribute set and get name APIs +//& type : auto +/** +* @testcase ITc_mmi_attribute_set_get_name_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call attribute set and get name APIs +* @apicovered mmi_attribute_set_name and mmi_attribute_get_name +* @passcase When mmi_attribute_set_name and mmi_attribute_get_name pass +* @failcase When mmi_attribute_set_name or mmi_attribute_get_name fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_attribute_set_get_name_p(void) +{ + START_TEST; + + const int nSourceInt = 0; + const char *pName = "Attribute"; + char *pGetName = NULL; + + int nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + nRet = mmi_attribute_create(g_hPrimitiveValue, pName, &g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiAttribute,"mmi_attribute_create"); + + //Target API + nRet = mmi_attribute_set_name(g_hMmiAttribute, pName); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_set_name", MmiGetError(nRet)); + + //Target API + nRet = mmi_attribute_get_name(g_hMmiAttribute, &pGetName); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_get_name", MmiGetError(nRet)); + CHECK_HANDLE(pGetName,"mmi_attribute_get_name"); + + if (strcmp(pGetName, pName) != 0) + { + FPRINTF("[Line : %d][%s] mmi_attribute_get_name failed, Set and Get name mismatch\\n", __LINE__, API_NAMESPACE); + mmi_attribute_destroy(g_hMmiAttribute); + free(pGetName); + return 1; + } + free(pGetName); + + return 0; +} + +//& purpose: Test MMI attribute get value API +//& type : auto +/** +* @testcase ITc_mmi_attribute_get_value_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call attribute get value API +* @apicovered mmi_attribute_get_value +* @passcase When mmi_attribute_get_value pass +* @failcase When mmi_attribute_get_value fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_attribute_get_value_p(void) +{ + START_TEST; + + const int nSourceInt = 0; + const char *pName = "Attribute"; + mmi_primitive_value_h hGetValue = NULL; + mmi_primitive_value_type_e type = MMI_PRIMITIVE_VALUE_TYPE_ARRAY; + int nValue = -1; + + int nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + nRet = mmi_attribute_create(g_hPrimitiveValue, pName, &g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiAttribute,"mmi_attribute_create"); + + //Target API + nRet = mmi_attribute_get_value(g_hMmiAttribute, &hGetValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_get_value", MmiGetError(nRet)); + CHECK_HANDLE(hGetValue,"mmi_attribute_get_value"); + + nRet = mmi_primitive_value_get_type(hGetValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_PRIMITIVE_VALUE_TYPE_INT, "mmi_primitive_value_get_type"); + + nRet = mmi_primitive_value_get_int(hGetValue, &nValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_int", MmiGetError(nRet)); + CHECK_GET_VALUE(nValue, nSourceInt, "mmi_primitive_value_get_int"); + + nRet = mmi_primitive_value_destroy(hGetValue); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test MMI attribute clone API +//& type : auto +/** +* @testcase ITc_mmi_attribute_clone_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call attribute clone API +* @apicovered mmi_attribute_clone +* @passcase When mmi_attribute_clone pass +* @failcase When mmi_attribute_clone fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_attribute_clone_p(void) +{ + START_TEST; + + const int nSourceInt = 0; + const char *pName = "Attribute"; + + int nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + nRet = mmi_attribute_create(g_hPrimitiveValue, pName, &g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiAttribute,"mmi_attribute_create"); + + //Target API + nRet = mmi_attribute_clone(g_hMmiAttribute, &g_hCloned_attribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_clone", MmiGetError(nRet)); + CHECK_HANDLE(g_hCloned_attribute,"mmi_attribute_clone"); + + nRet = mmi_attribute_destroy(g_hCloned_attribute); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_attribute_destroy", MmiGetError(nRet)); + g_hCloned_attribute = NULL; + + nRet = mmi_attribute_destroy(g_hMmiAttribute); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_attribute_destroy", MmiGetError(nRet)); + g_hMmiAttribute = NULL; + + return 0; +} + + +//& purpose: Test MMI attribute to and from byte APIs +//& type : auto +/** +* @testcase ITc_mmi_attribute_to_from_bytes_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call attribute to and from byte APIs +* @apicovered mmi_attribute_to_bytes and mmi_attribute_from_bytes +* @passcase When mmi_attribute_to_bytes and mmi_attribute_from_bytes pass +* @failcase When mmi_attribute_to_bytes or mmi_attribute_from_bytes fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_attribute_to_from_bytes_p(void) +{ + START_TEST; + const int nSourceInt = 5; + unsigned char *pBytes = NULL; + size_t size = 0; + mmi_attribute_h hRestoredAttribute = NULL; + const char *pName = "Attribute"; + + int nRet = mmi_primitive_value_create_int(nSourceInt, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + nRet = mmi_attribute_create(g_hPrimitiveValue, pName, &g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create", MmiGetError(nRet)); + CHECK_HANDLE(g_hMmiAttribute,"mmi_attribute_create"); + + //Target API + nRet = mmi_attribute_to_bytes(g_hMmiAttribute, &pBytes, &size); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_to_bytes", MmiGetError(nRet)); + CHECK_HANDLE(pBytes,"mmi_attribute_to_bytes"); + + nRet = mmi_attribute_destroy(g_hMmiAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_destroy", MmiGetError(nRet)); + g_hMmiAttribute = NULL; + + //Target API + nRet = mmi_attribute_from_bytes(pBytes, size, &hRestoredAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_from_bytes", MmiGetError(nRet)); + CHECK_HANDLE(hRestoredAttribute,"mmi_attribute_from_bytes"); + + nRet = mmi_attribute_destroy(hRestoredAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_destroy", MmiGetError(nRet)); + hRestoredAttribute = NULL; + + return 0; +} + +//& purpose: Test MMI attribute create string array API +//& type : auto +/** +* @testcase ITc_mmi_attribute_create_string_array_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call attribute create string array API +* @apicovered mmi_attribute_create_string_array +* @passcase When mmi_attribute_create_string_array pass +* @failcase When mmi_attribute_create_string_array fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_attribute_create_string_array_p(void) +{ + START_TEST; + + mmi_attribute_h hAttribute = NULL; + const char *pTestString[3] = {"Hello", "World", "Test"}; + + //Target API + int nRet = mmi_attribute_create_string_array("Name", pTestString, 3, &hAttribute); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_attribute_create_string_array", MmiGetError(nRet)); + CHECK_HANDLE(hAttribute,"mmi_attribute_create_string_array"); + + nRet = mmi_attribute_destroy(hAttribute); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_attribute_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test primitive value create and get int APIs +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_create_get_int_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value create and get int APIs +* @apicovered mmi_primitive_value_create_int and mmi_primitive_value_get_int +* @passcase When mmi_primitive_value_create_int and mmi_primitive_value_get_int pass +* @failcase When mmi_primitive_value_create_int or mmi_primitive_value_get_int fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_create_get_int_p(void) +{ + START_TEST; + + int nSourceValue = 0; + int nGetValue = -1; + + //Target API + int nRet = mmi_primitive_value_create_int(nSourceValue, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + //Target API + nRet = mmi_primitive_value_get_int(g_hPrimitiveValue, &nGetValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_int", MmiGetError(nRet)); + CHECK_GET_VALUE(nGetValue, nSourceValue, "mmi_primitive_value_get_int"); + + return 0; +} + + +//& purpose: Test primitive value create and get float APIs +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_create_get_float_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value create and get float APIs +* @apicovered mmi_primitive_value_create_float and mmi_primitive_value_get_float +* @passcase When mmi_primitive_value_create_float and mmi_primitive_value_get_float pass +* @failcase When mmi_primitive_value_create_float or mmi_primitive_value_get_float fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_create_get_float_p(void) +{ + START_TEST; + + float nSourceValue = 0; + float nGetValue = -1; + + //Target API + int nRet = mmi_primitive_value_create_float(nSourceValue, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_float", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_float"); + //Target API + nRet = mmi_primitive_value_get_float(g_hPrimitiveValue, &nGetValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_float", MmiGetError(nRet)); + CHECK_GET_VALUE(nGetValue, nSourceValue, "mmi_primitive_value_get_float"); + + return 0; +} + +//& purpose: Test primitive value create and get string APIs +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_create_get_string_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value create and get string APIs +* @apicovered mmi_primitive_value_create_string and mmi_primitive_value_get_string +* @passcase When mmi_primitive_value_create_string and mmi_primitive_value_get_string pass +* @failcase When mmi_primitive_value_create_string or mmi_primitive_value_get_string fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_create_get_string_p(void) +{ + START_TEST; + + const char *pSourceValue = "Test"; + const char *pGetValue = NULL; + + //Target API + int nRet = mmi_primitive_value_create_string(pSourceValue, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_string", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_string"); + //Target API + nRet = mmi_primitive_value_get_string(g_hPrimitiveValue, &pGetValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_string", MmiGetError(nRet)); + CHECK_HANDLE(pGetValue,"mmi_primitive_value_get_string"); + + if (strcmp(pSourceValue, pGetValue) != 0) + { + FPRINTF("[Line : %d][%s] mmi_primitive_value_get_string failed. Set and Get values mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + return 0; +} + +//& purpose: Test primitive value create and get bool APIs +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_create_get_bool_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value create and get bool APIs +* @apicovered mmi_primitive_value_create_bool and mmi_primitive_value_get_bool +* @passcase When mmi_primitive_value_create_bool and mmi_primitive_value_get_bool pass +* @failcase When mmi_primitive_value_create_bool or mmi_primitive_value_get_bool fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_create_get_bool_p(void) +{ + START_TEST; + + bool bSourceValue = true; + bool bGetValue = false; + + //Target API + int nRet = mmi_primitive_value_create_bool(bSourceValue, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_bool", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_bool"); + //Target API + nRet = mmi_primitive_value_get_bool(g_hPrimitiveValue, &bGetValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_bool", MmiGetError(nRet)); + CHECK_GET_VALUE(bGetValue, bSourceValue, "mmi_primitive_value_get_bool"); + + return 0; +} + +//& purpose: Test primitive value create array, add element and get array count APIs +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_create_array_add_element_get_array_count_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value create array then add element and get array count APIs +* @apicovered mmi_primitive_value_create_array, mmi_primitive_value_add_array_element and mmi_primitive_value_get_array_count +* @passcase When mmi_primitive_value_create_array, mmi_primitive_value_add_array_element and mmi_primitive_value_get_array_count pass +* @failcase When mmi_primitive_value_create_array or mmi_primitive_value_add_array_element or mmi_primitive_value_get_array_count fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_create_array_add_element_get_array_count_p(void) +{ + START_TEST; + size_t count = 10; + int nSource1 = 1, nSource2 = 2; + + //Target API + int nRet = mmi_primitive_value_create_array(&g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_array", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_array"); + + //Target API + nRet = mmi_primitive_value_get_array_count(g_hPrimitiveValue, &count); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_array_count", MmiGetError(nRet)); + CHECK_GET_VALUE(count, 0, "mmi_primitive_value_get_array_count"); + + nRet = mmi_primitive_value_create_int(nSource1, &g_hArrayElement1); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hArrayElement1,"mmi_primitive_value_create_int"); + + nRet = mmi_primitive_value_create_int(nSource2, &g_hArrayElement2); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hArrayElement2,"mmi_primitive_value_create_int"); + + //Target API + nRet = mmi_primitive_value_add_array_element(g_hPrimitiveValue, g_hArrayElement1); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_add_array_element", MmiGetError(nRet)); + g_hArrayElement1 = NULL; + + nRet = mmi_primitive_value_add_array_element(g_hPrimitiveValue, g_hArrayElement2); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_add_array_element", MmiGetError(nRet)); + g_hArrayElement2 = NULL; + + //Target API for count #2 + nRet = mmi_primitive_value_get_array_count(g_hPrimitiveValue, &count); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_array_count", MmiGetError(nRet)); + CHECK_GET_VALUE(count, 2, "mmi_primitive_value_get_array_count"); + + return 0; +} + + +//& purpose: Test primitive value get type API for various types +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_get_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value get type API for various types +* @apicovered mmi_primitive_value_get_type +* @passcase When mmi_primitive_value_get_type pass +* @failcase When mmi_primitive_value_get_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_get_type_p(void) +{ + START_TEST; + + mmi_primitive_value_h hTempValue = NULL; + mmi_primitive_value_type_e tempType = MMI_PRIMITIVE_VALUE_TYPE_ARRAY; + + int nRet = mmi_primitive_value_create_int(0, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_primitive_value_create_int"); + + nRet = mmi_primitive_value_get_type(hTempValue, &tempType); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(tempType, MMI_PRIMITIVE_VALUE_TYPE_INT, "mmi_primitive_value_get_type"); + + nRet = mmi_primitive_value_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_primitive_value_create_string("Test", &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_string", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_primitive_value_create_string"); + + nRet = mmi_primitive_value_get_type(hTempValue, &tempType); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(tempType, MMI_PRIMITIVE_VALUE_TYPE_STRING, "mmi_primitive_value_get_type"); + + nRet = mmi_primitive_value_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_primitive_value_create_bool(true, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_bool", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_primitive_value_create_bool"); + + nRet = mmi_primitive_value_get_type(hTempValue, &tempType); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(tempType, MMI_PRIMITIVE_VALUE_TYPE_BOOL, "mmi_primitive_value_get_type"); + + nRet = mmi_primitive_value_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + nRet = mmi_primitive_value_create_float(1.0, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_float", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_primitive_value_create_float"); + + nRet = mmi_primitive_value_get_type(hTempValue, &tempType); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(tempType, MMI_PRIMITIVE_VALUE_TYPE_FLOAT, "mmi_primitive_value_get_type"); + + nRet = mmi_primitive_value_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + tempType = MMI_PRIMITIVE_VALUE_TYPE_INT; + nRet = mmi_primitive_value_create_array(&hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_array", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_primitive_value_create_array"); + + nRet = mmi_primitive_value_get_type(hTempValue, &tempType); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(tempType, MMI_PRIMITIVE_VALUE_TYPE_ARRAY, "mmi_primitive_value_get_type"); + + nRet = mmi_primitive_value_destroy(hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + hTempValue = NULL; + + return 0; +} + + +//& purpose: Test primitive value get array element API +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_get_array_element_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value get array element API +* @apicovered mmi_primitive_value_get_array_element +* @passcase When mmi_primitive_value_get_array_element pass +* @failcase When mmi_primitive_value_get_array_element fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_get_array_element_p(void) +{ + START_TEST; + size_t count = 10; + int nSource[] = {1, 2}; + + int nRet = mmi_primitive_value_create_array(&g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_array", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_array"); + + nRet = mmi_primitive_value_create_int(nSource[0], &g_hArrayElement1); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hArrayElement1,"mmi_primitive_value_create_int"); + + nRet = mmi_primitive_value_create_int(nSource[1], &g_hArrayElement2); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hArrayElement2,"mmi_primitive_value_create_int"); + + nRet = mmi_primitive_value_add_array_element(g_hPrimitiveValue, g_hArrayElement1); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_add_array_element", MmiGetError(nRet)); + g_hArrayElement1 = NULL; + + nRet = mmi_primitive_value_add_array_element(g_hPrimitiveValue, g_hArrayElement2); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_add_array_element", MmiGetError(nRet)); + g_hArrayElement2 = NULL; + + nRet = mmi_primitive_value_get_array_count(g_hPrimitiveValue, &count); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_array_count", MmiGetError(nRet)); + CHECK_GET_VALUE(count, 2, "mmi_primitive_value_get_array_count"); + + for (size_t i = 0; i < count; i++) + { + mmi_primitive_value_h hElement = NULL; + + //Target API + nRet = mmi_primitive_value_get_array_element(g_hPrimitiveValue, i, &hElement); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_array_element", MmiGetError(nRet)); + CHECK_HANDLE(hElement,"mmi_primitive_value_get_array_element"); + + mmi_primitive_value_type_e type = MMI_PRIMITIVE_VALUE_TYPE_BOOL; + nRet = mmi_primitive_value_get_type(hElement, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_PRIMITIVE_VALUE_TYPE_INT, "mmi_primitive_value_get_type"); + + int nData = 0; + nRet = mmi_primitive_value_get_int(hElement, &nData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_int", MmiGetError(nRet)); + CHECK_GET_VALUE(nData, nSource[i], "mmi_primitive_value_get_int"); + } + return 0; +} + + +//& purpose: Test primitive value clone and destroy APIs +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_clone_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value clone and destroy APIs +* @apicovered mmi_primitive_value_clone and mmi_primitive_value_cdestroy +* @passcase When mmi_primitive_value_clone and mmi_primitive_value_cdestroy pass +* @failcase When mmi_primitive_value_clone and mmi_primitive_value_cdestroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_clone_destroy_p(void) +{ + START_TEST; + + int nSourceValue = 0; + mmi_primitive_value_h hClonedValue = NULL; + mmi_primitive_value_type_e type = MMI_PRIMITIVE_VALUE_TYPE_BOOL; + + int nRet = mmi_primitive_value_create_int(nSourceValue, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + //Target API + nRet = mmi_primitive_value_clone(g_hPrimitiveValue, &hClonedValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_clone", MmiGetError(nRet)); + CHECK_HANDLE(hClonedValue,"mmi_primitive_value_clone"); + + + nRet = mmi_primitive_value_get_type(hClonedValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_PRIMITIVE_VALUE_TYPE_INT, "mmi_primitive_value_get_type"); + + int nData = 0; + nRet = mmi_primitive_value_get_int(hClonedValue, &nData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_int", MmiGetError(nRet)); + CHECK_GET_VALUE(nData, nSourceValue, "mmi_primitive_value_get_int"); + + //Target API + nRet = mmi_primitive_value_destroy(hClonedValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test primitive value to bytes and from bytes APIs +//& type : auto +/** +* @testcase ITc_mmi_primitive_value_to_from_bytes_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call primitive value to bytes and from bytes APIs +* @apicovered mmi_primitive_value_to_bytes and mmi_primitive_value_from_bytes +* @passcase When mmi_primitive_value_to_bytes and mmi_primitive_value_from_bytes pass +* @failcase When mmi_primitive_value_to_bytes or mmi_primitive_value_from_bytes fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_primitive_value_to_from_bytes_p(void) +{ + START_TEST; + + int nSourceValue = 3; + unsigned char *pBytes = NULL; + size_t length = 0; + mmi_primitive_value_h hRestoredValue = NULL; + + int nRet = mmi_primitive_value_create_int(nSourceValue, &g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(g_hPrimitiveValue,"mmi_primitive_value_create_int"); + + //Target API + nRet = mmi_primitive_value_to_bytes(g_hPrimitiveValue, &pBytes, &length); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_to_bytes", MmiGetError(nRet)); + CHECK_HANDLE(pBytes,"mmi_primitive_value_to_bytes"); + + nRet = mmi_primitive_value_destroy(g_hPrimitiveValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + g_hPrimitiveValue = NULL; + + //Target API + nRet = mmi_primitive_value_from_bytes(pBytes, length, &hRestoredValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_from_bytes", MmiGetError(nRet)); + CHECK_HANDLE(hRestoredValue,"mmi_primitive_value_from_bytes"); + free(pBytes); + + mmi_primitive_value_type_e type = MMI_PRIMITIVE_VALUE_TYPE_BOOL; + nRet = mmi_primitive_value_get_type(hRestoredValue, &type); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_type", MmiGetError(nRet)); + CHECK_GET_VALUE(type, MMI_PRIMITIVE_VALUE_TYPE_INT, "mmi_primitive_value_get_type"); + + int nData = 0; + nRet = mmi_primitive_value_get_int(hRestoredValue, &nData); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_get_int", MmiGetError(nRet)); + CHECK_GET_VALUE(nData, nSourceValue, "mmi_primitive_value_get_int"); + + nRet = mmi_primitive_value_destroy(hRestoredValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test Create, Clone and Destroy mmi signal parameter handle APIs +//& type : auto +/** +* @testcase ITc_mmi_signal_parameter_create_clone_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call Create, Clone and Destroy mmi signal handle APIs +* @apicovered mmi_signal_parameter_create, mmi_signal_parameter_clone and mmi_signal_parameter_destroy +* @passcase When mmi_signal_parameter_create, mmi_signal_parameter_clone and mmi_signal_parameter_destroy pass +* @failcase When mmi_signal_parameter_create or mmi_signal_parameter_clone or mmi_signal_parameter_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_signal_parameter_create_clone_destroy_p(void) +{ + START_TEST; + mmi_signal_parameter_h hParameter = NULL; + mmi_primitive_value_h hValue = NULL; + mmi_signal_parameter_h hCloned = NULL; + + int nRet = mmi_primitive_value_create_int(0, &hValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(hValue,"mmi_primitive_value_create_int"); + + //Target API + nRet = mmi_signal_parameter_create(hValue, "signal", &hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_create", MmiGetError(nRet)); + CHECK_HANDLE(hParameter,"mmi_signal_parameter_create"); + + //Target API + nRet = mmi_signal_parameter_clone(hParameter, &hCloned); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_clone", MmiGetError(nRet), mmi_primitive_value_destroy(hValue)); + CHECK_HANDLE_CLEANUP(hCloned,"mmi_signal_parameter_clone", mmi_primitive_value_destroy(hValue)); + + nRet = mmi_primitive_value_destroy(hValue); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet), mmi_signal_parameter_destroy(hParameter)); + + //Target API + nRet = mmi_signal_parameter_destroy(hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test mmi signal papameters get name and value APIs +//& type : auto +/** +* @testcase ITc_mmi_signal_parameter_get_name_value_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create mmi signal handle API the mmi signal get name and value APIs +* @apicovered mmi_signal_parameter_get_name and mmi_signal_parameter_get_value +* @passcase When mmi_signal_parameter_get_name and mmi_signal_parameter_get_value pass +* @failcase When mmi_signal_parameter_get_name or mmi_signal_parameter_get_value fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_signal_parameter_get_name_value_p(void) +{ + START_TEST; + mmi_signal_parameter_h hParameter = NULL; + mmi_primitive_value_h hValue = NULL; + char *pGetName = NULL; + mmi_primitive_value_h hValueRetrieved = NULL; + + int nRet = mmi_primitive_value_create_int(0, &hValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(hValue,"mmi_primitive_value_create_int"); + + nRet = mmi_signal_parameter_create(hValue, "signal", &hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_create", MmiGetError(nRet)); + CHECK_HANDLE(hParameter,"mmi_signal_parameter_create"); + + //Target API + nRet = mmi_signal_parameter_get_name(hParameter, &pGetName); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_get_name", MmiGetError(nRet), mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + CHECK_HANDLE_CLEANUP(pGetName,"mmi_signal_parameter_get_name", mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_signal_parameter_get_value(hParameter, &hValueRetrieved); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_get_value", MmiGetError(nRet), mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + CHECK_HANDLE_CLEANUP(hValueRetrieved,"mmi_signal_parameter_get_value", mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_primitive_value_destroy(hValue); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet), mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_signal_parameter_destroy(hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test Create and Destroy mmi signal handle APIs +//& type : auto +/** +* @testcase ITc_mmi_signal_create_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call Create and Destroy mmi signal handle APIs +* @apicovered mmi_signal_create and mmi_signal_destroy +* @passcase When mmi_signal_create and mmi_signal_destroy pass +* @failcase When mmi_signal_create or mmi_signal_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_signal_create_destroy_p(void) +{ + START_TEST; + + mmi_signal_h handle = NULL; + //Target API + int nRet = mmi_signal_create("signal", &handle); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_create", MmiGetError(nRet)); + CHECK_HANDLE(handle,"mmi_signal_create"); + + //Target API + nRet = mmi_signal_destroy(handle); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test mmi signal add parameter API +//& type : auto +/** +* @testcase ITc_mmi_signal_add_parameter_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call mmi signal add parameter API +* @apicovered mmi_signal_add_parameter +* @passcase When mmi_signal_add_parameter pass +* @failcase When mmi_signal_add_parameter fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_signal_add_parameter_p(void) +{ + START_TEST; + + mmi_signal_h handle = NULL; + mmi_signal_parameter_h hParameter = NULL; + mmi_primitive_value_h hValue = NULL; + + int nRet = mmi_primitive_value_create_int(0, &hValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(hValue,"mmi_primitive_value_create_int"); + + nRet = mmi_signal_parameter_create(hValue, "signal", &hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_create", MmiGetError(nRet)); + CHECK_HANDLE(hParameter,"mmi_signal_parameter_create"); + + nRet = mmi_signal_create("signal", &handle); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_create", MmiGetError(nRet), mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + CHECK_HANDLE_CLEANUP(handle,"mmi_signal_create", mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + //Target API + nRet = mmi_signal_add_parameter(handle, hParameter); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_add_parameter", MmiGetError(nRet), mmi_signal_destroy(handle); mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_signal_destroy(handle); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_destroy", MmiGetError(nRet), mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_primitive_value_destroy(hValue); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet), mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_signal_parameter_destroy(hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test mmi signal get name API +//& type : auto +/** +* @testcase ITc_mmi_signal_get_name_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call mmi signal get name APIs +* @apicovered mmi_signal_create and mmi_signal_destroy +* @passcase When mmi_signal_create and mmi_signal_destroy pass +* @failcase When mmi_signal_create or mmi_signal_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_signal_get_name_p(void) +{ + START_TEST; + + mmi_signal_h handle = NULL; + char *pGetName = NULL; + + int nRet = mmi_signal_create("signal", &handle); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_create", MmiGetError(nRet)); + CHECK_HANDLE(handle,"mmi_signal_create"); + + //Target API + nRet = mmi_signal_get_name(handle, &pGetName); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_get_name", MmiGetError(nRet), mmi_signal_destroy(handle)); + CHECK_HANDLE_CLEANUP(pGetName,"mmi_signal_get_name", mmi_signal_destroy(handle)); + + nRet = mmi_signal_destroy(handle); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test mmi signal get parameter and get parameter count APIs +//& type : auto +/** +* @testcase ITc_mmi_signal_get_parameter_get_parameter_count_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call mmi signal get parameter and get parameter count APIs +* @apicovered mmi_signal_get_parameter and mmi_signal_get_parameter_count +* @passcase When mmi_signal_get_parameter and mmi_signal_get_parameter_count pass +* @failcase When mmi_signal_get_parameter or mmi_signal_get_parameter_count fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_signal_get_parameter_get_parameter_count_p(void) +{ + START_TEST; + + mmi_signal_h handle = NULL; + mmi_signal_parameter_h hParameter = NULL; + mmi_primitive_value_h hValue = NULL; + mmi_signal_parameter_h hGetretrieved = NULL; + int nCount = -1; + + int nRet = mmi_primitive_value_create_int(0, &hValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_primitive_value_create_int", MmiGetError(nRet)); + CHECK_HANDLE(hValue,"mmi_primitive_value_create_int"); + + nRet = mmi_signal_parameter_create(hValue, "signal", &hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_create", MmiGetError(nRet)); + CHECK_HANDLE(hParameter,"mmi_signal_parameter_create"); + + nRet = mmi_signal_create("signal", &handle); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_create", MmiGetError(nRet), mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + CHECK_HANDLE_CLEANUP(handle,"mmi_signal_create", mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_signal_add_parameter(handle, hParameter); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_add_parameter", MmiGetError(nRet), mmi_signal_destroy(handle); mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + //Target API + nRet = mmi_signal_get_parameter(handle, 0, &hGetretrieved); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_get_parameter", MmiGetError(nRet), mmi_signal_destroy(handle); mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + CHECK_HANDLE_CLEANUP(hGetretrieved,"mmi_signal_get_parameter", mmi_signal_destroy(handle); mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + //Target API + nRet = mmi_signal_get_parameter_count(handle, &nCount); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_get_parameter_count", MmiGetError(nRet), mmi_signal_destroy(handle); mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + CHECK_GET_VALUE(nCount, 1, "mmi_signal_get_parameter_count"); + + nRet = mmi_signal_destroy(handle); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_signal_destroy", MmiGetError(nRet), mmi_primitive_value_destroy(hValue); mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_primitive_value_destroy(hValue); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_primitive_value_destroy", MmiGetError(nRet), mmi_signal_parameter_destroy(hParameter)); + + nRet = mmi_signal_parameter_destroy(hParameter); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_signal_parameter_destroy", MmiGetError(nRet)); + + return 0; +} + + + +//& purpose: Test create source and get same source type APIs +//& type : auto +/** +* @testcase ITc_mmi_node_create_source_get_source_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create source and get same source type APIs +* @apicovered mmi_node_create_source and mmi_node_get_source_type +* @passcase When mmi_node_create_source and mmi_node_get_source_type pass +* @failcase When mmi_node_create_source or mmi_node_get_source_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_create_source_get_source_type_p(void) +{ + START_TEST; + + mmi_node_h hNode = NULL; + mmi_node_source_type_e type; + + int nRet = -1; + mmi_node_source_type_e eSourceType[] = {MMI_NODE_SOURCE_TYPE_NONE,MMI_NODE_SOURCE_TYPE_SCREEN_ANALYZER}; + int nEnumSize = sizeof(eSourceType) / sizeof(eSourceType[0]); + + for(int nEnumCounter = 0 ; nEnumCounter < nEnumSize; nEnumCounter++) + { + //Target API + nRet = mmi_node_create_source(eSourceType[nEnumCounter], &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_source", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_source"); + + //Target API + nRet = mmi_node_get_source_type(hNode, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_source_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_GET_VALUE(type, eSourceType[nEnumCounter], "mmi_node_get_source_type"); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + } + + return 0; +} + +//& purpose: Test create node processor and get same processor type APIs +//& type : auto +/** +* @testcase ITc_mmi_node_create_processor_get_processor_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create node processor and get same processor type APIs +* @apicovered mmi_node_create_processor and mmi_node_get_processor_type +* @passcase When mmi_node_create_processor and mmi_node_get_processor_type pass +* @failcase When mmi_node_create_processor or mmi_node_get_processor_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_create_processor_get_processor_type_p(void) +{ + START_TEST; + + mmi_node_h hNode = NULL; + mmi_node_processor_type_e type; + //Target API + int nRet = mmi_node_create_processor(MMI_NODE_PROCESSOR_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_processor", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_processor"); + + //Target API + nRet = mmi_node_get_processor_type(hNode, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_processor_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_GET_VALUE(type, MMI_NODE_PROCESSOR_TYPE_NONE, "mmi_node_get_processor_type"); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test create node logic handle and get same handle type APIs +//& type : auto +/** +* @testcase ITc_mmi_node_create_logic_get_logic_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call Test create node logic handle and get same handle type APIs +* @apicovered mmi_node_create_logic and mmi_node_get_logic_type +* @passcase When mmi_node_create_processor and mmi_node_get_processor_type pass +* @failcase When mmi_node_create_processor or mmi_node_get_processor_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_create_logic_get_logic_type_p(void) +{ + START_TEST; + + mmi_node_h hNode = NULL; + mmi_node_logic_type_e type; + int nRet = -1; + mmi_node_logic_type_e eLogicType[] = {MMI_NODE_LOGIC_TYPE_FIXED_STRING_MATCH,MMI_NODE_LOGIC_TYPE_NONE}; + int nEnumSize = sizeof(eLogicType) / sizeof(eLogicType[0]); + + for(int nEnumCounter = 0 ; nEnumCounter < nEnumSize; nEnumCounter++) + { + //Target API + nRet = mmi_node_create_logic(eLogicType[nEnumCounter], &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_logic", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_logic"); + + //Target API + nRet = mmi_node_get_logic_type(hNode, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_logic_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_GET_VALUE(type, eLogicType[nEnumCounter], "mmi_node_get_logic_type"); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + } + + return 0; +} + +//& purpose: Test create node controller handle and get same handle type APIs +//& type : auto +/** +* @testcase ITc_mmi_node_create_controller_get_controller_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create node controller handle and get same handle type APIs +* @apicovered mmi_node_create_controller and mmi_node_get_logic_controller +* @passcase When mmi_node_create_controller and mmi_node_get_logic_controller pass +* @failcase When mmi_node_create_controller or mmi_node_get_logic_controller fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_create_controller_get_controller_type_p(void) +{ + START_TEST; + + mmi_node_h hNode = NULL; + mmi_node_controller_type_e type; + //Target API + int nRet = mmi_node_create_controller(MMI_NODE_CONTROLLER_TYPE_NONE, &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_controller", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_controller"); + + //Target API + nRet = mmi_node_get_controller_type(hNode, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_controller_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_GET_VALUE(type, MMI_NODE_LOGIC_TYPE_NONE, "mmi_node_get_controller_type"); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test create node action handle and get same handle type APIs +//& type : auto +/** +* @testcase ITc_mmi_node_create_action_get_action_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call create node action handle and get same handle type APIs +* @apicovered mmi_node_create_action and mmi_node_get_action_type +* @passcase When mmi_node_create_action and mmi_node_get_action_type pass +* @failcase When mmi_node_create_action or mmi_node_get_action_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_create_action_get_action_type_p(void) +{ + START_TEST; + + mmi_node_h hNode = NULL; + int nRet = -1; + mmi_node_action_type_e eActionType[] = {MMI_NODE_ACTION_TYPE_NONE,MMI_NODE_ACTION_TYPE_MOUSE_EVENT,MMI_NODE_ACTION_TYPE_KEY_EVENT}; + int nEnumSize = sizeof(eActionType) / sizeof(eActionType[0]); + mmi_node_action_type_e type; + + for(int nEnumCounter = 0 ; nEnumCounter < nEnumSize; nEnumCounter++) + { + //Target API + nRet = mmi_node_create_action(eActionType[nEnumCounter], &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_action", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_action"); + + //Target API + nRet = mmi_node_get_action_type(hNode, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_action_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + CHECK_GET_VALUE(type, eActionType[nEnumCounter], "mmi_node_get_action_type"); + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + } + + return 0; +} + + + +//& purpose: Test create node custom handle and get same handle type APIs +//& type : auto +/** +* @testcase ITc_mmi_node_create_custom_get_custom_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario create node custom handle and get same handle type APIs +* @apicovered mmi_node_create_custom and mmi_node_get_action_type +* @passcase When mmi_node_create_custom and mmi_node_get_action_type pass +* @failcase When mmi_node_create_custom or mmi_node_get_action_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_node_create_custom_get_custom_type_p(void) +{ + START_TEST; + + mmi_node_h hNode = NULL; + const char *pCustomTypeId = NULL; + + //Target API + int nRet = mmi_node_create_custom("custom", &hNode); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_node_create_custom", MmiGetError(nRet)); + CHECK_HANDLE(hNode,"mmi_node_create_custom"); + + //Target API + nRet = mmi_node_get_custom_type(hNode, &pCustomTypeId); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_node_get_custom_type", MmiGetError(nRet), mmi_node_destroy(hNode)); + if (strcmp(pCustomTypeId, "custom") != 0) + { + FPRINTF("[Line : %d][%s] mmi_node_get_custom_type failed. Wrong custom type node is received\\n", __LINE__, API_NAMESPACE); + return 1; + } + + nRet = mmi_node_destroy(hNode); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_node_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test MMi port create, clone and Destroy APIs +//& type : auto +/** +* @testcase ITc_mmi_port_create_clone_destroy_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call MMi port create, clone and Destroy APIs +* @apicovered mmi_port_create, mmi_port_clone and mmi_port_destroy +* @passcase When mmi_port_create, mmi_port_clone and mmi_port_destroy pass +* @failcase When mmi_port_create or mmi_port_clone or mmi_port_destroy fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_port_create_clone_destroy_p(void) +{ + START_TEST; + mmi_port_h hPort = NULL; + mmi_port_h hCloned = NULL; + + //Target API + int nRet = mmi_port_create(&hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet)); + CHECK_HANDLE(hPort,"mmi_port_create"); + + //Target API + nRet = mmi_port_clone(hPort, &hCloned); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_clone", MmiGetError(nRet), mmi_port_destroy(hPort)); + CHECK_HANDLE_CLEANUP(hCloned,"mmi_port_clone", mmi_port_destroy(hPort)); + + //Target API + nRet = mmi_port_destroy(hCloned); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_destroy", MmiGetError(nRet)); + + //Target API + nRet = mmi_port_destroy(hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test MMi port set name and get name APIs +//& type : auto +/** +* @testcase ITc_mmi_port_set_get_name_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call MMi port set and get name APIs +* @apicovered mmi_port_set_name and mmi_port_get_name +* @passcase When mmi_port_set_name and mmi_port_get_name pass +* @failcase When mmi_port_set_name or mmi_port_get_name fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_port_set_get_name_p(void) +{ + START_TEST; + mmi_port_h hPort = NULL; + char *pName = NULL; + size_t length = -1; + + int nRet = mmi_port_create(&hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet)); + CHECK_HANDLE(hPort,"mmi_port_create"); + + //Target API + nRet = mmi_port_set_name(hPort, "TestPort"); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_set_name", MmiGetError(nRet), mmi_port_destroy(hPort)); + + //Target API + nRet = mmi_port_get_name(hPort, &pName, &length); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_get_name", MmiGetError(nRet), mmi_port_destroy(hPort)); + CHECK_HANDLE_CLEANUP(hPort,"mmi_port_create", mmi_port_destroy(hPort)); + if (strcmp("TestPort", pName) != 0) + { + FPRINTF("[Line : %d][%s] mmi_port_get_name failed. Set and Get values mismatch\\n", __LINE__, API_NAMESPACE); + mmi_port_destroy(hPort); + return 1; + } + + nRet = mmi_port_destroy(hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_destroy", MmiGetError(nRet)); + + return 0; +} + + +//& purpose: Test MMi port set type and get type APIs +//& type : auto +/** +* @testcase ITc_mmi_port_set_get_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call MMi port set type and get type APIs +* @apicovered mmi_port_set_type and mmi_port_get_type +* @passcase When mmi_port_set_type and mmi_port_get_type pass +* @failcase When mmi_port_set_type or mmi_port_get_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_port_set_get_type_p(void) +{ + START_TEST; + mmi_port_h hPort = NULL; + mmi_port_type_e type; + + int nRet = mmi_port_create(&hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet)); + CHECK_HANDLE(hPort,"mmi_port_create"); + + //Target API + nRet = mmi_port_set_type(hPort, MMI_PORT_TYPE_IN); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_set_type", MmiGetError(nRet), mmi_port_destroy(hPort)); + + //Target API + nRet = mmi_port_get_type(hPort, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_get_type", MmiGetError(nRet), mmi_port_destroy(hPort)); + CHECK_GET_VALUE(type, MMI_PORT_TYPE_IN, "mmi_port_get_type"); + + nRet = mmi_port_destroy(hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test MMi port set data type and get data type APIs +//& type : auto +/** +* @testcase ITc_mmi_port_set_get_data_type_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call MMi port set data type and get data type APIs +* @apicovered mmi_port_set_data_type and mmi_port_get_data_type +* @passcase When mmi_port_set_data_type and mmi_port_get_data_type pass +* @failcase When mmi_port_set_data_type and mmi_port_get_data_type fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_port_set_get_data_type_p(void) +{ + START_TEST; + mmi_port_h hPort = NULL; + mmi_data_type_e type; + + int nRet = mmi_port_create(&hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet)); + CHECK_HANDLE(hPort,"mmi_port_create"); + + //Target API + nRet = mmi_port_set_data_type(hPort, MMI_DATA_TYPE_INTEGER); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_set_data_type", MmiGetError(nRet), mmi_port_destroy(hPort)); + + //Target API + nRet = mmi_port_get_data_type(hPort, &type); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_get_data_type", MmiGetError(nRet), mmi_port_destroy(hPort)); + CHECK_GET_VALUE(type, MMI_DATA_TYPE_INTEGER, "mmi_port_get_data_type"); + + nRet = mmi_port_destroy(hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test MMi port set input receive data callback APIs +//& type : auto +/** +* @testcase ITc_mmi_port_set_input_data_received_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call MMi port set input receive data callback APIs +* @apicovered mmi_port_set_input_data_received_cb +* @passcase When mmi_port_set_input_data_received_cb pass +* @failcase When mmi_port_set_input_data_received_cb fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_port_set_input_data_received_cb_p(void) +{ + START_TEST; + mmi_port_h hPort = NULL; + + int nRet = mmi_port_create(&hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_create", MmiGetError(nRet)); + CHECK_HANDLE(hPort,"mmi_port_create"); + + //Target API + nRet = mmi_port_set_input_data_received_cb(hPort, MMi_port_input_data_received_cb, NULL); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_set_input_data_received_cb", MmiGetError(nRet), mmi_port_destroy(hPort)); + + nRet = mmi_port_destroy(hPort); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_port_destroy", MmiGetError(nRet)); + + return 0; +} + +//& purpose: Test MMi port generate output API +//& type : auto +/** +* @testcase ITc_mmi_port_instance_generate_output_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Call MMi port generate output API +* @apicovered mmi_port_instance_generate_output +* @passcase When mmi_port_instance_generate_output pass +* @failcase When mmi_port_instance_generate_output fail +* @precondition NA +* @postcondition NA +*/ +int ITc_mmi_port_instance_generate_output_p(void) +{ + START_TEST; + mmi_data_h hTempValue = NULL; + + int nRet = mmi_data_create_int(0, &hTempValue); + PRINT_RESULT(MMI_ERROR_NONE, nRet, "mmi_data_create_int", MmiGetError(nRet)); + CHECK_HANDLE(hTempValue,"mmi_data_create_int"); + + //Target API + nRet = mmi_port_instance_generate_output((mmi_port_instance_h)0x1234, hTempValue); + PRINT_RESULT_CLEANUP(MMI_ERROR_NONE, nRet, "mmi_port_instance_generate_output", MmiGetError(nRet), mmi_data_destroy(hTempValue)); + + nRet = mmi_data_destroy(hTempValue); + PRINT_RESULT_NORETURN(MMI_ERROR_NONE, nRet, "mmi_data_destroy", MmiGetError(nRet)); + + return 0; +} +/** @} */ +/** @} */ diff --git a/src/itc/mmi/tct-mmi-native.c b/src/itc/mmi/tct-mmi-native.c new file mode 100755 index 000000000..0d8bbc764 --- /dev/null +++ b/src/itc/mmi/tct-mmi-native.c @@ -0,0 +1,143 @@ +// +// Copyright (c) 2024 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 MOBILE //Starts MOBILE +#include "tct-mmi-native_mobile.h" +#endif //MOBILE //End MOBILE + +#ifdef WEARABLE //Starts WEARABLE +#include "tct-mmi-native_wearable.h" +#endif //WEARABLE //End WEARABLE + +#ifdef TV //Starts TV +#include "tct-mmi-native_tv.h" +#endif //TV //End TV + +#ifdef TIZENIOT //Starts TIZENIOT +#include "tct-mmi-native_tizeniot.h" +#endif //TIZENIOT //End TIZENIOT + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +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/mmi/tct-mmi-native_mobile.h b/src/itc/mmi/tct-mmi-native_mobile.h new file mode 100755 index 000000000..a5cbadfa7 --- /dev/null +++ b/src/itc/mmi/tct-mmi-native_mobile.h @@ -0,0 +1,188 @@ +// +// Copyright (c) 2024 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_MMI_NATIVE_H__ +#define __TCT_MMI_NATIVE_H__ + +#include "testcase.h" +#include "tct_common.h" + +extern void ITs_mmi_startup(void); +extern void ITs_mmi_cleanup(void); + +extern void ITs_mmi_startup(void); +extern void ITs_mmi_cleanup(void); + +extern int ITc_mmi_initialize_deinitialize_p(void); +extern int ITc_mmi_set_unset_state_changed_cb_p(void); +extern int ITc_mmi_standard_custom_workflow_instance_create_destroy_p(void); +extern int ITc_mmi_workflow_instance_activate_deactivate_p(void); +extern int ITc_mmi_workflow_instance_set_attribute_p(void); +extern int ITc_mmi_workflow_instance_emit_signal_p(void); +extern int ITc_mmi_workflow_instance_set_output_cb_p(void); +extern int ITc_mmi_workflow_create_destroy_p(void); +extern int ITc_mmi_workflow_set_get_type_p(void); +extern int ITc_mmi_workflow_node_add_link_nodes_by_names_p(void); +extern int ITc_mmi_workflow_attribute_assign_p(void); +extern int ITc_mmi_workflow_attribute_set_default_value_p(void); +extern int ITc_mmi_workflow_signal_assign_p(void); +extern int ITc_mmi_workflow_output_assign_assignbyport_p(void); +extern int ITc_mmi_standard_workflow_register_p(void); +extern int ITc_mmi_workflow_clone_p(void); +extern int ITc_mmi_workflow_create_from_script_p(void); +extern int ITc_mmi_node_set_initialized_deinitialized_cb_p(void); +extern int ITc_mmi_node_set_attribute_set_cb_p(void); +extern int ITc_mmi_node_set_activated_deactivated_cb_p(void); +extern int ITc_mmi_node_set_signal_received_cb_p(void); +extern int ITc_mmi_node_add_find_port_p(void); +extern int ITc_mmi_node_get_type_get_port_count_p(void); +extern int ITc_mmi_node_get_port_p(void); +extern int ITc_mmi_node_register_clone_destroy_p(void); +extern int ITc_mmi_node_instance_set_attribute_p(void); +extern int ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p(void); +extern int ITc_mmi_node_instance_emit_signal_p(void); +extern int ITc_mmi_data_create_get_bool_p(void); +extern int ITc_mmi_data_create_get_int_p(void); +extern int ITc_mmi_data_create_get_float_p(void); +extern int ITc_mmi_data_create_get_text_p(void); +extern int ITc_mmi_data_create_get_audio_p(void); +extern int ITc_mmi_data_create_get_video_p(void); +extern int ITc_mmi_data_create_user_get_identification_p(void); +extern int ITc_mmi_data_create_get_coordinate_p(void); +extern int ITc_mmi_data_create_get_bounding_box_p(void); +extern int ITc_mmi_data_create_array_get_array_count_p(void); +extern int ITc_mmi_data_add_array_element_get_array_element_p(void); +extern int ITc_mmi_data_create_struct_destroy_p(void); +extern int ITc_mmi_data_set_get_struct_element_p(void); +extern int ITc_mmi_data_get_type_p(void); +extern int ITc_mmi_data_get_struct_count_element_name_element_value_p(void); +extern int ITc_mmi_data_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_destroy_p(void); +extern int ITc_mmi_attribute_set_get_name_p(void); +extern int ITc_mmi_attribute_get_value_p(void); +extern int ITc_mmi_attribute_clone_p(void); +extern int ITc_mmi_attribute_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_string_array_p(void); +extern int ITc_mmi_primitive_value_create_get_int_p(void); +extern int ITc_mmi_primitive_value_create_get_float_p(void); +extern int ITc_mmi_primitive_value_create_get_string_p(void); +extern int ITc_mmi_primitive_value_create_get_bool_p(void); +extern int ITc_mmi_primitive_value_create_array_add_element_get_array_count_p(void); +extern int ITc_mmi_primitive_value_get_type_p(void); +extern int ITc_mmi_primitive_value_get_array_element_p(void); +extern int ITc_mmi_primitive_value_clone_destroy_p(void); +extern int ITc_mmi_primitive_value_to_from_bytes_p(void); +extern int ITc_mmi_signal_parameter_create_clone_destroy_p(void); +extern int ITc_mmi_signal_parameter_get_name_value_p(void); +extern int ITc_mmi_signal_create_destroy_p(void); +extern int ITc_mmi_signal_add_parameter_p(void); +extern int ITc_mmi_signal_get_name_p(void); +extern int ITc_mmi_signal_get_parameter_get_parameter_count_p(void); +extern int ITc_mmi_node_create_source_get_source_type_p(void); +extern int ITc_mmi_node_create_processor_get_processor_type_p(void); +extern int ITc_mmi_node_create_logic_get_logic_type_p(void); +extern int ITc_mmi_node_create_controller_get_controller_type_p(void); +extern int ITc_mmi_node_create_action_get_action_type_p(void); +extern int ITc_mmi_node_create_custom_get_custom_type_p(void); +extern int ITc_mmi_port_create_clone_destroy_p(void); +extern int ITc_mmi_port_set_get_name_p(void); +extern int ITc_mmi_port_set_get_type_p(void); +extern int ITc_mmi_port_set_get_data_type_p(void); +extern int ITc_mmi_port_set_input_data_received_cb_p(void); +extern int ITc_mmi_port_instance_generate_output_p(void); + +testcase tc_array[] = { + {"ITc_mmi_initialize_deinitialize_p",ITc_mmi_initialize_deinitialize_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_set_unset_state_changed_cb_p",ITc_mmi_set_unset_state_changed_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_custom_workflow_instance_create_destroy_p",ITc_mmi_standard_custom_workflow_instance_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_activate_deactivate_p",ITc_mmi_workflow_instance_activate_deactivate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_attribute_p",ITc_mmi_workflow_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_emit_signal_p",ITc_mmi_workflow_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_output_cb_p",ITc_mmi_workflow_instance_set_output_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_destroy_p",ITc_mmi_workflow_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_set_get_type_p",ITc_mmi_workflow_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_node_add_link_nodes_by_names_p",ITc_mmi_workflow_node_add_link_nodes_by_names_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_assign_p",ITc_mmi_workflow_attribute_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_set_default_value_p",ITc_mmi_workflow_attribute_set_default_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_signal_assign_p",ITc_mmi_workflow_signal_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_output_assign_assignbyport_p",ITc_mmi_workflow_output_assign_assignbyport_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_workflow_register_p",ITc_mmi_standard_workflow_register_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_clone_p",ITc_mmi_workflow_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_from_script_p",ITc_mmi_workflow_create_from_script_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_initialized_deinitialized_cb_p",ITc_mmi_node_set_initialized_deinitialized_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_attribute_set_cb_p",ITc_mmi_node_set_attribute_set_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_activated_deactivated_cb_p",ITc_mmi_node_set_activated_deactivated_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_signal_received_cb_p",ITc_mmi_node_set_signal_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_add_find_port_p",ITc_mmi_node_add_find_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_type_get_port_count_p",ITc_mmi_node_get_type_get_port_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_port_p",ITc_mmi_node_get_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_register_clone_destroy_p",ITc_mmi_node_register_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_set_attribute_p",ITc_mmi_node_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p",ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_emit_signal_p",ITc_mmi_node_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bool_p",ITc_mmi_data_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_int_p",ITc_mmi_data_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_float_p",ITc_mmi_data_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_text_p",ITc_mmi_data_create_get_text_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_audio_p",ITc_mmi_data_create_get_audio_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_video_p",ITc_mmi_data_create_get_video_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_user_get_identification_p",ITc_mmi_data_create_user_get_identification_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_coordinate_p",ITc_mmi_data_create_get_coordinate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bounding_box_p",ITc_mmi_data_create_get_bounding_box_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_array_get_array_count_p",ITc_mmi_data_create_array_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_add_array_element_get_array_element_p",ITc_mmi_data_add_array_element_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_struct_destroy_p",ITc_mmi_data_create_struct_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_set_get_struct_element_p",ITc_mmi_data_set_get_struct_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_type_p",ITc_mmi_data_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_struct_count_element_name_element_value_p",ITc_mmi_data_get_struct_count_element_name_element_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_to_from_bytes_p",ITc_mmi_data_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_destroy_p",ITc_mmi_attribute_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_set_get_name_p",ITc_mmi_attribute_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_get_value_p",ITc_mmi_attribute_get_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_clone_p",ITc_mmi_attribute_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_to_from_bytes_p",ITc_mmi_attribute_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_string_array_p",ITc_mmi_attribute_create_string_array_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_int_p",ITc_mmi_primitive_value_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_float_p",ITc_mmi_primitive_value_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_string_p",ITc_mmi_primitive_value_create_get_string_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_bool_p",ITc_mmi_primitive_value_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_array_add_element_get_array_count_p",ITc_mmi_primitive_value_create_array_add_element_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_type_p",ITc_mmi_primitive_value_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_array_element_p",ITc_mmi_primitive_value_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_clone_destroy_p",ITc_mmi_primitive_value_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_to_from_bytes_p",ITc_mmi_primitive_value_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_create_clone_destroy_p",ITc_mmi_signal_parameter_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_get_name_value_p",ITc_mmi_signal_parameter_get_name_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_create_destroy_p",ITc_mmi_signal_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_add_parameter_p",ITc_mmi_signal_add_parameter_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_name_p",ITc_mmi_signal_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_parameter_get_parameter_count_p",ITc_mmi_signal_get_parameter_get_parameter_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_source_get_source_type_p",ITc_mmi_node_create_source_get_source_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_processor_get_processor_type_p",ITc_mmi_node_create_processor_get_processor_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_logic_get_logic_type_p",ITc_mmi_node_create_logic_get_logic_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_controller_get_controller_type_p",ITc_mmi_node_create_controller_get_controller_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_action_get_action_type_p",ITc_mmi_node_create_action_get_action_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_custom_get_custom_type_p",ITc_mmi_node_create_custom_get_custom_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_create_clone_destroy_p",ITc_mmi_port_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_name_p",ITc_mmi_port_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_type_p",ITc_mmi_port_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_data_type_p",ITc_mmi_port_set_get_data_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_input_data_received_cb_p",ITc_mmi_port_set_input_data_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_instance_generate_output_p",ITc_mmi_port_instance_generate_output_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {NULL, NULL} +}; + + +#endif // __TCT_MMI_NATIVE_H__ diff --git a/src/itc/mmi/tct-mmi-native_tizeniot.h b/src/itc/mmi/tct-mmi-native_tizeniot.h new file mode 100755 index 000000000..b2e3603cd --- /dev/null +++ b/src/itc/mmi/tct-mmi-native_tizeniot.h @@ -0,0 +1,184 @@ +// +// Copyright (c) 2024 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_MMI_NATIVE_H__ +#define __TCT_MMI_NATIVE_H__ + +#include "testcase.h" +#include "tct_common.h" + +extern void ITs_mmi_startup(void); +extern void ITs_mmi_cleanup(void); + +extern int ITc_mmi_initialize_deinitialize_p(void); +extern int ITc_mmi_set_unset_state_changed_cb_p(void); +extern int ITc_mmi_standard_custom_workflow_instance_create_destroy_p(void); +extern int ITc_mmi_workflow_instance_activate_deactivate_p(void); +extern int ITc_mmi_workflow_instance_set_attribute_p(void); +extern int ITc_mmi_workflow_instance_emit_signal_p(void); +extern int ITc_mmi_workflow_instance_set_output_cb_p(void); +extern int ITc_mmi_workflow_create_destroy_p(void); +extern int ITc_mmi_workflow_set_get_type_p(void); +extern int ITc_mmi_workflow_node_add_link_nodes_by_names_p(void); +extern int ITc_mmi_workflow_attribute_assign_p(void); +extern int ITc_mmi_workflow_attribute_set_default_value_p(void); +extern int ITc_mmi_workflow_signal_assign_p(void); +extern int ITc_mmi_workflow_output_assign_assignbyport_p(void); +extern int ITc_mmi_standard_workflow_register_p(void); +extern int ITc_mmi_workflow_clone_p(void); +extern int ITc_mmi_workflow_create_from_script_p(void); +extern int ITc_mmi_node_set_initialized_deinitialized_cb_p(void); +extern int ITc_mmi_node_set_attribute_set_cb_p(void); +extern int ITc_mmi_node_set_activated_deactivated_cb_p(void); +extern int ITc_mmi_node_set_signal_received_cb_p(void); +extern int ITc_mmi_node_add_find_port_p(void); +extern int ITc_mmi_node_get_type_get_port_count_p(void); +extern int ITc_mmi_node_get_port_p(void); +extern int ITc_mmi_node_register_clone_destroy_p(void); +extern int ITc_mmi_node_instance_set_attribute_p(void); +extern int ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p(void); +extern int ITc_mmi_node_instance_emit_signal_p(void); +extern int ITc_mmi_data_create_get_bool_p(void); +extern int ITc_mmi_data_create_get_int_p(void); +extern int ITc_mmi_data_create_get_float_p(void); +extern int ITc_mmi_data_create_get_text_p(void); +extern int ITc_mmi_data_create_get_audio_p(void); +extern int ITc_mmi_data_create_get_video_p(void); +extern int ITc_mmi_data_create_user_get_identification_p(void); +extern int ITc_mmi_data_create_get_coordinate_p(void); +extern int ITc_mmi_data_create_get_bounding_box_p(void); +extern int ITc_mmi_data_create_array_get_array_count_p(void); +extern int ITc_mmi_data_add_array_element_get_array_element_p(void); +extern int ITc_mmi_data_create_struct_destroy_p(void); +extern int ITc_mmi_data_set_get_struct_element_p(void); +extern int ITc_mmi_data_get_type_p(void); +extern int ITc_mmi_data_get_struct_count_element_name_element_value_p(void); +extern int ITc_mmi_data_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_destroy_p(void); +extern int ITc_mmi_attribute_set_get_name_p(void); +extern int ITc_mmi_attribute_get_value_p(void); +extern int ITc_mmi_attribute_clone_p(void); +extern int ITc_mmi_attribute_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_string_array_p(void); +extern int ITc_mmi_primitive_value_create_get_int_p(void); +extern int ITc_mmi_primitive_value_create_get_float_p(void); +extern int ITc_mmi_primitive_value_create_get_string_p(void); +extern int ITc_mmi_primitive_value_create_get_bool_p(void); +extern int ITc_mmi_primitive_value_create_array_add_element_get_array_count_p(void); +extern int ITc_mmi_primitive_value_get_type_p(void); +extern int ITc_mmi_primitive_value_get_array_element_p(void); +extern int ITc_mmi_primitive_value_clone_destroy_p(void); +extern int ITc_mmi_primitive_value_to_from_bytes_p(void); +extern int ITc_mmi_signal_parameter_create_clone_destroy_p(void); +extern int ITc_mmi_signal_parameter_get_name_value_p(void); +extern int ITc_mmi_signal_create_destroy_p(void); +extern int ITc_mmi_signal_add_parameter_p(void); +extern int ITc_mmi_signal_get_name_p(void); +extern int ITc_mmi_signal_get_parameter_get_parameter_count_p(void); +extern int ITc_mmi_node_create_source_get_source_type_p(void); +extern int ITc_mmi_node_create_processor_get_processor_type_p(void); +extern int ITc_mmi_node_create_logic_get_logic_type_p(void); +extern int ITc_mmi_node_create_controller_get_controller_type_p(void); +extern int ITc_mmi_node_create_action_get_action_type_p(void); +extern int ITc_mmi_node_create_custom_get_custom_type_p(void); +extern int ITc_mmi_port_create_clone_destroy_p(void); +extern int ITc_mmi_port_set_get_name_p(void); +extern int ITc_mmi_port_set_get_type_p(void); +extern int ITc_mmi_port_set_get_data_type_p(void); +extern int ITc_mmi_port_set_input_data_received_cb_p(void); +extern int ITc_mmi_port_instance_generate_output_p(void); + +testcase tc_array[] = { + {"ITc_mmi_initialize_deinitialize_p",ITc_mmi_initialize_deinitialize_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_set_unset_state_changed_cb_p",ITc_mmi_set_unset_state_changed_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_custom_workflow_instance_create_destroy_p",ITc_mmi_standard_custom_workflow_instance_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_activate_deactivate_p",ITc_mmi_workflow_instance_activate_deactivate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_attribute_p",ITc_mmi_workflow_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_emit_signal_p",ITc_mmi_workflow_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_output_cb_p",ITc_mmi_workflow_instance_set_output_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_destroy_p",ITc_mmi_workflow_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_set_get_type_p",ITc_mmi_workflow_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_node_add_link_nodes_by_names_p",ITc_mmi_workflow_node_add_link_nodes_by_names_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_assign_p",ITc_mmi_workflow_attribute_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_set_default_value_p",ITc_mmi_workflow_attribute_set_default_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_signal_assign_p",ITc_mmi_workflow_signal_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_output_assign_assignbyport_p",ITc_mmi_workflow_output_assign_assignbyport_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_workflow_register_p",ITc_mmi_standard_workflow_register_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_clone_p",ITc_mmi_workflow_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_from_script_p",ITc_mmi_workflow_create_from_script_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_initialized_deinitialized_cb_p",ITc_mmi_node_set_initialized_deinitialized_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_attribute_set_cb_p",ITc_mmi_node_set_attribute_set_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_activated_deactivated_cb_p",ITc_mmi_node_set_activated_deactivated_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_signal_received_cb_p",ITc_mmi_node_set_signal_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_add_find_port_p",ITc_mmi_node_add_find_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_type_get_port_count_p",ITc_mmi_node_get_type_get_port_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_port_p",ITc_mmi_node_get_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_register_clone_destroy_p",ITc_mmi_node_register_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_set_attribute_p",ITc_mmi_node_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p",ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_emit_signal_p",ITc_mmi_node_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bool_p",ITc_mmi_data_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_int_p",ITc_mmi_data_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_float_p",ITc_mmi_data_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_text_p",ITc_mmi_data_create_get_text_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_audio_p",ITc_mmi_data_create_get_audio_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_video_p",ITc_mmi_data_create_get_video_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_user_get_identification_p",ITc_mmi_data_create_user_get_identification_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_coordinate_p",ITc_mmi_data_create_get_coordinate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bounding_box_p",ITc_mmi_data_create_get_bounding_box_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_array_get_array_count_p",ITc_mmi_data_create_array_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_add_array_element_get_array_element_p",ITc_mmi_data_add_array_element_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_struct_destroy_p",ITc_mmi_data_create_struct_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_set_get_struct_element_p",ITc_mmi_data_set_get_struct_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_type_p",ITc_mmi_data_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_struct_count_element_name_element_value_p",ITc_mmi_data_get_struct_count_element_name_element_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_to_from_bytes_p",ITc_mmi_data_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_destroy_p",ITc_mmi_attribute_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_set_get_name_p",ITc_mmi_attribute_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_get_value_p",ITc_mmi_attribute_get_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_clone_p",ITc_mmi_attribute_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_to_from_bytes_p",ITc_mmi_attribute_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_string_array_p",ITc_mmi_attribute_create_string_array_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_int_p",ITc_mmi_primitive_value_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_float_p",ITc_mmi_primitive_value_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_string_p",ITc_mmi_primitive_value_create_get_string_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_bool_p",ITc_mmi_primitive_value_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_array_add_element_get_array_count_p",ITc_mmi_primitive_value_create_array_add_element_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_type_p",ITc_mmi_primitive_value_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_array_element_p",ITc_mmi_primitive_value_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_clone_destroy_p",ITc_mmi_primitive_value_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_to_from_bytes_p",ITc_mmi_primitive_value_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_create_clone_destroy_p",ITc_mmi_signal_parameter_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_get_name_value_p",ITc_mmi_signal_parameter_get_name_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_create_destroy_p",ITc_mmi_signal_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_add_parameter_p",ITc_mmi_signal_add_parameter_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_name_p",ITc_mmi_signal_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_parameter_get_parameter_count_p",ITc_mmi_signal_get_parameter_get_parameter_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_source_get_source_type_p",ITc_mmi_node_create_source_get_source_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_processor_get_processor_type_p",ITc_mmi_node_create_processor_get_processor_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_logic_get_logic_type_p",ITc_mmi_node_create_logic_get_logic_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_controller_get_controller_type_p",ITc_mmi_node_create_controller_get_controller_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_action_get_action_type_p",ITc_mmi_node_create_action_get_action_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_custom_get_custom_type_p",ITc_mmi_node_create_custom_get_custom_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_create_clone_destroy_p",ITc_mmi_port_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_name_p",ITc_mmi_port_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_type_p",ITc_mmi_port_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_data_type_p",ITc_mmi_port_set_get_data_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_input_data_received_cb_p",ITc_mmi_port_set_input_data_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_instance_generate_output_p",ITc_mmi_port_instance_generate_output_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {NULL, NULL} +}; + +#endif // __TCT_MMI_NATIVE_H__ diff --git a/src/itc/mmi/tct-mmi-native_tv.h b/src/itc/mmi/tct-mmi-native_tv.h new file mode 100755 index 000000000..e553a3708 --- /dev/null +++ b/src/itc/mmi/tct-mmi-native_tv.h @@ -0,0 +1,185 @@ +// +// Copyright (c) 2024 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_MMI_NATIVE_H__ +#define __TCT_MMI_NATIVE_H__ + +#include "testcase.h" +#include "tct_common.h" + +extern void ITs_mmi_startup(void); +extern void ITs_mmi_cleanup(void); + +extern int ITc_mmi_initialize_deinitialize_p(void); +extern int ITc_mmi_set_unset_state_changed_cb_p(void); +extern int ITc_mmi_standard_custom_workflow_instance_create_destroy_p(void); +extern int ITc_mmi_workflow_instance_activate_deactivate_p(void); +extern int ITc_mmi_workflow_instance_set_attribute_p(void); +extern int ITc_mmi_workflow_instance_emit_signal_p(void); +extern int ITc_mmi_workflow_instance_set_output_cb_p(void); +extern int ITc_mmi_workflow_create_destroy_p(void); +extern int ITc_mmi_workflow_set_get_type_p(void); +extern int ITc_mmi_workflow_node_add_link_nodes_by_names_p(void); +extern int ITc_mmi_workflow_attribute_assign_p(void); +extern int ITc_mmi_workflow_attribute_set_default_value_p(void); +extern int ITc_mmi_workflow_signal_assign_p(void); +extern int ITc_mmi_workflow_output_assign_assignbyport_p(void); +extern int ITc_mmi_standard_workflow_register_p(void); +extern int ITc_mmi_workflow_clone_p(void); +extern int ITc_mmi_workflow_create_from_script_p(void); +extern int ITc_mmi_node_set_initialized_deinitialized_cb_p(void); +extern int ITc_mmi_node_set_attribute_set_cb_p(void); +extern int ITc_mmi_node_set_activated_deactivated_cb_p(void); +extern int ITc_mmi_node_set_signal_received_cb_p(void); +extern int ITc_mmi_node_add_find_port_p(void); +extern int ITc_mmi_node_get_type_get_port_count_p(void); +extern int ITc_mmi_node_get_port_p(void); +extern int ITc_mmi_node_register_clone_destroy_p(void); +extern int ITc_mmi_node_instance_set_attribute_p(void); +extern int ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p(void); +extern int ITc_mmi_node_instance_emit_signal_p(void); +extern int ITc_mmi_data_create_get_bool_p(void); +extern int ITc_mmi_data_create_get_int_p(void); +extern int ITc_mmi_data_create_get_float_p(void); +extern int ITc_mmi_data_create_get_text_p(void); +extern int ITc_mmi_data_create_get_audio_p(void); +extern int ITc_mmi_data_create_get_video_p(void); +extern int ITc_mmi_data_create_user_get_identification_p(void); +extern int ITc_mmi_data_create_get_coordinate_p(void); +extern int ITc_mmi_data_create_get_bounding_box_p(void); +extern int ITc_mmi_data_create_array_get_array_count_p(void); +extern int ITc_mmi_data_add_array_element_get_array_element_p(void); +extern int ITc_mmi_data_create_struct_destroy_p(void); +extern int ITc_mmi_data_set_get_struct_element_p(void); +extern int ITc_mmi_data_get_type_p(void); +extern int ITc_mmi_data_get_struct_count_element_name_element_value_p(void); +extern int ITc_mmi_data_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_destroy_p(void); +extern int ITc_mmi_attribute_set_get_name_p(void); +extern int ITc_mmi_attribute_get_value_p(void); +extern int ITc_mmi_attribute_clone_p(void); +extern int ITc_mmi_attribute_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_string_array_p(void); +extern int ITc_mmi_primitive_value_create_get_int_p(void); +extern int ITc_mmi_primitive_value_create_get_float_p(void); +extern int ITc_mmi_primitive_value_create_get_string_p(void); +extern int ITc_mmi_primitive_value_create_get_bool_p(void); +extern int ITc_mmi_primitive_value_create_array_add_element_get_array_count_p(void); +extern int ITc_mmi_primitive_value_get_type_p(void); +extern int ITc_mmi_primitive_value_get_array_element_p(void); +extern int ITc_mmi_primitive_value_clone_destroy_p(void); +extern int ITc_mmi_primitive_value_to_from_bytes_p(void); +extern int ITc_mmi_signal_parameter_create_clone_destroy_p(void); +extern int ITc_mmi_signal_parameter_get_name_value_p(void); +extern int ITc_mmi_signal_create_destroy_p(void); +extern int ITc_mmi_signal_add_parameter_p(void); +extern int ITc_mmi_signal_get_name_p(void); +extern int ITc_mmi_signal_get_parameter_get_parameter_count_p(void); +extern int ITc_mmi_node_create_source_get_source_type_p(void); +extern int ITc_mmi_node_create_processor_get_processor_type_p(void); +extern int ITc_mmi_node_create_logic_get_logic_type_p(void); +extern int ITc_mmi_node_create_controller_get_controller_type_p(void); +extern int ITc_mmi_node_create_action_get_action_type_p(void); +extern int ITc_mmi_node_create_custom_get_custom_type_p(void); +extern int ITc_mmi_port_create_clone_destroy_p(void); +extern int ITc_mmi_port_set_get_name_p(void); +extern int ITc_mmi_port_set_get_type_p(void); +extern int ITc_mmi_port_set_get_data_type_p(void); +extern int ITc_mmi_port_set_input_data_received_cb_p(void); +extern int ITc_mmi_port_instance_generate_output_p(void); + +testcase tc_array[] = { + {"ITc_mmi_initialize_deinitialize_p",ITc_mmi_initialize_deinitialize_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_set_unset_state_changed_cb_p",ITc_mmi_set_unset_state_changed_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_custom_workflow_instance_create_destroy_p",ITc_mmi_standard_custom_workflow_instance_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_activate_deactivate_p",ITc_mmi_workflow_instance_activate_deactivate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_attribute_p",ITc_mmi_workflow_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_emit_signal_p",ITc_mmi_workflow_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_output_cb_p",ITc_mmi_workflow_instance_set_output_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_destroy_p",ITc_mmi_workflow_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_set_get_type_p",ITc_mmi_workflow_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_node_add_link_nodes_by_names_p",ITc_mmi_workflow_node_add_link_nodes_by_names_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_assign_p",ITc_mmi_workflow_attribute_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_set_default_value_p",ITc_mmi_workflow_attribute_set_default_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_signal_assign_p",ITc_mmi_workflow_signal_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_output_assign_assignbyport_p",ITc_mmi_workflow_output_assign_assignbyport_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_workflow_register_p",ITc_mmi_standard_workflow_register_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_clone_p",ITc_mmi_workflow_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_from_script_p",ITc_mmi_workflow_create_from_script_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_initialized_deinitialized_cb_p",ITc_mmi_node_set_initialized_deinitialized_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_attribute_set_cb_p",ITc_mmi_node_set_attribute_set_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_activated_deactivated_cb_p",ITc_mmi_node_set_activated_deactivated_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_signal_received_cb_p",ITc_mmi_node_set_signal_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_add_find_port_p",ITc_mmi_node_add_find_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_type_get_port_count_p",ITc_mmi_node_get_type_get_port_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_port_p",ITc_mmi_node_get_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_register_clone_destroy_p",ITc_mmi_node_register_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_set_attribute_p",ITc_mmi_node_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p",ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_emit_signal_p",ITc_mmi_node_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bool_p",ITc_mmi_data_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_int_p",ITc_mmi_data_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_float_p",ITc_mmi_data_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_text_p",ITc_mmi_data_create_get_text_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_audio_p",ITc_mmi_data_create_get_audio_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_video_p",ITc_mmi_data_create_get_video_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_user_get_identification_p",ITc_mmi_data_create_user_get_identification_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_coordinate_p",ITc_mmi_data_create_get_coordinate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bounding_box_p",ITc_mmi_data_create_get_bounding_box_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_array_get_array_count_p",ITc_mmi_data_create_array_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_add_array_element_get_array_element_p",ITc_mmi_data_add_array_element_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_struct_destroy_p",ITc_mmi_data_create_struct_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_set_get_struct_element_p",ITc_mmi_data_set_get_struct_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_type_p",ITc_mmi_data_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_struct_count_element_name_element_value_p",ITc_mmi_data_get_struct_count_element_name_element_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_to_from_bytes_p",ITc_mmi_data_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_destroy_p",ITc_mmi_attribute_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_set_get_name_p",ITc_mmi_attribute_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_get_value_p",ITc_mmi_attribute_get_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_clone_p",ITc_mmi_attribute_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_to_from_bytes_p",ITc_mmi_attribute_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_string_array_p",ITc_mmi_attribute_create_string_array_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_int_p",ITc_mmi_primitive_value_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_float_p",ITc_mmi_primitive_value_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_string_p",ITc_mmi_primitive_value_create_get_string_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_bool_p",ITc_mmi_primitive_value_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_array_add_element_get_array_count_p",ITc_mmi_primitive_value_create_array_add_element_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_type_p",ITc_mmi_primitive_value_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_array_element_p",ITc_mmi_primitive_value_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_clone_destroy_p",ITc_mmi_primitive_value_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_to_from_bytes_p",ITc_mmi_primitive_value_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_create_clone_destroy_p",ITc_mmi_signal_parameter_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_get_name_value_p",ITc_mmi_signal_parameter_get_name_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_create_destroy_p",ITc_mmi_signal_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_add_parameter_p",ITc_mmi_signal_add_parameter_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_name_p",ITc_mmi_signal_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_parameter_get_parameter_count_p",ITc_mmi_signal_get_parameter_get_parameter_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_source_get_source_type_p",ITc_mmi_node_create_source_get_source_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_processor_get_processor_type_p",ITc_mmi_node_create_processor_get_processor_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_logic_get_logic_type_p",ITc_mmi_node_create_logic_get_logic_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_controller_get_controller_type_p",ITc_mmi_node_create_controller_get_controller_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_action_get_action_type_p",ITc_mmi_node_create_action_get_action_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_custom_get_custom_type_p",ITc_mmi_node_create_custom_get_custom_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_create_clone_destroy_p",ITc_mmi_port_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_name_p",ITc_mmi_port_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_type_p",ITc_mmi_port_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_data_type_p",ITc_mmi_port_set_get_data_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_input_data_received_cb_p",ITc_mmi_port_set_input_data_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_instance_generate_output_p",ITc_mmi_port_instance_generate_output_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {NULL, NULL} +}; + + +#endif // __TCT_MMI_NATIVE_H__ diff --git a/src/itc/mmi/tct-mmi-native_wearable.h b/src/itc/mmi/tct-mmi-native_wearable.h new file mode 100755 index 000000000..b2e3603cd --- /dev/null +++ b/src/itc/mmi/tct-mmi-native_wearable.h @@ -0,0 +1,184 @@ +// +// Copyright (c) 2024 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_MMI_NATIVE_H__ +#define __TCT_MMI_NATIVE_H__ + +#include "testcase.h" +#include "tct_common.h" + +extern void ITs_mmi_startup(void); +extern void ITs_mmi_cleanup(void); + +extern int ITc_mmi_initialize_deinitialize_p(void); +extern int ITc_mmi_set_unset_state_changed_cb_p(void); +extern int ITc_mmi_standard_custom_workflow_instance_create_destroy_p(void); +extern int ITc_mmi_workflow_instance_activate_deactivate_p(void); +extern int ITc_mmi_workflow_instance_set_attribute_p(void); +extern int ITc_mmi_workflow_instance_emit_signal_p(void); +extern int ITc_mmi_workflow_instance_set_output_cb_p(void); +extern int ITc_mmi_workflow_create_destroy_p(void); +extern int ITc_mmi_workflow_set_get_type_p(void); +extern int ITc_mmi_workflow_node_add_link_nodes_by_names_p(void); +extern int ITc_mmi_workflow_attribute_assign_p(void); +extern int ITc_mmi_workflow_attribute_set_default_value_p(void); +extern int ITc_mmi_workflow_signal_assign_p(void); +extern int ITc_mmi_workflow_output_assign_assignbyport_p(void); +extern int ITc_mmi_standard_workflow_register_p(void); +extern int ITc_mmi_workflow_clone_p(void); +extern int ITc_mmi_workflow_create_from_script_p(void); +extern int ITc_mmi_node_set_initialized_deinitialized_cb_p(void); +extern int ITc_mmi_node_set_attribute_set_cb_p(void); +extern int ITc_mmi_node_set_activated_deactivated_cb_p(void); +extern int ITc_mmi_node_set_signal_received_cb_p(void); +extern int ITc_mmi_node_add_find_port_p(void); +extern int ITc_mmi_node_get_type_get_port_count_p(void); +extern int ITc_mmi_node_get_port_p(void); +extern int ITc_mmi_node_register_clone_destroy_p(void); +extern int ITc_mmi_node_instance_set_attribute_p(void); +extern int ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p(void); +extern int ITc_mmi_node_instance_emit_signal_p(void); +extern int ITc_mmi_data_create_get_bool_p(void); +extern int ITc_mmi_data_create_get_int_p(void); +extern int ITc_mmi_data_create_get_float_p(void); +extern int ITc_mmi_data_create_get_text_p(void); +extern int ITc_mmi_data_create_get_audio_p(void); +extern int ITc_mmi_data_create_get_video_p(void); +extern int ITc_mmi_data_create_user_get_identification_p(void); +extern int ITc_mmi_data_create_get_coordinate_p(void); +extern int ITc_mmi_data_create_get_bounding_box_p(void); +extern int ITc_mmi_data_create_array_get_array_count_p(void); +extern int ITc_mmi_data_add_array_element_get_array_element_p(void); +extern int ITc_mmi_data_create_struct_destroy_p(void); +extern int ITc_mmi_data_set_get_struct_element_p(void); +extern int ITc_mmi_data_get_type_p(void); +extern int ITc_mmi_data_get_struct_count_element_name_element_value_p(void); +extern int ITc_mmi_data_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_destroy_p(void); +extern int ITc_mmi_attribute_set_get_name_p(void); +extern int ITc_mmi_attribute_get_value_p(void); +extern int ITc_mmi_attribute_clone_p(void); +extern int ITc_mmi_attribute_to_from_bytes_p(void); +extern int ITc_mmi_attribute_create_string_array_p(void); +extern int ITc_mmi_primitive_value_create_get_int_p(void); +extern int ITc_mmi_primitive_value_create_get_float_p(void); +extern int ITc_mmi_primitive_value_create_get_string_p(void); +extern int ITc_mmi_primitive_value_create_get_bool_p(void); +extern int ITc_mmi_primitive_value_create_array_add_element_get_array_count_p(void); +extern int ITc_mmi_primitive_value_get_type_p(void); +extern int ITc_mmi_primitive_value_get_array_element_p(void); +extern int ITc_mmi_primitive_value_clone_destroy_p(void); +extern int ITc_mmi_primitive_value_to_from_bytes_p(void); +extern int ITc_mmi_signal_parameter_create_clone_destroy_p(void); +extern int ITc_mmi_signal_parameter_get_name_value_p(void); +extern int ITc_mmi_signal_create_destroy_p(void); +extern int ITc_mmi_signal_add_parameter_p(void); +extern int ITc_mmi_signal_get_name_p(void); +extern int ITc_mmi_signal_get_parameter_get_parameter_count_p(void); +extern int ITc_mmi_node_create_source_get_source_type_p(void); +extern int ITc_mmi_node_create_processor_get_processor_type_p(void); +extern int ITc_mmi_node_create_logic_get_logic_type_p(void); +extern int ITc_mmi_node_create_controller_get_controller_type_p(void); +extern int ITc_mmi_node_create_action_get_action_type_p(void); +extern int ITc_mmi_node_create_custom_get_custom_type_p(void); +extern int ITc_mmi_port_create_clone_destroy_p(void); +extern int ITc_mmi_port_set_get_name_p(void); +extern int ITc_mmi_port_set_get_type_p(void); +extern int ITc_mmi_port_set_get_data_type_p(void); +extern int ITc_mmi_port_set_input_data_received_cb_p(void); +extern int ITc_mmi_port_instance_generate_output_p(void); + +testcase tc_array[] = { + {"ITc_mmi_initialize_deinitialize_p",ITc_mmi_initialize_deinitialize_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_set_unset_state_changed_cb_p",ITc_mmi_set_unset_state_changed_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_custom_workflow_instance_create_destroy_p",ITc_mmi_standard_custom_workflow_instance_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_activate_deactivate_p",ITc_mmi_workflow_instance_activate_deactivate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_attribute_p",ITc_mmi_workflow_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_emit_signal_p",ITc_mmi_workflow_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_instance_set_output_cb_p",ITc_mmi_workflow_instance_set_output_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_destroy_p",ITc_mmi_workflow_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_set_get_type_p",ITc_mmi_workflow_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_node_add_link_nodes_by_names_p",ITc_mmi_workflow_node_add_link_nodes_by_names_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_assign_p",ITc_mmi_workflow_attribute_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_attribute_set_default_value_p",ITc_mmi_workflow_attribute_set_default_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_signal_assign_p",ITc_mmi_workflow_signal_assign_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_output_assign_assignbyport_p",ITc_mmi_workflow_output_assign_assignbyport_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_standard_workflow_register_p",ITc_mmi_standard_workflow_register_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_clone_p",ITc_mmi_workflow_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_workflow_create_from_script_p",ITc_mmi_workflow_create_from_script_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_initialized_deinitialized_cb_p",ITc_mmi_node_set_initialized_deinitialized_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_attribute_set_cb_p",ITc_mmi_node_set_attribute_set_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_activated_deactivated_cb_p",ITc_mmi_node_set_activated_deactivated_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_set_signal_received_cb_p",ITc_mmi_node_set_signal_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_add_find_port_p",ITc_mmi_node_add_find_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_type_get_port_count_p",ITc_mmi_node_get_type_get_port_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_get_port_p",ITc_mmi_node_get_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_register_clone_destroy_p",ITc_mmi_node_register_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_set_attribute_p",ITc_mmi_node_instance_set_attribute_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p",ITc_mmi_node_instance_find_port_instance_by_port_sibling_port_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_instance_emit_signal_p",ITc_mmi_node_instance_emit_signal_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bool_p",ITc_mmi_data_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_int_p",ITc_mmi_data_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_float_p",ITc_mmi_data_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_text_p",ITc_mmi_data_create_get_text_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_audio_p",ITc_mmi_data_create_get_audio_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_video_p",ITc_mmi_data_create_get_video_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_user_get_identification_p",ITc_mmi_data_create_user_get_identification_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_coordinate_p",ITc_mmi_data_create_get_coordinate_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_get_bounding_box_p",ITc_mmi_data_create_get_bounding_box_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_array_get_array_count_p",ITc_mmi_data_create_array_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_add_array_element_get_array_element_p",ITc_mmi_data_add_array_element_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_create_struct_destroy_p",ITc_mmi_data_create_struct_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_set_get_struct_element_p",ITc_mmi_data_set_get_struct_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_type_p",ITc_mmi_data_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_get_struct_count_element_name_element_value_p",ITc_mmi_data_get_struct_count_element_name_element_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_data_to_from_bytes_p",ITc_mmi_data_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_destroy_p",ITc_mmi_attribute_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_set_get_name_p",ITc_mmi_attribute_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_get_value_p",ITc_mmi_attribute_get_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_clone_p",ITc_mmi_attribute_clone_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_to_from_bytes_p",ITc_mmi_attribute_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_attribute_create_string_array_p",ITc_mmi_attribute_create_string_array_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_int_p",ITc_mmi_primitive_value_create_get_int_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_float_p",ITc_mmi_primitive_value_create_get_float_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_string_p",ITc_mmi_primitive_value_create_get_string_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_get_bool_p",ITc_mmi_primitive_value_create_get_bool_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_create_array_add_element_get_array_count_p",ITc_mmi_primitive_value_create_array_add_element_get_array_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_type_p",ITc_mmi_primitive_value_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_get_array_element_p",ITc_mmi_primitive_value_get_array_element_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_clone_destroy_p",ITc_mmi_primitive_value_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_primitive_value_to_from_bytes_p",ITc_mmi_primitive_value_to_from_bytes_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_create_clone_destroy_p",ITc_mmi_signal_parameter_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_parameter_get_name_value_p",ITc_mmi_signal_parameter_get_name_value_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_create_destroy_p",ITc_mmi_signal_create_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_add_parameter_p",ITc_mmi_signal_add_parameter_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_name_p",ITc_mmi_signal_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_signal_get_parameter_get_parameter_count_p",ITc_mmi_signal_get_parameter_get_parameter_count_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_source_get_source_type_p",ITc_mmi_node_create_source_get_source_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_processor_get_processor_type_p",ITc_mmi_node_create_processor_get_processor_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_logic_get_logic_type_p",ITc_mmi_node_create_logic_get_logic_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_controller_get_controller_type_p",ITc_mmi_node_create_controller_get_controller_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_action_get_action_type_p",ITc_mmi_node_create_action_get_action_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_node_create_custom_get_custom_type_p",ITc_mmi_node_create_custom_get_custom_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_create_clone_destroy_p",ITc_mmi_port_create_clone_destroy_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_name_p",ITc_mmi_port_set_get_name_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_type_p",ITc_mmi_port_set_get_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_get_data_type_p",ITc_mmi_port_set_get_data_type_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_set_input_data_received_cb_p",ITc_mmi_port_set_input_data_received_cb_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {"ITc_mmi_port_instance_generate_output_p",ITc_mmi_port_instance_generate_output_p,ITs_mmi_startup, ITs_mmi_cleanup}, + {NULL, NULL} +}; + +#endif // __TCT_MMI_NATIVE_H__