From: Shobhit Verma Date: Fri, 6 Oct 2023 08:31:34 +0000 (+0530) Subject: [ITC][messages][ACR-1795] Removed deprecated module X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c966bdc005b40dc51e0f1dc4e5533e21a15df18e;p=test%2Ftct%2Fnative%2Fapi.git [ITC][messages][ACR-1795] Removed deprecated module Change-Id: Ife293924e95e1a31a793e244c0a78fba81c3667b Signed-off-by: Shobhit Verma --- diff --git a/packaging/itc/native-messages-itc.spec b/packaging/itc/native-messages-itc.spec deleted file mode 100755 index c7de09629..000000000 --- a/packaging/itc/native-messages-itc.spec +++ /dev/null @@ -1,88 +0,0 @@ -%define MODULE_NAME messages -%define MODULE_LIBNAME capi-messaging-messages -Name: native-%{MODULE_NAME}-itc -Summary: Native API Integration TC (%{name}) -Version: 0.1 -Release: 0 -Group: Development/Tools -License: Apache-2.0 -Source0: %{name}-%{version}.tar.gz -BuildRequires: pkgconfig(%{MODULE_LIBNAME}) -BuildRequires: pkgconfig(capi-appfw-application) -BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(msg-service) -BuildRequires: pkgconfig(capi-base-common) -BuildRequires: pkgconfig(capi-system-info) -BuildRequires: cmake -BuildRequires: pkgconfig(bundle) - -%description -Native API Integration TC (%{name}) - -%prep -%setup -q - -%build - -%define PREFIX "%{_libdir}/%{name}" - -export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed" - -%if %{?ASAN_BUILD:1}0 - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%else - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%endif - -make %{?jobs:-j%jobs} - -%install -rm -rf %{buildroot} -%make_install -mkdir -p %{buildroot}/usr/share/license -cp LICENSE %{buildroot}/usr/share/license/%{name} - - -mkdir -p %{buildroot}%{APP_PATH}%{name}/data -cp src/itc/messages/Image.jpg %{buildroot}%{APP_PATH}%{name}/data/Image.jpg - - -mkdir -p %{buildroot}/usr/share/packages/ -cp packaging/itc/native-%{MODULE_NAME}-itc.xml %{buildroot}/usr/share/packages/ -mkdir -p %{buildroot}%{APP_PATH}%{name}/bin -#cp templates/external_wrapper.sh %{buildroot}%{APP_PATH}%{name}/bin - -%post -chown -R 5000:5000 %{APP_PATH}%{name}/data -chsmack -a %{name} %{APP_PATH}%{name}/data -%postun - - -%files -%{APP_PATH}%{name}/* -/usr/share/packages/native-%{MODULE_NAME}-itc.xml -/usr/share/license/%{name} diff --git a/packaging/itc/native-messages-itc.xml b/packaging/itc/native-messages-itc.xml deleted file mode 100755 index 084c927de..000000000 --- a/packaging/itc/native-messages-itc.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - test - Native API test Application - - - - - - - - - - http://tizen.org/privilege/message.read - http://tizen.org/privilege/message.write - - diff --git a/scripts_tpk/spec.sh b/scripts_tpk/spec.sh index cdcd28d76..bd5463141 100755 --- a/scripts_tpk/spec.sh +++ b/scripts_tpk/spec.sh @@ -279,17 +279,6 @@ case "$1" in chsmack -a "User::App::Shared" $APP_DATA_DIR/* chsmack -e "User::App::Shared" $APP_DATA_DIR/* ;; - "org.tizen.messages-native-itc") - echo "Installing pre-requisites for the package $1" - mkdir -p $APP_DATA_DIR - chsmack -a "User::App::Shared" $APP_DATA_DIR - chsmack -e "User::App::Shared" $APP_DATA_DIR - cp Image.jpg $APP_DATA_DIR/Image.jpg - chown -R 5000:5000 $APP_DATA_DIR - chmod -R 777 $APP_DATA_DIR - chsmack -a "User::App::Shared" $APP_DATA_DIR/* - chsmack -e "User::App::Shared" $APP_DATA_DIR/* - ;; "org.tizen.media-content-native-itc") echo "Installing pre-requisites for the package $1" diff --git a/scripts_tpk/tizeniot_service_modules.txt b/scripts_tpk/tizeniot_service_modules.txt index 07e526c73..efa08e2f8 100755 --- a/scripts_tpk/tizeniot_service_modules.txt +++ b/scripts_tpk/tizeniot_service_modules.txt @@ -31,7 +31,6 @@ mediademuxer media-key mediamuxer mediatool -messages metadata-editor metadata-extractor mime-type diff --git a/src/itc/messages/CMakeLists.txt b/src/itc/messages/CMakeLists.txt deleted file mode 100755 index 668a56a2c..000000000 --- a/src/itc/messages/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -SET(PKG_NAME "messages") - -SET(EXEC_NAME "tct-${PKG_NAME}-native") -SET(RPM_NAME "native-${PKG_NAME}-itc") - -SET(CAPI_LIB "capi-messaging-messages") -SET(TC_SOURCES - ITs-messages-common.c - ITs-messages-mms.c - ITs-messages.c -) - -PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED - ${CAPI_LIB} - capi-appfw-application - bundle - capi-system-info - dlog -) - -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/messages/ITs-messages-common.c b/src/itc/messages/ITs-messages-common.c deleted file mode 100755 index 138dcf5de..000000000 --- a/src/itc/messages/ITs-messages-common.c +++ /dev/null @@ -1,131 +0,0 @@ -// -// Copyright (c) 2014 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-messages-common.h" - -/** @addtogroup itc-messages -* @ingroup itc -* @{ -*/ - -/** -* @function MessagesGetError -* @description Maps error enums to string values -* @parameter nRet : error code returned -* @return error string -*/ -char* MessagesGetError(int nRet) -{ - char *szErrorVal = NULL; - - switch ( nRet ) - { - case MESSAGES_ERROR_INVALID_PARAMETER: szErrorVal = "MESSAGES_ERROR_INVALID_PARAMETER"; break; - case MESSAGES_ERROR_OUT_OF_MEMORY: szErrorVal = "MESSAGES_ERROR_OUT_OF_MEMORY"; break; - case MESSAGES_ERROR_SERVER_NOT_READY: szErrorVal = "MESSAGES_ERROR_SERVER_NOT_READY"; break; - case MESSAGES_ERROR_COMMUNICATION_WITH_SERVER_FAILED: szErrorVal = "MESSAGES_ERROR_COMMUNICATION_WITH"; break; - case MESSAGES_ERROR_OPERATION_FAILED: szErrorVal = "MESSAGES_ERROR_OPERATION_FAILED"; break; - case MESSAGES_ERROR_SENDING_FAILED: szErrorVal = "MESSAGES_ERROR_SENDING_FAILED"; break; - case MESSAGES_ERROR_OUT_OF_RANGE: szErrorVal = "MESSAGES_ERROR_OUT_OF_RANGE"; break; - case MESSAGES_ERROR_NO_SIM_CARD: szErrorVal = "MESSAGES_ERROR_NO_SIM_CARD"; break; - case MESSAGES_ERROR_NO_DATA: szErrorVal = "MESSAGES_ERROR_NO_DATA"; break; - case MESSAGES_ERROR_PERMISSION_DENIED: szErrorVal = "MESSAGES_ERROR_PERMISSION_DENIED"; break; - case MESSAGES_ERROR_NOT_SUPPORTED: szErrorVal = "MESSAGES_ERROR_NOT_SUPPORTED"; break; - case MESSAGES_ERROR_NONE: szErrorVal = "MESSAGES_ERROR_NONE"; break; - default: szErrorVal = "Unknown Error"; break; - } - return szErrorVal; -} - -/** -* @function MessagesGetDataPath -* @description Returnes the application data path -* @parameter pAppDataPath: application data path -* @return true if succeed else false -*/ -bool MessagesGetDataPath(char* pAppDataPath) -{ - if ( NULL == pAppDataPath ) - { - FPRINTF("[Line : %d][%s] Null Path provided;Check the input string\\n", __LINE__, API_NAMESPACE); - return false; - } - - memset(pAppDataPath, 0, PATH_LEN); - - char* pPath = NULL; - pPath = app_get_data_path(); - if ( NULL == pPath ) - { - FPRINTF("[Line : %d][%s] Unable to get application data path;app_get_data_path returned null value\\n", __LINE__, API_NAMESPACE); - return false; - } - - strncpy(pAppDataPath, pPath, strlen(pAppDataPath)+1); - - FPRINTF("[Line : %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath); - - return true; -} - -/** -* @function MessagesAppendToAppDataPath -* @description Appends the input string to application data path -* @parameter pInputPath: path to append to data path;pFinalPath: final resultant path -* @return true if succeed else false -*/ -bool MessagesAppendToAppDataPath(char* pInputPath, char* pFinalPath) -{ - if ( NULL == pInputPath || NULL == pFinalPath ) - { - FPRINTF("[Line : %d][%s] Null Path provided;Check the input string\\n", __LINE__, API_NAMESPACE); - return false; - } - - char pAppDataPath[PATH_LEN] = {0,}; - if ( false == MessagesGetDataPath(pAppDataPath) ) - { - return false; - } - - memset(pFinalPath, 0, PATH_LEN); - strncpy(pFinalPath, pAppDataPath, strlen(pFinalPath)+1); - strncat(pFinalPath, pInputPath, strlen(pInputPath)+1); - - FPRINTF("[Line : %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath); - - return true; -} - -/** -* @function MessagesTimeout -* @description Called if some callback is not invoked for a particular timeout -* @parameter gpointer data -* @return gboolean -*/ -gboolean MessagesTimeout(gpointer data) -{ - GMainLoop *pMainLoop = NULL; - pMainLoop = (GMainLoop *)data; - if ( pMainLoop != NULL ) - { - g_main_loop_quit(pMainLoop); - pMainLoop = NULL; - } - FPRINTF("[Line : %d][%s] Callback Timeout\\n", __LINE__, API_NAMESPACE); - return false; -} - -/** @} */ //end of itc-messages diff --git a/src/itc/messages/ITs-messages-common.h b/src/itc/messages/ITs-messages-common.h deleted file mode 100755 index 42b8a686e..000000000 --- a/src/itc/messages/ITs-messages-common.h +++ /dev/null @@ -1,102 +0,0 @@ -// -// Copyright (c) 2014 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_MESSAGES_COMMON_H_ -#define _ITS_MESSAGES_COMMON_H_ - -#include "tct_common.h" -//#include -//#include -//#include -#include -#include -#include -#include - -/** @addtogroup itc-messages -* @ingroup itc -* @{ -*/ - -#define ADD_PORT 2 -#define PATH_LEN 1024 -#define TIMEOUT_CB 30000 -#define PUSH_TEST_APP_ID "TEST_APP_ID" -#define PUSH_TEST_CONTENT_TYPE "text/vnd.wap.connectivity-xml" - -#define API_NAMESPACE "MESSAGES_ITC" -#define TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony.sms" -#define TELEPHONY_FEATURE_TELEPHONY "http://tizen.org/feature/network.telephony" -#define TELEPHONY_FEATURE_MMS "http://tizen.org/feature/network.telephony.mms" -#define MESSAGES_IMAGE_FILE "Image.jpg" - -#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_bMessageService || !g_bMessagesCreation )\ -{\ - FPRINTF("[Line : %d][%s] Precondition of mesages create failed so leaving test\\n", __LINE__, API_NAMESPACE);\ - return 1;\ -}\ -} - -#define START_TEST_MMS {\ - FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\ - if ( g_bFeatureMismatchMms )\ -{\ - return 1;\ -}\ - if ( g_bFeatureNotSupportedMms )\ -{\ - return 0;\ -}\ - if ( !g_bMessageServiceMms )\ -{\ - FPRINTF("[Line : %d][%s] Precondition of mesages open service failed so leaving test\\n", __LINE__, API_NAMESPACE);\ - return 1;\ -}\ -} - -#define RUN_POLLING_LOOP {\ - if ( g_bMessagesCB == false )\ -{\ - g_loop = g_main_loop_new(NULL, false);\ - nTimeoutId = g_timeout_add(TIMEOUT_CB, MessagesTimeout, g_loop);\ - g_main_loop_run(g_loop);\ - g_source_remove(nTimeoutId);\ - g_loop = NULL;\ -}\ -} - -GMainLoop *g_loop; -bool g_bIsTelephonyFeatureSupported; -bool g_bIsTelephonyFeatureTelephonySupported; -bool g_bIsTelephonyFeatureMmsSupported; - -char* MessagesGetError(int nRet); -gboolean MessagesTimeout(gpointer data); -bool MessagesAppendToAppDataPath(char* pInputPath, char* pFinalPath); -bool MessagesGetDataPath(char* pPath); - -/** @} */ //end of itc-messages - -#endif //_ITS_MESSAGES_COMMON_H_ diff --git a/src/itc/messages/ITs-messages-mms.c b/src/itc/messages/ITs-messages-mms.c deleted file mode 100755 index a5b3e3388..000000000 --- a/src/itc/messages/ITs-messages-mms.c +++ /dev/null @@ -1,426 +0,0 @@ -// -// Copyright (c) 2014 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-messages-common.h" - -messages_service_h g_pstHandleMessageServiceMms = NULL; - -bool g_bMessageServiceMms = false; -bool g_bFeatureMismatchMms = false; -bool g_bFeatureNotSupportedMms = false; - -/** -* @function ITs_messages_startup -* @description Opens a handle for a messaging service and Creates a message handle -* @parameter NA -* @return NA -*/ -void ITs_messages_mms_startup(void) -{ - struct stat stBuff; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - remove(ERR_LOG); - } -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Messages_p\\n", __LINE__, API_NAMESPACE); -#endif - - g_bFeatureMismatchMms = false; - g_bFeatureNotSupportedMms = false; - g_bIsTelephonyFeatureSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE, API_NAMESPACE); - - int nRet = messages_open_service(&g_pstHandleMessageServiceMms); - if ( !g_bIsTelephonyFeatureSupported ) - { - if ( nRet != TIZEN_ERROR_NOT_SUPPORTED ) - { - FPRINTF("[Line : %d][%s] messages_open_service returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, MessagesGetError(nRet)); - g_bFeatureMismatchMms = true; - } - else - { - FPRINTF("[Line : %d][%s] messages_open_service correctly returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, MessagesGetError(nRet)); - g_bFeatureNotSupportedMms = true; - } - return; - } - if ( nRet == MESSAGES_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] messages_open_service in startup passed\\n", __LINE__, API_NAMESPACE); - g_bMessageServiceMms = true; - } - else - { - FPRINTF("[Line : %d][%s]messages_open_service failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE, nRet, MessagesGetError(nRet)); - g_bMessageServiceMms = false; - } - - g_bIsTelephonyFeatureMmsSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE_MMS, API_NAMESPACE); - return; -} - -/** -* @function ITs_messages_cleanup -* @description Close a handle for a messaging service and Destroy a message handle -* @parameter NA -* @return NA -*/ -void ITs_messages_mms_cleanup(void) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Messages_p\\n", __LINE__, API_NAMESPACE); -#endif - - if ( g_bIsTelephonyFeatureSupported && g_bMessageServiceMms ) - { - int nRet = messages_close_service(g_pstHandleMessageServiceMms); - if ( nRet == MESSAGES_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s]messages_close_service passed cleanUp\\n", __LINE__, API_NAMESPACE); - } - else - { - FPRINTF("[Line : %d][%s]messages_close_service failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE, nRet,MessagesGetError(nRet)); - } - } - else - { - FPRINTF("[Line : %d][%s]messages_open_service failed\\n", __LINE__, API_NAMESPACE); - } - g_pstHandleMessageServiceMms = NULL; - - return; -} - -//& purpose: Add/Get attachment -//& type: auto -/** -* @testcase ITc_messages_mms_add_get_attachement_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Adds/Get the attachment MMS message. -* @scenario Create MMS message\n -* Add attachment\n -* Get attachment -* @apicovered messages_mms_add_attachment, messages_mms_get_attachment -* @passcase When messages_mms_add_attachment and messages_mms_get_attachment are successful. -* @failcase If target API messages_mms_add_attachment or messages_mms_get_attachment fails or any precondition API fails. -* @precondition Message handle must be created -* @postcondition Message handle must be released -*/ -int ITc_messages_mms_add_get_attachement_p(void) -{ - START_TEST_MMS; - - messages_message_h stHandleMMSMessage = NULL; - char *pszPath = NULL; - char pPath[PATH_LEN] = {0,}; - if ( false == MessagesAppendToAppDataPath(MESSAGES_IMAGE_FILE, pPath) ) - { - FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); - return 1; - } - messages_media_type_e eMessageMediaType; - messages_media_type_e eMessagesMediaType[] = { - MESSAGES_MEDIA_UNKNOWN, - MESSAGES_MEDIA_IMAGE, - MESSAGES_MEDIA_AUDIO, - MESSAGES_MEDIA_VIDEO - }; - - int nEnumSize = sizeof(eMessagesMediaType) / sizeof(eMessagesMediaType[0]); - int nEnumCounter = 0; - - g_bIsTelephonyFeatureMmsSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE_MMS, API_NAMESPACE); - - int nRet = messages_create_message(MESSAGES_TYPE_MMS, &stHandleMMSMessage); - - if ( !g_bIsTelephonyFeatureMmsSupported ) - { - if ( nRet != TIZEN_ERROR_NOT_SUPPORTED ) - { - FPRINTF("[Line : %d][%s] messages_create_message() returned %d(%s) error for unsupported MMS feature\\n", __LINE__, API_NAMESPACE, nRet, MessagesGetError(nRet)); - return 1; - } - else - { - FPRINTF("[Line : %d][%s] messages_create_message failed for unsupported (http://tizen.org/feature/network.telephony.mms ) MMS telephony feature\\n", __LINE__, API_NAMESPACE); - return 0; - } - } - - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_create_message", MessagesGetError(nRet)); - - for ( nEnumCounter=0;nEnumCounter 0)) - { - FPRINTF("[Line : %d][%s] message sending result is not valid\\n", __LINE__, API_NAMESPACE); - g_bMessagesCBParameter = false; - } - else - { - g_bMessagesCBParameter = true; - } - - if ( g_loop != NULL ) - { - g_main_loop_quit(g_loop); - g_loop = NULL; - } -} - -/** -* @function IncomingCB -* @description Called when an incoming message is received -* @parameter incoming_msg : An incoming message, data : The user data passed from the callback registration function -* @return NA -*/ -void IncomingCB(messages_message_h incoming_msg, void * data) -{ - g_bMessagesCB = true; - if ( g_loop != NULL ) - { - g_main_loop_quit(g_loop); - g_loop = NULL; - } -} - -/** -* @function PushCallback -* @description Called when an incoming push message is received -* @parameter header : The header of the push message\n -* body : The body of the push message (it is not a null-terminated string)\n -* body length : The length of body\n -* user : The user data to be passed to the callback function -* @return NA -*/ -static void PushCallback(const char *header, const char *body, int body_length, void* data) -{ - g_bMessagesCB = true; - if ( g_loop != NULL ) - { - g_main_loop_quit(g_loop); - g_loop = NULL; - } -} -/** -* @function ITs_messages_startup -* @description Opens a handle for a messaging service and Creates a message handle -* @parameter NA -* @return NA -*/ -void ITs_messages_startup(void) -{ - struct stat stBuff; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - remove(ERR_LOG); - } -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Messages_p\\n", __LINE__, API_NAMESPACE); -#endif - - g_bIsTelephonyFeatureSupported = true; - g_bFeatureMismatch = false; - g_bFeatureNotSupported = false; - - g_bIsTelephonyFeatureSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE, API_NAMESPACE); - - int nRet = messages_open_service(&g_pstHandleMessageService); - if ( !g_bIsTelephonyFeatureSupported ) - { - if ( nRet != TIZEN_ERROR_NOT_SUPPORTED ) - { - FPRINTF("[Line : %d][%s] messages_open_service returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, MessagesGetError(nRet)); - g_bFeatureMismatch = true; - } - else - { - FPRINTF("[Line : %d][%s] messages_open_service correctly returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, MessagesGetError(nRet)); - g_bFeatureNotSupported = true; - } - return; - } - if ( nRet != MESSAGES_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] messages_open_service failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE, nRet, MessagesGetError(nRet)); - g_bMessageService = false; - return; - } - else if(g_pstHandleMessageService == NULL) - { - FPRINTF("[Line : %d][%s] messages_open_service failed, Handle is NULL \\n", __LINE__, API_NAMESPACE); - g_bMessageService = false; - return; - } - else - { - FPRINTF("[Line : %d][%s] messages_open_service in startup passed\\n", __LINE__, API_NAMESPACE); - g_bMessageService = true; - } - - nRet = messages_create_message(MESSAGES_TYPE_SMS, &g_pstHandleSMSMessage); - if ( nRet != MESSAGES_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] Unable to create message, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE, nRet,MessagesGetError(nRet)); - g_bMessagesCreation = false; - } - else if(g_pstHandleSMSMessage == NULL) - { - FPRINTF("[Line : %d][%s] messages_create_message failed, Handle is NULL \\n", __LINE__, API_NAMESPACE); - g_bMessagesCreation = false; - } - else - { - FPRINTF("[Line : %d][%s] message created successfully startup\\n", __LINE__, API_NAMESPACE); - g_bMessagesCreation = true; - } - - return; -} - -/** -* @function ITs_messages_cleanup -* @description Close a handle for a messaging service and Destroy a message handle -* @parameter NA -* @return NA -*/ -void ITs_messages_cleanup(void) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Messages_p\\n", __LINE__, API_NAMESPACE); -#endif - - int nRet = 0; - if ( g_bIsTelephonyFeatureSupported && g_bMessagesCreation ) - { - nRet = messages_destroy_message(g_pstHandleSMSMessage); - if ( nRet == MESSAGES_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] messages_destroy_message passed cleanUp\\n", __LINE__, API_NAMESPACE); - } - else - { - FPRINTF("[Line : %d][%s] messages_destroy_message failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE, nRet,MessagesGetError(nRet)); - } - } - - if ( g_bMessageService ) - { - nRet = messages_close_service(g_pstHandleMessageService); - if ( nRet == MESSAGES_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] messages_close_service passed cleanUp\\n", __LINE__, API_NAMESPACE); - } - else - { - FPRINTF("[Line : %d][%s] messages_close_service failed, error returned = %d(%s)\\n", __LINE__, API_NAMESPACE, nRet, MessagesGetError(nRet)); - } - } - g_pstHandleMessageService = NULL; - - return; -} - -/** @addtogroup itc-messages-testcases -* @brief Integration testcases for module messages -* @ingroup itc-messages -* @{ -*/ - -//& purpose: Adds/Get a recipient's address to the message -//& type: auto -/** -* @testcase ITc_messages_add_get_address_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Adds a recipient's address (phone number) to the message -* @scenario Create SMS message\n -* Add recipient's address\n -* Get recipient's address -* @apicovered messages_add_address, messages_get_address, messages_get_address_count, messages_remove_all_addresses -* @passcase When messages_add_address, messages_get_address, messages_get_address_count and messages_remove_all_addresses are successful. -* @failcase If target API messages_add_address, messages_get_address, messages_get_address_count and messages_remove_all_addresses are fails or any precondition API fails. -* @precondition Message handle must be created, Change the [MOBILE_NUMBER] parameter in ITs-messages-common.h accordingly for [messages_add_address] -* @postcondition Message handle must be released -*/ -int ITc_messages_add_get_address_p(void) -{ - START_TEST; - - messages_recipient_type_e recipient_type; - int nRet = 0, nIndex=0, nNoOfRecipents = 0; - char *pAaddress=NULL; - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - if ( true == GetValueFromConfigFile("MESSAGES_MOBILE_NUMBER", pszValue, API_NAMESPACE )) - { -#if DEBUG - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); -#endif - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); - return 1; - } - messages_recipient_type_e eMessagesRecipientType[] = { - MESSAGES_RECIPIENT_UNKNOWN, - MESSAGES_RECIPIENT_TO, - MESSAGES_RECIPIENT_CC, - MESSAGES_RECIPIENT_BCC - }; - - int nEnumSize = sizeof(eMessagesRecipientType) / sizeof(eMessagesRecipientType[0]); - int nEnumCounter = 0; - - for ( nEnumCounter=0;nEnumCounter MESSAGES_MBOX_DRAFT)) - { - FPRINTF("[Line : %d][%s] messages_get_mbox_type failed, output value is invalid\\n", __LINE__, API_NAMESPACE); - return 1; - } - - return 0; -} - -//& purpose: Gets the message count in the specific message box -//& type: auto -/** -* @testcase ITc_messages_get_message_count_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Gets the message count in the specific message box -* @scenario Create SMS message\n -* Gets the message count in the specific message box -* @apicovered messages_get_message_count -* @passcase When messages_get_message_cout is successful. -* @failcase If target API messages_get_message_count fails or any precondition API fails. -* @precondition Message handle must be created -* @postcondition Message handle must be released -*/ -int ITc_messages_get_message_count_p(void) -{ - START_TEST; - - const char* pData = "CALL BACK FOR INCOMING MMS"; - const char *pMsgText = "Test Message Text"; - int nTimeoutId = 0; - int nCount = 0; - - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - if ( true == GetValueFromConfigFile("MESSAGES_MOBILE_NUMBER", pszValue, API_NAMESPACE) ) - { - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); - return 1; - } - - int nRet = messages_add_address(g_pstHandleSMSMessage, pszValue, MESSAGES_RECIPIENT_TO); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_add_address", MessagesGetError(nRet)); - - nRet = messages_set_text(g_pstHandleSMSMessage, pMsgText); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_text", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_message_incoming_cb(g_pstHandleMessageService, IncomingCB, (void*)pData); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_message_incoming_cb", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_sim_id(g_pstHandleSMSMessage, 1); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_sim_id", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - g_bMessagesCB = false; - g_bMessagesCBParameter = false; - nRet = messages_send_message(g_pstHandleMessageService, g_pstHandleSMSMessage, true, MessagesSetMessageSentCB, NULL); - RUN_POLLING_LOOP; - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_send_message", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - if ( g_bMessagesCB == false ) - { - FPRINTF("[Line : %d][%s] MessagesSetMessageSentCB failed\\n", __LINE__, API_NAMESPACE); - messages_unset_message_incoming_cb(g_pstHandleMessageService); - messages_remove_all_addresses(g_pstHandleSMSMessage); - return 1; - } - else if ( g_bMessagesCBParameter == false ) - { - messages_unset_message_incoming_cb(g_pstHandleMessageService); - messages_remove_all_addresses(g_pstHandleSMSMessage); - return 1; - } - - nRet = messages_get_message_count(g_pstHandleMessageService, MESSAGES_MBOX_ALL, MESSAGES_TYPE_UNKNOWN, &nCount); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_get_message_count", MessagesGetError(nRet)); - CHECK_VALUE_INT(nCount, "messages_get_message_count"); - - nRet = messages_unset_message_incoming_cb(g_pstHandleMessageService); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_unset_message_incoming_cb", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_remove_all_addresses(g_pstHandleSMSMessage); - PRINT_RESULT_NORETURN(MESSAGES_ERROR_NONE, nRet, "messages_remove_all_addresses", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Adds an additional listening port for the incoming SMS messages -//& type: auto -/** -* @testcase ITc_messages_add_get_sms_listening_port_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Gets the message count in the specific message box -* @scenario Create SMS message\n -* Add listening port for the incoming SMS messages -* @apicovered messages_add_sms_listening_port -* @passcase When messages_add_sms_listening_port is successful. -* @failcase If target API messages_add_sms_listening_port fails or any precondition API fails. -* @precondition Message handle must be created -* @postcondition Message handle must be released -*/ -int ITc_messages_add_get_sms_listening_port_p(void) -{ - START_TEST; - - messages_service_h pstHandleMessageService = NULL; - int nAddPort = ADD_PORT; - int nGetPort = -1; - - int nRet = messages_open_service(&pstHandleMessageService); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_open_service", MessagesGetError(nRet)); - CHECK_HANDLE(pstHandleMessageService, "messages_open_service"); - - nRet = messages_add_sms_listening_port(pstHandleMessageService, nAddPort); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_add_sms_listening_port", MessagesGetError(nRet), messages_close_service(pstHandleMessageService)); - - nRet = messages_get_message_port(g_pstHandleSMSMessage, &nGetPort); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_get_message_port", MessagesGetError(nRet), messages_close_service(pstHandleMessageService)); - if(nGetPort == -1) - { - FPRINTF("[Line : %d][%s] messages_get_message_port failed, output value is invalid\\n", __LINE__, API_NAMESPACE); - return 1; - } - - nRet = messages_close_service(pstHandleMessageService); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_close_service", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Glets the type of a message -//& type: auto -/** -* @testcase ITc_messages_get_message_type_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Gets the type of a message -* @scenario Create SMS message\n -* Gets the message type -* @apicovered messages_get_message_type -* @passcase When messages_get_message_type is successful. -* @failcase If target API messages_get_message_type fails or any precondition API fails. -* @precondition Message handle must be created -* @postcondition Message handle must be released -*/ -int ITc_messages_get_message_type_p(void) -{ - START_TEST; - - messages_message_type_e eMsgType = -1; - int nRet = messages_get_message_type(g_pstHandleSMSMessage, &eMsgType); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_get_message_type", MessagesGetError(nRet)); - if((eMsgTypeMESSAGES_TYPE_SMS_ETWS_SECONDARY)) - { - FPRINTF("[Line : %d][%s] messages_get_message_type failed, output value is invalid\\n", __LINE__, API_NAMESPACE); - return 1; - } - - return 0; -} - -//& purpose: Sets/Gets the text of a message. -//& type: auto -/** -* @testcase ITc_messages_set_get_text_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Set and get the text of a message. -* @scenario Create SMS message\n -* Sets message text\n -* Gets message text -* @apicovered messages_set_text, messages_get_text -* @passcase When messages_set_text and messages_get_text are successful. -* @failcase If target API messages_set_text and messages_get_text are fails or any precondition API fails. -* @precondition Message handle must be created -* @postcondition Message handle must be released -*/ -int ITc_messages_set_get_text_p(void) -{ - START_TEST; - - const char *pText = "this is the text"; - char* pTextget = NULL; - - int nRet = messages_set_text(g_pstHandleSMSMessage, pText); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_set_text", MessagesGetError(nRet)); - - nRet = messages_get_text(g_pstHandleSMSMessage, &pTextget); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_get_text", MessagesGetError(nRet)); - - if ( strcmp( pTextget, pText ) != 0 ) - { - FPRINTF("[Line : %d][%s] pTextget in messages_get_text is not same, as set\\n", __LINE__, API_NAMESPACE); - FREE_MEMORY(pTextget); - return 1; - } - FREE_MEMORY(pTextget); - - return 0; -} - -//& purpose: Gets the time of a message -//& type: auto -/** -* @testcase ITc_messages_get_time_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Gets the time of a message -* @scenario Create SMS message\n -* Gets message time -* @apicovered messages_get_time -* @passcase When messages_get_time is successful. -* @failcase If target API messages_get_time fails or any precondition API fails. -* @precondition Message handle must be created -* @postcondition Message handle must be released -*/ -int ITc_messages_get_time_p(void) -{ - START_TEST; - - time_t stGetTime = -1; - int nRet = messages_get_time(g_pstHandleSMSMessage, &stGetTime); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_get_time", MessagesGetError(nRet)); - if(stGetTime == -1) - { - FPRINTF("[Line : %d][%s] messages_get_time failed, output is invalid\\n", __LINE__, API_NAMESPACE); - return 1; - } - - return 0; -} - -//& purpose: Set/Get the sim id of the sending message -//& type: auto -/** -* @testcase ITc_messages_set_get_sim_id_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Set/Get the sim id of the sending message -* @scenario Create SMS message -* Set the sim id of the sending message -* Get the sim id of the sending message -* @apicovered messages_set_sim_id, messages_get_sim_id -* @passcase When messages_set_sim_id, messages_get_sim_id is successful. -* @failcase If target API messages_set_sim_id, messages_get_sim_id fails or any precondition API fails. -* @precondition Message handle must be created -* @postcondition Message handle must be released -*/ -int ITc_messages_set_get_sim_id_p(void) -{ - START_TEST; - - int nSetSimId = 1, nGetSimId = -1; - int nRet = messages_set_sim_id(g_pstHandleSMSMessage, nSetSimId); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_set_sim_id", MessagesGetError(nRet)); - - nRet = messages_get_sim_id(g_pstHandleSMSMessage, &nGetSimId); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_get_sim_id", MessagesGetError(nRet)); - FPRINTF("[Line : %d][%s] sim id = [%d]\\n", __LINE__, API_NAMESPACE, nGetSimId); - if ( nSetSimId != nGetSimId ) - { - FPRINTF("[Line : %d][%s] messages_get_sim_id is failed since Set Sim id: %d and Get Sim id: %d in ITc_messages_get_sim_id_p is not same\\n", __LINE__, API_NAMESPACE, nSetSimId, nGetSimId); - return 1; - } - - return 0; -} - -//& purpose: Registers a callback to be invoked when a WAP Push message is received -//& type: auto -/** -* @testcase ITc_messages_push_add_remove_incoming_cb_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Registers a callback to be invoked when a WAP Push message is received -* @scenario handle for a messaging service\n -* Registers a callback to be invoked when a WAP Push message is received -* @apicovered messages_push_add_incoming_cb -* @passcase When messages_push_add_incoming_cb -* @failcase If target API messages_push_add_incoming_cb fails or any precondition API fails. -* @precondition Message service handle must be created, -* @postcondition Message service handle must be released -*/ -int ITc_messages_push_add_remove_incoming_cb_p(void) -{ - START_TEST; - - int nRet = messages_push_add_incoming_cb(g_pstHandleMessageService, PUSH_TEST_APP_ID, PushCallback, NULL); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_push_add_incoming_cb", MessagesGetError(nRet)); - - nRet = messages_push_remove_incoming_cb(g_pstHandleMessageService, PUSH_TEST_APP_ID); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_push_remove_incoming_cb", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Registers/Deregister an application to the mapping table of the WAP Push service -//& type: auto -/** -* @testcase ITc_messages_push_register_deregister_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Registers/Deregister an application to the mapping table of the WAP Push service -* @scenario handle for a messaging service\n -* Registers an application to the mapping table of the WAP Push service\n -* Deregister an application to the mapping table of the WAP Push service -* @apicovered messages_push_register -* @passcase When messages_push_register -* @failcase If target API messages_push_register fails or any precondition API fails. -* @precondition Message service handle must be created, -* @postcondition Message service handle must be released -*/ -int ITc_messages_push_register_deregister_p(void) -{ - START_TEST; - - int nRet = messages_push_register(g_pstHandleMessageService, PUSH_TEST_CONTENT_TYPE, PUSH_TEST_APP_ID); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_push_register", MessagesGetError(nRet)); - - nRet = messages_push_deregister(g_pstHandleMessageService, PUSH_TEST_CONTENT_TYPE, PUSH_TEST_APP_ID); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_push_deregister", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Re-registers an application to the mapping table of the WAP Push service -//& type: auto -/** -* @testcase ITc_messages_push_reregister_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Re-registers an application to the mapping table of the WAP Push service -* @scenario handle for a messaging service\n -* Re-registers an application to the mapping table of the WAP Push service -* @apicovered messages_push_reregister -* @passcase When messages_push_reregister -* @failcase If target API messages_push_reregister fails or any precondition API fails. -* @precondition Message service handle must be created, -* @postcondition Message service handle must be released -*/ -int ITc_messages_push_reregister_p(void) -{ - START_TEST; - - int nRet = messages_push_reregister(g_pstHandleMessageService, PUSH_TEST_CONTENT_TYPE, PUSH_TEST_APP_ID, PUSH_TEST_CONTENT_TYPE, PUSH_TEST_APP_ID); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_push_reregister", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Send message. -//& type: Manual -/** -* @testcase ITc_messages_send_message_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Send message -* @scenario Add recipient address\n -* Set message text\n -* Send message\n -* Set message incoming callback\n -* Check callback\n -* Unset message incoming callback -* @apicovered messages_add_address, messages_set_text, messages_send_message, messages_set_message_incoming_cb, messages_unset_message_incoming_cb -* @passcase When messages_send_message, messages_set_message_incoming_cb and messages_unset_message_incoming_cb are successful. -* @failcase If target API messages_add_address, messages_set_message_incoming_cb or messages_unset_message_incoming_cb fails or any precondition API fails. -* @precondition Message handle must be created, message recipient and text must be set -* Change the [MOBILE_NUMBER] parameter in ITs-messages-common.h accordingly for [messages_add_address] -* @postcondition Message handle must be released -*/ - -int ITc_messages_send_message_p(void) -{ - START_TEST; - - const char* pData = "CALL BACK FOR INCOMING MMS"; - const char *pMsgText = "Test Message Text"; - int nTimeoutId = 0; - - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - if ( true == GetValueFromConfigFile("MESSAGES_MOBILE_NUMBER", pszValue, API_NAMESPACE) ) - { - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); - return 1; - } - - int nRet = messages_add_address(g_pstHandleSMSMessage, pszValue, MESSAGES_RECIPIENT_TO); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_add_address", MessagesGetError(nRet)); - - nRet = messages_set_text(g_pstHandleSMSMessage, pMsgText); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_text", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_message_incoming_cb(g_pstHandleMessageService, IncomingCB, (void*)pData); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_message_incoming_cb", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_sim_id(g_pstHandleSMSMessage, 1); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_sim_id", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - g_bMessagesCB = false; - g_bMessagesCBParameter = false; - nRet = messages_send_message(g_pstHandleMessageService, g_pstHandleSMSMessage, true, MessagesSetMessageSentCB, NULL); - RUN_POLLING_LOOP; - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_send_message", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - if ( g_bMessagesCB == false ) - { - FPRINTF("[Line : %d][%s] MessagesSetMessageSentCB failed\\n", __LINE__, API_NAMESPACE); - messages_unset_message_incoming_cb(g_pstHandleMessageService); - messages_remove_all_addresses(g_pstHandleSMSMessage); - return 1; - } - else if ( g_bMessagesCBParameter == false ) - { - messages_unset_message_incoming_cb(g_pstHandleMessageService); - messages_remove_all_addresses(g_pstHandleSMSMessage); - return 1; - } - - nRet = messages_unset_message_incoming_cb(g_pstHandleMessageService); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_unset_message_incoming_cb", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_remove_all_addresses(g_pstHandleSMSMessage); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_remove_all_addresses", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Search message/by ID and free message array -//& type: auto -/** -* @testcase ITc_messages_search_getid_searchbyid_freemessage_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Search message, search message by id and free message array -* @scenario Add recipient address\n -* Search message\n -* Get message ID\n -* Search message by id\n -* Destroy used message handle in search message\n -* Free message by ID -* @apicovered messages_search_message, messages_get_message_id, messages_search_message_by_id, messages_free_message_array -* @passcase When messages_search_message, messages_get_message_id, messages_search_message_by_id,\n -* messages_destroy_message and messages_free_message_array are successful. -* @failcase If target API or any supporting API fails. -* @precondition Message handle and message service handle must be created\n -* Change the [MOBILE_NUMBER] parameter in ITs-messages-common.h accordingly for [messages_add_address] -* @postcondition Message handle and message service handle must be released -*/ -int ITc_messages_search_getid_searchbyid_freemessage_p(void) -{ - START_TEST; - - messages_message_h stHandleSMSMessage = NULL; - const char *pKeyword = "Test"; - const char *pMsgText = "Test Message Text 1"; - - messages_message_h *pSearched_message_array = NULL; - int nSearched_message_length = 0, nTotalMsg = 0, nId=0; - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - - if ( true == GetValueFromConfigFile("MESSAGES_MOBILE_NUMBER", pszValue, API_NAMESPACE)) - { - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); - return 1; - } - - int nRet = messages_add_address(g_pstHandleSMSMessage, pszValue, MESSAGES_RECIPIENT_TO); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_add_address", MessagesGetError(nRet)); - - nRet = messages_set_text(g_pstHandleSMSMessage, pMsgText); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_text", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_message_incoming_cb(g_pstHandleMessageService, IncomingCB, NULL); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "g_pstHandleMessageService", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_sim_id(g_pstHandleSMSMessage, 1); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_sim_id", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_send_message(g_pstHandleMessageService, g_pstHandleSMSMessage, true, MessagesSetMessageSentCB, NULL); - usleep(3000000); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_send_message", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - char *pszSearchValue = strdup(pszValue + 4); - FPRINTF("[Line : %d][%s] Search message recipient = %s\\n", __LINE__, API_NAMESPACE, pszSearchValue); - - nRet = messages_search_message(g_pstHandleMessageService, MESSAGES_MBOX_ALL, MESSAGES_TYPE_UNKNOWN, pKeyword, pszSearchValue, 0, 0, &pSearched_message_array, &nSearched_message_length, &nTotalMsg); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_search_message", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage);FREE_MEMORY(pszSearchValue)); - - if ( nSearched_message_length <= 0 ) - { - FPRINTF("[Line : %d][%s] There is no message in message Array[]\\n", __LINE__, API_NAMESPACE); - messages_unset_message_incoming_cb(g_pstHandleMessageService); - messages_remove_all_addresses(g_pstHandleSMSMessage); - FREE_MEMORY(pszSearchValue); - return 1; - } - FREE_MEMORY(pszSearchValue); - - nRet = messages_get_message_id(pSearched_message_array[0], &nId); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_get_message_id", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - CHECK_VALUE_INT(nId, "messages_get_message_id"); - - nRet = messages_search_message_by_id(g_pstHandleMessageService, nId, &stHandleSMSMessage); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_search_message_by_id", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - CHECK_HANDLE(stHandleSMSMessage, "messages_search_message_by_id"); - - nRet = messages_free_message_array(pSearched_message_array); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_free_message_array", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_unset_message_incoming_cb(g_pstHandleMessageService); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_unset_message_incoming_cb", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_remove_all_addresses(g_pstHandleSMSMessage); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_remove_all_addresses", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Retrieves the found messages -//& type: auto -/** -* @testcase ITc_messages_foreach_message_p -* @since_tizen 2.3 -* @author SRID(gaurav.m2) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Send message -* @scenario Create message handle\n -* Retrieves the found messages by invoking the given callback function iteratively -* @apicovered messages_foreach_message -* @passcase When messages_send_message is successful. -* @failcase If target API messages_add_address fails or any precondition API fails. -* @precondition Message handle must be created, message recipient and text must be successful,\n -* Change the [MOBILE_NUMBER] parameter in ITs-messages-common.h accordingly for [messages_add_address] -* @postcondition Message handle must be released -*/ -int ITc_messages_foreach_message_p(void) -{ - START_TEST; - - int nTimeoutId = 0; - const char *pKeyWord = "test"; - const char *pMsgText = "Test Message Text 1"; - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - - if ( true == GetValueFromConfigFile("MESSAGES_MOBILE_NUMBER", pszValue, API_NAMESPACE) ) - { -#if DEBUG - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); -#endif - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); - return 1; - } - - int nRet = messages_add_address(g_pstHandleSMSMessage, pszValue, MESSAGES_RECIPIENT_TO); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_add_address", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_text(g_pstHandleSMSMessage, pMsgText); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_text", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_message_incoming_cb(g_pstHandleMessageService, IncomingCB, NULL); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_message_incoming_cb", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_sim_id(g_pstHandleSMSMessage, 1); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_sim_id", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_send_message(g_pstHandleMessageService, g_pstHandleSMSMessage, true, MessagesSetMessageSentCB, NULL); - usleep(3000000); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_send_message", MessagesGetError(nRet), messages_unset_message_incoming_cb(g_pstHandleMessageService);messages_remove_all_addresses(g_pstHandleSMSMessage)); - - g_bMessagesCB = false; - g_bMessagesCBParameter = false; - nRet = messages_foreach_message(g_pstHandleMessageService, MESSAGES_MBOX_ALL, MESSAGES_TYPE_UNKNOWN, pKeyWord, pszValue, 0, 1, MessagesSearchCB, NULL); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_foreach_message", MessagesGetError(nRet)); - - RUN_POLLING_LOOP; - if ( !g_bMessagesCB ) - { - FPRINTF("[Line : %d][%s] Callback [MessagesSearchCB] failed\\n", __LINE__, API_NAMESPACE); - messages_unset_message_incoming_cb(g_pstHandleMessageService); - messages_remove_all_addresses(g_pstHandleSMSMessage); - return 1; - } - else if(!g_bMessagesCBParameter) - { - messages_unset_message_incoming_cb(g_pstHandleMessageService); - messages_remove_all_addresses(g_pstHandleSMSMessage); - return 1; - } - - nRet = messages_unset_message_incoming_cb(g_pstHandleMessageService); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_unset_message_incoming_cb", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_remove_all_addresses(g_pstHandleSMSMessage); - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, "messages_remove_all_addresses", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Adds the message to message database -//& type: auto -/** -* @testcase ITc_messages_add_message_p -* @since_tizen 2.3 -* @author SRID(shilpa.j) -* @reviewer SRID(a.pandia1) -* @type auto -* @description Adds the message to message database -* @scenario Create message handle\n -* Adds the message to message database -* @apicovered messages_add_message -* @passcase When messages_add_message is successful. -* @failcase If target API messages_add_address fails or any precondition API fails. -* @precondition Message handle must be created, message recipient and text must be successful,\n -* Change the [MOBILE_NUMBER] parameter in ITs-messages-common.h accordingly for [messages_add_address] -* @postcondition Message handle must be released -*/ -int ITc_messages_add_message_p(void) -{ - START_TEST; - - int nTimeoutId = 0; - int nMsgId = -1; - const char *pMsgText = "Test Message Text 1"; - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - - g_bIsTelephonyFeatureTelephonySupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE_TELEPHONY, API_NAMESPACE); - - if ( true == GetValueFromConfigFile("MESSAGES_MOBILE_NUMBER", pszValue, API_NAMESPACE) ) - { - #if DEBUG - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - #endif - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); - return 1; - } - - - int nRet = messages_add_address(g_pstHandleSMSMessage, pszValue, MESSAGES_RECIPIENT_TO); - if ( !g_bIsTelephonyFeatureTelephonySupported ) - { - - if ( nRet != TIZEN_ERROR_NOT_SUPPORTED ) - { - FPRINTF("[Line : %d][%s] messages_add_address() returned %d(%s) error for unsupported MMS feature\\n", __LINE__, API_NAMESPACE, nRet, MessagesGetError(nRet)); - return 1; - } - else - { - FPRINTF("[Line : %d][%s] messages_add_address failed for unsupported (http://tizen.org/feature/network.telephony.mms ) MMS telephony feature\\n", __LINE__, API_NAMESPACE); - return 0; - } - - } - - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_add_address", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_text(g_pstHandleSMSMessage, pMsgText); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_text", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_add_message(g_pstHandleMessageService, g_pstHandleSMSMessage, &nMsgId); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, " messages_add_message", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - CHECK_VALUE_INT(nMsgId, "messages_add_message"); - - nRet = messages_remove_all_addresses(g_pstHandleSMSMessage); - PRINT_RESULT_NORETURN(MESSAGES_ERROR_NONE, nRet, "messages_remove_all_addresses", MessagesGetError(nRet)); - - return 0; -} - -//& purpose: Sets message box type of a message -//& type: auto -/** -* @testcase ITc_messages_set_mbox_type_p -* @since_tizen 2.3 -* @author SRID(shilpa.j) -* @reviewer SRID(a.pandia1) -* @type auto -* @description Sets message box type of a message -* @scenario Create message handle\n -* Sets message box type of a message -* @apicovered messages_set_mbox_type -* @passcase When messages_set_mbox_type is successful. -* @failcase If target API messages_set_mbox_type fails or any precondition API fails. -* @precondition Message handle must be created -* -* @postcondition Message handle must be released -*/ -int ITc_messages_set_mbox_type_p(void) -{ - START_TEST; - - messages_message_box_e mbox = MESSAGES_MBOX_INBOX; - - - g_bIsTelephonyFeatureTelephonySupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE_TELEPHONY, API_NAMESPACE); - //target API - int nRet = messages_set_mbox_type(g_pstHandleSMSMessage,mbox); - - if ( !g_bIsTelephonyFeatureTelephonySupported ) - { - - if ( nRet != TIZEN_ERROR_NOT_SUPPORTED ) - { - FPRINTF("[Line : %d][%s] messages_set_mbox_type() returned %d(%s) error for unsupported MMS feature\\n", __LINE__, API_NAMESPACE, nRet, MessagesGetError(nRet)); - return 1; - } - else - { - FPRINTF("[Line : %d][%s] messages_set_mbox_type failed for unsupported (http://tizen.org/feature/network.telephony.mms ) MMS telephony feature\\n", __LINE__, API_NAMESPACE); - return 0; - } - - } - - PRINT_RESULT(MESSAGES_ERROR_NONE, nRet, " messages_set_mbox_type", MessagesGetError(nRet)); - - - return 0; -} - -//& purpose: Sets display time from a message -//& type: auto -/** -* @testcase ITc_messages_set_time_p -* @since_tizen 2.3 -* @author SRID(shilpa.j) -* @reviewer SRID(a.pandia1) -* @type auto -* @description Sets display time from a message -* @scenario Create message handle\n -* Sets display time from a message -* @apicovered messages_add_message -* @passcase When messages_add_message is successful. -* @failcase If target API messages_add_address fails or any precondition API fails. -* @precondition Message handle must be created, message recipient and text must be successful,\n -* Change the [MOBILE_NUMBER] parameter in ITs-messages-common.h accordingly for [messages_add_address] -* @postcondition Message handle must be released -*/ -int ITc_messages_set_time_p(void) -{ - START_TEST; - - time_t stSetTime = {0}; - const char *pMsgText = "Test Message Text 1"; - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - - - g_bIsTelephonyFeatureTelephonySupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE_TELEPHONY, API_NAMESPACE); - - if ( true == GetValueFromConfigFile("MESSAGES_MOBILE_NUMBER", pszValue, API_NAMESPACE) ) - { - #if DEBUG - FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - #endif - } - else - { - FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); - return 1; - } - - - int nRet = messages_add_address(g_pstHandleSMSMessage, pszValue, MESSAGES_RECIPIENT_TO); - if ( !g_bIsTelephonyFeatureTelephonySupported ) - { - - if ( nRet != TIZEN_ERROR_NOT_SUPPORTED ) - { - FPRINTF("[Line : %d][%s] messages_add_address() returned %d(%s) error for unsupported MMS feature\\n", __LINE__, API_NAMESPACE, nRet, MessagesGetError(nRet)); - return 1; - } - else - { - FPRINTF("[Line : %d][%s] messages_add_address failed for unsupported (http://tizen.org/feature/network.telephony.mms ) MMS telephony feature\\n", __LINE__, API_NAMESPACE); - return 0; - } - - } - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_add_address", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_text(g_pstHandleSMSMessage, pMsgText); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, "messages_set_text", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_set_time(g_pstHandleSMSMessage,stSetTime); - PRINT_RESULT_CLEANUP(MESSAGES_ERROR_NONE, nRet, " messages_add_message", MessagesGetError(nRet), messages_remove_all_addresses(g_pstHandleSMSMessage)); - - nRet = messages_remove_all_addresses(g_pstHandleSMSMessage); - PRINT_RESULT_NORETURN(MESSAGES_ERROR_NONE, nRet, "messages_remove_all_addresses", MessagesGetError(nRet)); - - return 0; -} - -/** @} */ //end of itc-messages -/** @} */ //end of itc-messages-testcases diff --git a/src/itc/messages/Image.jpg b/src/itc/messages/Image.jpg deleted file mode 100755 index 7a15f1455..000000000 Binary files a/src/itc/messages/Image.jpg and /dev/null differ diff --git a/src/itc/messages/tct-messages-native.c b/src/itc/messages/tct-messages-native.c deleted file mode 100755 index cc54ca3e2..000000000 --- a/src/itc/messages/tct-messages-native.c +++ /dev/null @@ -1,138 +0,0 @@ -// -// Copyright (c) 2014 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 -#include -#include "tct_common.h" - -#ifdef MOBILE //Starts MOBILE -#include "tct-messages-native_mobile.h" -#endif //MOBILE //End MOBILE - -#ifdef WEARABLE //Starts WEARABLE -#include "tct-messages-native_wearable.h" -#endif //WEARABLE //End WEARABLE - -#ifdef TV //Starts TV -#include "tct-messages-native_tv.h" -#endif //TV //End TV - -#ifdef TIZENIOT //Starts TIZENIOT -#include "tct-messages-native_tizeniot.h" -#endif //TIZENIOT //End TIZENIOT - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -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)) ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup begin", pszGetTCName); - if ( tc_array[i].startup ) - { - tc_array[i].startup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body begin", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup begin", pszGetTCName); - if ( tc_array[i].cleanup ) - { - tc_array[i].cleanup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup end", pszGetTCName); - 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; - - 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, NULL); - 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/messages/tct-messages-native_mobile.h b/src/itc/messages/tct-messages-native_mobile.h deleted file mode 100755 index 4c12309f4..000000000 --- a/src/itc/messages/tct-messages-native_mobile.h +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) 2014 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_MESSAGES-NATIVE_H__ -#define __TCT_MESSAGES-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_messages_mms_startup(void); -extern void ITs_messages_mms_cleanup(void); -extern void ITs_messages_startup(void); -extern void ITs_messages_cleanup(void); - -extern int ITc_messages_mms_add_get_attachement_p(void); -extern int ITc_messages_mms_get_attachement_count_p(void); -extern int ITc_messages_mms_set_get_subject_p(void); -extern int ITc_messages_mms_remove_all_attachments_p(void); -extern int ITc_messages_add_get_address_p(void); -extern int ITc_messages_get_mboxType_p(void); -extern int ITc_messages_get_message_count_p(void); -extern int ITc_messages_add_get_sms_listening_port_p(void); -extern int ITc_messages_get_message_type_p(void); -extern int ITc_messages_set_get_text_p(void); -extern int ITc_messages_get_time_p(void); -extern int ITc_messages_set_get_sim_id_p(void); -extern int ITc_messages_push_add_remove_incoming_cb_p(void); -extern int ITc_messages_push_register_deregister_p(void); -extern int ITc_messages_push_reregister_p(void); -extern int ITc_messages_send_message_p(void); -extern int ITc_messages_search_getid_searchbyid_freemessage_p(void); -extern int ITc_messages_foreach_message_p(void); -extern int ITc_messages_add_message_p(void); -extern int ITc_messages_set_mbox_type_p(void); -extern int ITc_messages_set_time_p(void); - -testcase tc_array[] = { - {"ITc_messages_mms_add_get_attachement_p",ITc_messages_mms_add_get_attachement_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_get_attachement_count_p",ITc_messages_mms_get_attachement_count_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_set_get_subject_p",ITc_messages_mms_set_get_subject_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_remove_all_attachments_p",ITc_messages_mms_remove_all_attachments_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_add_get_address_p",ITc_messages_add_get_address_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_mboxType_p",ITc_messages_get_mboxType_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_message_count_p",ITc_messages_get_message_count_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_add_get_sms_listening_port_p",ITc_messages_add_get_sms_listening_port_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_message_type_p",ITc_messages_get_message_type_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_get_text_p",ITc_messages_set_get_text_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_time_p",ITc_messages_get_time_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_get_sim_id_p",ITc_messages_set_get_sim_id_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_add_remove_incoming_cb_p",ITc_messages_push_add_remove_incoming_cb_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_register_deregister_p",ITc_messages_push_register_deregister_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_reregister_p",ITc_messages_push_reregister_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_send_message_p",ITc_messages_send_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_search_getid_searchbyid_freemessage_p",ITc_messages_search_getid_searchbyid_freemessage_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_foreach_message_p",ITc_messages_foreach_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_add_message_p",ITc_messages_add_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_mbox_type_p",ITc_messages_set_mbox_type_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_time_p",ITc_messages_set_time_p,ITs_messages_startup,ITs_messages_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_MESSAGES-NATIVE_H__ diff --git a/src/itc/messages/tct-messages-native_tizeniot.h b/src/itc/messages/tct-messages-native_tizeniot.h deleted file mode 100755 index 4c12309f4..000000000 --- a/src/itc/messages/tct-messages-native_tizeniot.h +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) 2014 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_MESSAGES-NATIVE_H__ -#define __TCT_MESSAGES-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_messages_mms_startup(void); -extern void ITs_messages_mms_cleanup(void); -extern void ITs_messages_startup(void); -extern void ITs_messages_cleanup(void); - -extern int ITc_messages_mms_add_get_attachement_p(void); -extern int ITc_messages_mms_get_attachement_count_p(void); -extern int ITc_messages_mms_set_get_subject_p(void); -extern int ITc_messages_mms_remove_all_attachments_p(void); -extern int ITc_messages_add_get_address_p(void); -extern int ITc_messages_get_mboxType_p(void); -extern int ITc_messages_get_message_count_p(void); -extern int ITc_messages_add_get_sms_listening_port_p(void); -extern int ITc_messages_get_message_type_p(void); -extern int ITc_messages_set_get_text_p(void); -extern int ITc_messages_get_time_p(void); -extern int ITc_messages_set_get_sim_id_p(void); -extern int ITc_messages_push_add_remove_incoming_cb_p(void); -extern int ITc_messages_push_register_deregister_p(void); -extern int ITc_messages_push_reregister_p(void); -extern int ITc_messages_send_message_p(void); -extern int ITc_messages_search_getid_searchbyid_freemessage_p(void); -extern int ITc_messages_foreach_message_p(void); -extern int ITc_messages_add_message_p(void); -extern int ITc_messages_set_mbox_type_p(void); -extern int ITc_messages_set_time_p(void); - -testcase tc_array[] = { - {"ITc_messages_mms_add_get_attachement_p",ITc_messages_mms_add_get_attachement_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_get_attachement_count_p",ITc_messages_mms_get_attachement_count_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_set_get_subject_p",ITc_messages_mms_set_get_subject_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_remove_all_attachments_p",ITc_messages_mms_remove_all_attachments_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_add_get_address_p",ITc_messages_add_get_address_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_mboxType_p",ITc_messages_get_mboxType_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_message_count_p",ITc_messages_get_message_count_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_add_get_sms_listening_port_p",ITc_messages_add_get_sms_listening_port_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_message_type_p",ITc_messages_get_message_type_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_get_text_p",ITc_messages_set_get_text_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_time_p",ITc_messages_get_time_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_get_sim_id_p",ITc_messages_set_get_sim_id_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_add_remove_incoming_cb_p",ITc_messages_push_add_remove_incoming_cb_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_register_deregister_p",ITc_messages_push_register_deregister_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_reregister_p",ITc_messages_push_reregister_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_send_message_p",ITc_messages_send_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_search_getid_searchbyid_freemessage_p",ITc_messages_search_getid_searchbyid_freemessage_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_foreach_message_p",ITc_messages_foreach_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_add_message_p",ITc_messages_add_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_mbox_type_p",ITc_messages_set_mbox_type_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_time_p",ITc_messages_set_time_p,ITs_messages_startup,ITs_messages_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_MESSAGES-NATIVE_H__ diff --git a/src/itc/messages/tct-messages-native_wearable.h b/src/itc/messages/tct-messages-native_wearable.h deleted file mode 100755 index 4c12309f4..000000000 --- a/src/itc/messages/tct-messages-native_wearable.h +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) 2014 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_MESSAGES-NATIVE_H__ -#define __TCT_MESSAGES-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_messages_mms_startup(void); -extern void ITs_messages_mms_cleanup(void); -extern void ITs_messages_startup(void); -extern void ITs_messages_cleanup(void); - -extern int ITc_messages_mms_add_get_attachement_p(void); -extern int ITc_messages_mms_get_attachement_count_p(void); -extern int ITc_messages_mms_set_get_subject_p(void); -extern int ITc_messages_mms_remove_all_attachments_p(void); -extern int ITc_messages_add_get_address_p(void); -extern int ITc_messages_get_mboxType_p(void); -extern int ITc_messages_get_message_count_p(void); -extern int ITc_messages_add_get_sms_listening_port_p(void); -extern int ITc_messages_get_message_type_p(void); -extern int ITc_messages_set_get_text_p(void); -extern int ITc_messages_get_time_p(void); -extern int ITc_messages_set_get_sim_id_p(void); -extern int ITc_messages_push_add_remove_incoming_cb_p(void); -extern int ITc_messages_push_register_deregister_p(void); -extern int ITc_messages_push_reregister_p(void); -extern int ITc_messages_send_message_p(void); -extern int ITc_messages_search_getid_searchbyid_freemessage_p(void); -extern int ITc_messages_foreach_message_p(void); -extern int ITc_messages_add_message_p(void); -extern int ITc_messages_set_mbox_type_p(void); -extern int ITc_messages_set_time_p(void); - -testcase tc_array[] = { - {"ITc_messages_mms_add_get_attachement_p",ITc_messages_mms_add_get_attachement_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_get_attachement_count_p",ITc_messages_mms_get_attachement_count_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_set_get_subject_p",ITc_messages_mms_set_get_subject_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_mms_remove_all_attachments_p",ITc_messages_mms_remove_all_attachments_p,ITs_messages_mms_startup,ITs_messages_mms_cleanup}, - {"ITc_messages_add_get_address_p",ITc_messages_add_get_address_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_mboxType_p",ITc_messages_get_mboxType_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_message_count_p",ITc_messages_get_message_count_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_add_get_sms_listening_port_p",ITc_messages_add_get_sms_listening_port_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_message_type_p",ITc_messages_get_message_type_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_get_text_p",ITc_messages_set_get_text_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_get_time_p",ITc_messages_get_time_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_get_sim_id_p",ITc_messages_set_get_sim_id_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_add_remove_incoming_cb_p",ITc_messages_push_add_remove_incoming_cb_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_register_deregister_p",ITc_messages_push_register_deregister_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_push_reregister_p",ITc_messages_push_reregister_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_send_message_p",ITc_messages_send_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_search_getid_searchbyid_freemessage_p",ITc_messages_search_getid_searchbyid_freemessage_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_foreach_message_p",ITc_messages_foreach_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_add_message_p",ITc_messages_add_message_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_mbox_type_p",ITc_messages_set_mbox_type_p,ITs_messages_startup,ITs_messages_cleanup}, - {"ITc_messages_set_time_p",ITc_messages_set_time_p,ITs_messages_startup,ITs_messages_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_MESSAGES-NATIVE_H__ diff --git a/tct_unsupported.txt b/tct_unsupported.txt index e0b91a47f..e9eebc974 100755 --- a/tct_unsupported.txt +++ b/tct_unsupported.txt @@ -286,7 +286,6 @@ tv:armv7l:itc:capi-ui-sticker; tv:armv7l:itc:location-manager; tv:armv7l:itc:phonenumber-utils; tv:armv7l:itc:contacts-service2; -tv:armv7l:itc:messages; tv:armv7l:itc:context; tv:armv7l:itc:sync-manager; tv:armv7l:itc:oauth2;