+++ /dev/null
-%define MODULE_NAME email
-%define MODULE_LIBNAME capi-messaging-email
-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: cmake
-BuildRequires: pkgconfig(bundle)
-BuildRequires: pkgconfig(capi-system-info)
-%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}/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
-
-mkdir -p %{buildroot}%{APP_PATH}%{name}/data/
-
-%if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
-cp src/itc/email/res/mobile/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
-cp src/itc/email/res/wearable/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_TV:1}0
-cp src/itc/email/res/tv/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
-cp src/itc/email/res/tizeniot/Image_01.jpg %{buildroot}%{APP_PATH}%{name}/data/Image_01.jpg
-%endif
-
-%post
-chown -R 5000:5000 %{APP_PATH}%{name}/data
-chsmack -a %{name} %{APP_PATH}%{name}/data
-chmod 777 %{APP_PATH}%{name}/data/Image_01.jpg
-chsmack -a _ %{APP_PATH}%{name}/data/Image_01.jpg
-
-%postun
-
-%files
-%{APP_PATH}%{name}/*
-/usr/share/packages/native-%{MODULE_NAME}-itc.xml
-/usr/share/license/%{name}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="native-email-itc" version="0.1.0" api-version="6.0">
- <label>CoreEmailTest</label>
- <author email="mymail@tizentest.com" href="www.tizentest.com">test</author>
- <description>Native API test Application</description>
- <ui-application appid="native.email-itc" exec="/usr/apps/native-email-itc/bin/tct-email-native" nodisplay="false" multiple="false" type="capp" taskmanage="true">
- <background-category value="background-network"/>
- <background-category value="download"/>
- <background-category value="iot-communication"/>
- <background-category value="location"/>
- <background-category value="media"/>
- <background-category value="sensor"/>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/email</privilege>
- <privilege>http://tizen.org/privilege/mediastorage</privilege>
- </privileges>
-</manifest>
chsmack -a "User::App::Shared" $APP_DATA_DIR/*
chsmack -e "User::App::Shared" $APP_DATA_DIR/*
;;
- "org.tizen.email-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_01.jpg $APP_DATA_DIR/Image_01.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.image-util-native-itc")
echo "Installing pre-requisites for the package $1"
mkdir -p $APP_DATA_DIR
data-control
device
dlog
-email
http
image-util
iotcon
ADD_SUBDIRECTORY(itc/dlog)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/efl-util")
ADD_SUBDIRECTORY(itc/efl-util)
- MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/email")
- ADD_SUBDIRECTORY(itc/email)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/image-util")
ADD_SUBDIRECTORY(itc/image-util)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/key-manager")
+++ /dev/null
-SET(PKG_NAME "email")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-native")
-SET(RPM_NAME "native-${PKG_NAME}-itc")
-
-SET(CAPI_LIB "capi-messaging-email")
-SET(TC_SOURCES
- ITs-email-common.c
- ITs-email.c
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- ${CAPI_LIB}
- capi-appfw-application
- bundle
- capi-system-info
- glib-2.0
- 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()
+++ /dev/null
-//
-// 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-email-common.h"
-
-/** @addtogroup itc-email
-* @ingroup itc
-* @{
-*/
-
-extern char g_pstrRecipient[CONFIG_VALUE_LEN_MAX];
-
-//Add helper function definitions here
-
-/**
-* @function EmailGetError
-* @description Maps error enums to string values
-* @parameter nRet : error code returned
-* @return error string
-*/
-char* EmailGetError(int nRet)
-{
- char *szErrorVal = NULL;
-
- switch ( nRet )
- {
- case EMAILS_ERROR_NONE: szErrorVal = "EMAILS_ERROR_NONE"; break;
- case EMAILS_ERROR_OUT_OF_MEMORY: szErrorVal = "EMAILS_ERROR_OUT_OF_MEMORY"; break;
- case EMAILS_ERROR_INVALID_PARAMETER: szErrorVal = "EMAILS_ERROR_INVALID_PARAMETER"; break;
- case EMAILS_ERROR_SERVER_NOT_READY: szErrorVal = "EMAILS_ERROR_SERVER_NOT_READY"; break;
- case EMAILS_ERROR_COMMUNICATION_WITH_SERVER_FAILED: szErrorVal = "EMAILS_ERROR_COMMUNICATION_WITH_SERVER_FAILED"; break;
- case EMAILS_ERROR_OPERATION_FAILED: szErrorVal = "EMAILS_ERROR_OPERATION_FAILED"; break;
- case EMAILS_ERROR_ACCOUNT_NOT_FOUND: szErrorVal = "EMAILS_ERROR_ACCOUNT_NOT_FOUND"; break;
- case EMAILS_ERROR_DB_FAILED: szErrorVal = "EMAILS_ERROR_DB_FAILED"; break;
- case EMAILS_ERROR_PERMISSION_DENIED: szErrorVal = "EMAILS_ERROR_PERMISSION_DENIED"; break;
- case EMAILS_ERROR_NOT_SUPPORTED: szErrorVal = "EMAILS_ERROR_NOT_SUPPORTED"; break;//ACR 992
-
-
- default: szErrorVal = "Undefined Error"; break;
- }
-
- return szErrorVal;
-}
-
-/**
-* @function EmailGetRecipientType
-* @description Maps recipient type enums to string values
-* @parameter nRecipient : Recipient type
-* @return Recipient type string
-*/
-char* EmailGetRecipientType(int nRecipient)
-{
- char* szRecipientType = NULL;
-
- switch ( nRecipient )
- {
- case EMAIL_RECIPIENT_TYPE_TO: szRecipientType = "EMAIL_RECIPIENT_TYPE_TO"; break;
- case EMAIL_RECIPIENT_TYPE_CC: szRecipientType = "EMAIL_RECIPIENT_TYPE_CC"; break;
- case EMAIL_RECIPIENT_TYPE_BCC: szRecipientType = "EMAIL_RECIPIENT_TYPE_BCC"; break;
- default: szRecipientType = "Unknown Recipient Type"; break;
- }
-
- return szRecipientType;
-}
-
-bool CreateEmailMessageWithoutAttachment(email_h email)
-{
- /* Set Email Message Subject */
- int nRet = email_set_subject(email, EMAILSUBJECT);
- if ( nRet != EMAILS_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] email_set_subject failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- return false;
- }
-
- /* Set Email Message Body */
- nRet = email_set_body(email, EMAILBODY);
- if ( nRet != EMAILS_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] email_set_body failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- return false;
- }
-
- /* Add Email Message Recipient */
- nRet = email_add_recipient(email, EMAIL_RECIPIENT_TYPE_TO, g_pstrRecipient);
- if ( nRet != EMAILS_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] email_add_recipient failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- return false;
- }
-
- return true;
-}
-
-bool CreateEmailMessageWithAttachment(email_h email) {
- bool bRet = CreateEmailMessageWithoutAttachment(email);
- if ( bRet == false )
- {
- FPRINTF("[Line : %d][%s] failed to create email message without attachment\\n", __LINE__, API_NAMESPACE);
- return false;
- }
-
- /* Add Attachment to the Email Message */
- char *pszImagePath = EmailGetDataPath(IMAGE_NAME);
- if(pszImagePath == NULL)
- {
- FPRINTF("[Line : %d][%s] EmailGetDataPath failed,\\n", __LINE__, API_NAMESPACE);
- return false;
- }
- int nRet = email_add_attach(email, pszImagePath);
- if ( nRet != EMAILS_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] email_add_attach failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- FREE_MEMORY(pszImagePath);
- return false;
- }
- FREE_MEMORY(pszImagePath);
- return true;
-}
-
-bool SendEmailMessageWithoutAttachment(email_h email)
-{
- bool bRet = CreateEmailMessageWithoutAttachment(email);
- if ( bRet == false )
- {
- FPRINTF("[Line : %d][%s] failed to create email message without attachment\\n", __LINE__, API_NAMESPACE);
- return false;
- }
-
- /* Send Email Message */
- int nRet = email_send_message(email, true);
- if ( nRet != EMAILS_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] email_send_message failed, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- return false;
- }
-
- return true;
-}
-
-/**
-* @function EmailGetDataPath
-* @description Get the path to application data directory
-* @parameter [IN] char* pszFileName [file name]
-* @return NA
-*/
-char* EmailGetDataPath(char *pszFileName)
-{
- char *pszAppData = app_get_data_path(),*pszImgPath = NULL;
- if ( pszAppData == NULL || strlen(pszAppData) == 0 )
- {
- FPRINTF("[Line : %d][%s] app_get_data_path() returned invalid path\\n", __LINE__, API_NAMESPACE);
- return pszImgPath;
- }
-
- pszImgPath = (char*) calloc(1, strlen(pszAppData) + strlen(pszFileName) + 1);
- if(pszImgPath == NULL)
- return pszImgPath;
- snprintf(pszImgPath, strlen(pszAppData) + strlen(pszFileName) + 1, "%s%s",pszAppData, pszFileName );
- FPRINTF("[Line : %d][%s] app_get_data_path() is %s\\n", __LINE__, API_NAMESPACE, pszImgPath);
- return pszImgPath;
-}
-
-/** @} */
+++ /dev/null
-//
-// 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_EMAIL_COMMON_H_
-#define _ITS_EMAIL_COMMON_H_
-
-//Add test package related includes here
-
-#include "tct_common.h"
-
-#include <app.h>
-#include <email.h>
-
-#include <glib.h>
-#include <glib-object.h>
-
-/** @addtogroup itc-email
-* @ingroup itc
-* @{
-*/
-
-#define API_NAMESPACE "EMAIL_ITC"
-#define TIMEOUT_CB 30000
-#define PATH_LEN 1024
-
-#define ACCOUNT_USERNAME sbrcsrbdtest@gmail.com
-#define ACCOUNT_PASSWORD root080233
-#define EMAILSUBJECT "Sample E-Mail Subject"
-#define EMAILBODY "Sample E-Mail Body Text"
-#define EMAILADDRESS "sbrcsrbdtest@gmail.com" //password : root080233
-#define IMAGE_NAME "Image_01.jpg"
-
-#define TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony"
-#define WIFI_FEATURE "http://tizen.org/feature/network.wifi"
-#define EMAIL_FEATURE "http://tizen.org/feature/email" //Mail feature ACR 992
-
-
-#define START_TEST {\
- FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
- if(g_eEmailNotSupported)\
- {\
- FPRINTF("[Line : %d][%s] Feature =%s not supported :success ", __LINE__, API_NAMESPACE,EMAIL_FEATURE);\
- return 0;\
- }\
- else if (g_eEmailMismatch)\
- {\
- FPRINTF("[Line : %d][%s] Precondition of email feature=%s:Mismatch,failure ", __LINE__, API_NAMESPACE,EMAIL_FEATURE);\
- return 1;\
- }\
- if ( !g_bEmailCreation )\
- {\
- FPRINTF("[Line : %d][%s] Precondition of email message handle creation failed. So leaving test ", __LINE__, API_NAMESPACE);\
- return 1;\
- }\
-}
-
-#define RUN_POLLING_LOOP {\
- g_pEmailMainLoop = g_main_loop_new(NULL, false);\
- nEmailTimeoutId = g_timeout_add(TIMEOUT_CB, EmailTimeout, g_pEmailMainLoop);\
- g_main_loop_run(g_pEmailMainLoop);\
- g_source_remove(nEmailTimeoutId);\
- g_pEmailMainLoop = NULL;\
-}
-
-GMainLoop *g_pEmailMainLoop;
-email_h g_hEmail;
-
-bool g_bIsEmailSendFeatureSupported;
-bool g_bEmailCreation;
-bool g_bCallbackOccurred;
-bool g_bEmailSentSuccess;
-
-bool g_eEmailNotSupported;
-bool g_eEmailMismatch;
-
-
-// Maps error enums to string values
-char* EmailGetError(int nRet);
-
-// Maps recipient type enums to string values
-char* EmailGetRecipientType(int nRecipient);
-
-// Create email message without attachment
-bool CreateEmailMessageWithoutAttachment(email_h email);
-
-// Create email message with attachment
-bool CreateEmailMessageWithAttachment(email_h email);
-
-// Get the path to application data directory
-char* EmailGetDataPath(char *pszFileName);
-
-/** @} */
-
-#endif //_ITS_EMAIL_COMMON_H_
+++ /dev/null
-//
-// 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-email-common.h"
-
-/** @addtogroup itc-email
-* @ingroup itc
-* @{
-*/
-
-//& set: Email
-
-char g_pstrRecipient[CONFIG_VALUE_LEN_MAX] = {0,};
-
-/**
-* @function ITs_email_startup
-* @description Called before each test, creates email handle
-* @parameter NA
-* @return NA
-*/
-void ITs_email_startup(void)
-{
- struct stat stBuff;
- g_eEmailNotSupported=false;
- g_eEmailMismatch =false;
- if ( stat(ERR_LOG, &stBuff) == 0 )
- {
- remove(ERR_LOG);
- }
-
-#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Messaging_Email_p\\n", __LINE__, API_NAMESPACE);
-#endif
- //Create Email Message Handle
-
- g_bIsEmailSendFeatureSupported = TCTCheckSystemInfoFeatureSupported(EMAIL_FEATURE, API_NAMESPACE);
-
- int nRet = email_create_message(&g_hEmail);
-
- if(! g_bIsEmailSendFeatureSupported )
- {
- if(nRet == EMAILS_ERROR_NOT_SUPPORTED)
- {
- FPRINTF("[Line : %d][%s] email_create_message() returned %s error for unsupported feature :success \\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- g_eEmailNotSupported=true;
- }
- else
- {
- FPRINTF("[Line : %d][%s] email_create_message() returned %s error for unsupported feature,error mismatch :Failure \\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- g_eEmailMismatch=true;
- }
- return ;
- }
-
- if ( nRet == EMAILS_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] Email message handle created successfully in precondition\\n", __LINE__, API_NAMESPACE);
- g_bEmailCreation = true;
-
- //Initialize recipient email address value from configuration file
- if ( true == GetValueFromConfigFile("EMAIL_RECIPIENT", g_pstrRecipient, API_NAMESPACE) )
- {
-#if DEBUG
- FPRINTF("[Line : %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, g_pstrRecipient);
-#endif
- }
- else
- {
- FPRINTF("[Line : %d][%s] GetValueFromConfigFile returned error in start-up\\n", __LINE__, API_NAMESPACE);
-
- strncpy(g_pstrRecipient, EMAILADDRESS, CONFIG_VALUE_LEN_MAX-1);
- FPRINTF("[Line : %d][%s] Using recipient address : %s\\n", __LINE__, API_NAMESPACE, EMAILADDRESS);
- }
- }
- else
- {
- FPRINTF("[Line : %d][%s] Unable to create email message handle, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- g_bEmailCreation = false;
- }
-
- g_bIsEmailSendFeatureSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE, API_NAMESPACE) ||
- TCTCheckSystemInfoFeatureSupported(WIFI_FEATURE, API_NAMESPACE);
-}
-
-/**
-* @function ITs_email_cleanup
-* @description Called after each test, destroys email handle
-* @parameter NA
-* @return NA
-*/
-void ITs_email_cleanup(void)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Messaging_Email_p\\n", __LINE__, API_NAMESPACE);
-#endif
-
- //Destroy Email Message Handle
- if ( g_hEmail != NULL )
- {
- int nRet = email_destroy_message(g_hEmail);
- if ( nRet == 0 )
- {
- FPRINTF("[Line : %d][%s] Email message handle destroyed successfully\\n", __LINE__, API_NAMESPACE);
- }
- else
- {
- FPRINTF("[Line : %d][%s] Unable to destroy email message handle, error returned = %s\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- }
- }
-}
-
-/**
-* @function EmailTimeout
-* @description Called if some callback is not invoked for a particular EmailTimeout
-* @parameter gpointer data
-* @return gboolean
-*/
-gboolean EmailTimeout(gpointer data)
-{
- GMainLoop *pMainLoop = (GMainLoop *) data;
- if ( pMainLoop != NULL )
- {
- g_main_loop_quit(g_pEmailMainLoop);
- g_main_loop_unref(g_pEmailMainLoop);
- g_pEmailMainLoop = NULL;
- }
-
- FPRINTF("[Line : %d][%s] Callback Time-out\\n", __LINE__, API_NAMESPACE);
- return false;
-}
-
-void email_message_sent_callback(email_h email, email_sending_e result, void *user_data)
-{
- FPRINTF("[Line : %d][%s] Callback invoked: email_message_sent_callback \\n", __LINE__, API_NAMESPACE);
- g_bCallbackOccurred = true;
-
- if ( email == NULL )
- {
- FPRINTF("[Line : %d][%s] email is NULL in callback email_message_sent_callback\\n", __LINE__, API_NAMESPACE);
- if ( g_pEmailMainLoop )
- {
- g_main_loop_quit(g_pEmailMainLoop);
- g_main_loop_unref(g_pEmailMainLoop);
- g_pEmailMainLoop = NULL;
- }
- return;
- }
-
- if ( result == EMAIL_SENDING_SUCCEEDED )
- {
- FPRINTF("[Line : %d][%s] email_send_message succeeded\\n", __LINE__, API_NAMESPACE);
- g_bEmailSentSuccess = true;
- }
- else if ( result == EMAIL_SENDING_FAILED )
- {
- FPRINTF("[Line : %d][%s] email_send_message failed\\n", __LINE__, API_NAMESPACE);
- g_bEmailSentSuccess = false;
- }
-
- if ( g_pEmailMainLoop )
- {
- g_main_loop_quit(g_pEmailMainLoop);
- g_main_loop_unref(g_pEmailMainLoop);
- g_pEmailMainLoop = NULL;
- }
-}
-
-
-/** @addtogroup itc-email-testcases
-* @brief Integration testcases for module email
-* @ingroup itc-email
-* @{
-*/
-
-//& purpose Adds and removes attachment to an email message
-//& type: auto
-/**
-* @testcase ITc_email_add_remove_attach_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Adds and removes attachment to an email message
-* @scenario Creates an email message\n
-* Adds a file as an attachment\n
-* Removes the attachment\n
-* Destroys the email message
-* @apicovered email_add_attach, email_remove_all_attachments
-* @passcase If adds and removes the attachment to the email message successfully
-* @failcase If fails to add and remove attachment to the email message
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_email_add_remove_attach_p(void)
-{
- START_TEST;
-
- //Target API
- /**** Add Attachment to the Email Message ****/
- char *pszImagePath = EmailGetDataPath(IMAGE_NAME);
- if(pszImagePath == NULL)
- {
- FPRINTF("[Line : %d][%s] EmailGetDataPath failed,\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- int nRet = email_add_attach(g_hEmail, pszImagePath);
- PRINT_RESULT_CLEANUP(EMAILS_ERROR_NONE, nRet, "email_add_attach", EmailGetError(nRet),FREE_MEMORY(pszImagePath));
-
- //Target API
- /**** Clears All Attachments of the Email Message ****/
- nRet = email_remove_all_attachments(g_hEmail);
- PRINT_RESULT_CLEANUP(EMAILS_ERROR_NONE, nRet, "email_remove_all_attachments", EmailGetError(nRet),FREE_MEMORY(pszImagePath));
-
- FREE_MEMORY(pszImagePath);
-
- return 0;
-}
-
-//& purpose Adds and removes recipient to an email message
-//& type: auto
-/**
-* @testcase ITc_email_add_remove_recipient_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Adds and removes recipient to an email message
-* @scenario Creates an email message\n
-* Adds a recipient\n
-* Removes the recipient\n
-* Destroys the email message
-* @apicovered email_add_recipient, email_remove_all_recipients
-* @passcase If adds and removes the recipient to the email message successfully
-* @failcase If fails to add and remove recipient to the email message
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_email_add_remove_recipient_p(void)
-{
- START_TEST;
-
- email_recipient_type_e recipient_type[] = { EMAIL_RECIPIENT_TYPE_TO, EMAIL_RECIPIENT_TYPE_CC, EMAIL_RECIPIENT_TYPE_BCC };
- int enum_size = sizeof(recipient_type) / sizeof(recipient_type[0]);
- int enum_counter = 0;
-
- for ( enum_counter=0; enum_counter<enum_size; enum_counter++)
- {
- //Target API
- /**** Add Recipient to the Email Message ****/
- int nRet = email_add_recipient(g_hEmail, recipient_type[enum_counter], g_pstrRecipient);
- if ( nRet != EMAILS_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] email_add_recipient failed for recipient type = %s, error returned = %s\\n", __LINE__, API_NAMESPACE,
- EmailGetRecipientType(recipient_type[enum_counter]), EmailGetError(nRet));
- return 1;
- }
-
- //Target API
- /**** Remove All Recipients of the Email Message ****/
- nRet = email_remove_all_recipients(g_hEmail);
- if ( nRet != EMAILS_ERROR_NONE )
- {
- FPRINTF("[Line : %d][%s] email_remove_all_recipients failed for recipient type = %s, error returned = %s\\n", __LINE__, API_NAMESPACE,
- EmailGetRecipientType(recipient_type[enum_counter]), EmailGetError(nRet));
- return 1;
- }
- }
-
- return 0;
-}
-
-//& purpose Create and destroy an email message handle
-//& type: auto
-/**
-* @testcase ITc_email_create_destroy_message_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Destroys an email message handle
-* @scenario Creates an Email service\n
-* Destroys an Email service
-* @apicovered email_create_message, email_destroy_message
-* @passcase If creates and destroys the email message handle
-* @failcase If fails to create and destroy the email message handle
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_email_create_destroy_message_p(void)
-{
- START_TEST;
-
- email_h email = NULL;
-
- //Target API
- /**** Create Email Message Handle ****/
- int nRet = email_create_message(&email);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_create_message", EmailGetError(nRet));
- CHECK_HANDLE(email, "email_create_message");
-
- //Target API
- /**** Destroy Email Message Handle ****/
- nRet = email_destroy_message(email);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_destroy_message", EmailGetError(nRet));
-
- return 0;
-}
-
-//& purpose Saves an email message in outbox
-//& type: auto
-/**
-* @testcase ITc_email_save_message_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Creates an email message handle for sending an email message
-* @scenario Creates an email message\n
-* Saves the email message in outbox\n
-* Destroys the email message
-* @apicovered email_save_message
-* @passcase If saves the email message successfully
-* @failcase If fails to save the email message
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_email_save_message_p(void)
-{
- START_TEST;
-
- //Create an email message with attachment
- bool bRet = CreateEmailMessageWithAttachment(g_hEmail);
- if ( bRet == false )
- {
- FPRINTF("[Line : %d][%s] Failed to create email message\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- //Target API
- /**** Save Email Message ****/
- int nRet = email_save_message(g_hEmail);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_save_message", EmailGetError(nRet));
-
- return 0;
-}
-
-//& purpose Sends an email message with attachment
-//& type: auto
-/**
-* @testcase ITc_email_send_message_with_attachment_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Creates an email message handle for sending an email message
-* @scenario Creates an email message\n
-* Sends the email message\n
-* Destroys the email message
-* @apicovered email_save_message, email_send_message, email_set_message_sent_cb, email_unset_message_sent_cb
-* @passcase If sends an email message successfully
-* @failcase If fails to send the email message
-* @precondition An email account should be manually added to the device before executing this test
-* @postcondition NA
-*/
-int ITc_email_send_message_with_attachment_p(void)
-{
- START_TEST;
-
- g_bCallbackOccurred = false;
- g_bEmailSentSuccess = false;
-
- //Create an email message with attachment
- bool bRet = CreateEmailMessageWithAttachment(g_hEmail);
- if ( bRet == false )
- {
- FPRINTF("[Line : %d][%s] failed to create email message\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- //Save Email Message
- int nRet = email_save_message(g_hEmail);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_save_message", EmailGetError(nRet));
-
- /* Set Email Message Sent Callback Function */
- nRet = email_set_message_sent_cb(g_hEmail, email_message_sent_callback, NULL);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_set_message_sent_cb", EmailGetError(nRet));
-
- //Target API
- /**** Send Email Message ****/
- nRet = email_send_message(g_hEmail, true);
- if ( !g_bIsEmailSendFeatureSupported )
- {
- if ( nRet == TIZEN_ERROR_NOT_SUPPORTED )
- {
- FPRINTF("[Line : %d][%s] email_send_message() returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- email_unset_message_sent_cb(g_hEmail);
- return 0;
- }
-
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
-
- PRINT_RESULT_CLEANUP(EMAILS_ERROR_NONE, nRet, "email_send_message", EmailGetError(nRet), email_unset_message_sent_cb(g_hEmail));
-
- int nEmailTimeoutId = 0;
- RUN_POLLING_LOOP;
-
- if ( !g_bCallbackOccurred )
- {
- FPRINTF("[Line : %d][%s] email_send_message failed to invoke callback\\n", __LINE__, API_NAMESPACE);
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
- if ( !g_bEmailSentSuccess )
- {
- FPRINTF("[Line : %d][%s] email_send_message invoked callback with email_sending_e = false\\n", __LINE__, API_NAMESPACE);
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
-
- /* Unset Email Message Sent Callback Function */
- nRet = email_unset_message_sent_cb(g_hEmail);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_unset_message_sent_cb", EmailGetError(nRet));
-
- return 0;
-}
-
-//& purpose Sends an email message without attachment
-//& type: auto
-/**
-* @testcase ITc_email_send_message_without_attachment_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Creates an email message handle for sending an email message
-* @scenario Creates an email message\n
-* Sends the email message\n
-* Destroys the email message
-* @apicovered email_send_message, email_save_message, email_set_message_sent_cb, email_unset_message_sent_cb
-* @passcase If sends an email message successfully
-* @failcase If fails to send the email message
-* @precondition An email account should be manually added to the device before executing this test
-* @postcondition NA
-*/
-int ITc_email_send_message_without_attachment_p(void)
-{
- START_TEST;
-
- g_bCallbackOccurred = false;
- g_bEmailSentSuccess = false;
-
- //Create an email message with attachment
- bool bRet = CreateEmailMessageWithoutAttachment(g_hEmail);
- if ( bRet == false )
- {
- FPRINTF("[Line : %d][%s] failed to create email message\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- //Save Email Message
- int nRet = email_save_message(g_hEmail);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_save_message", EmailGetError(nRet));
-
- /* Set Email Message Sent Callback Function */
- nRet = email_set_message_sent_cb(g_hEmail, email_message_sent_callback, NULL);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_set_message_sent_cb", EmailGetError(nRet));
-
- //Target API
- /**** Send Email Message ****/
- nRet = email_send_message(g_hEmail, true);
- if ( !g_bIsEmailSendFeatureSupported )
- {
- if ( nRet == TIZEN_ERROR_NOT_SUPPORTED )
- {
- FPRINTF("[Line : %d][%s] email_send_message() returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- email_unset_message_sent_cb(g_hEmail);
- return 0;
- }
-
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
-
- PRINT_RESULT_CLEANUP(EMAILS_ERROR_NONE, nRet, "email_send_message", EmailGetError(nRet), email_unset_message_sent_cb(g_hEmail));
-
- int nEmailTimeoutId = 0;
- RUN_POLLING_LOOP;
-
- if ( !g_bCallbackOccurred )
- {
- FPRINTF("[Line : %d][%s] email_send_message failed to invoke callback\\n", __LINE__, API_NAMESPACE);
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
- if ( !g_bEmailSentSuccess )
- {
- FPRINTF("[Line : %d][%s] email_send_message invoked callback with email_sending_e = false\\n", __LINE__, API_NAMESPACE);
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
-
- /* Unset Email Message Sent Callback Function */
- nRet = email_unset_message_sent_cb(g_hEmail);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_unset_message_sent_cb", EmailGetError(nRet));
-
- return 0;
-}
-
-//& purpose Populates the body of an email message
-//& type: auto
-/**
-* @testcase ITc_email_set_body_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Sets the subject of an email message
-* @scenario Creates an Email service\n
-* Populates the body of an email message\n
-* Destroys an Email service
-* @apicovered email_set_body
-* @passcase If populates the body of email message successfully
-* @failcase If fails to populate the body of email message
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_email_set_body_p(void)
-{
- START_TEST;
-
- //Target API
- /**** Populate the body of Email Message ****/
- int nRet = email_set_body(g_hEmail, EMAILBODY);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_set_body", EmailGetError(nRet));
-
- return 0;
-}
-
-//& purpose Register and unregister email message sent callback function
-//& type: auto
-/**
-* @testcase ITc_email_set_unset_message_sent_cb_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Creates an email message handle for sending an email message
-* @scenario Creates an email message\n
-* Registers email message sent callback function\n
-* Sends the email message\n
-* Unregisters email message sent callback function\n
-* Destroys the email message
-* @apicovered email_set_message_sent_cb, email_send_message, email_unset_message_sent_cb
-* @passcase If registers & unregisters the email message sent callback function successfully
-* @failcase If fails to register & unregister the email message sent callback function
-* @precondition An email account should be manually added to the device before executing this test
-* @postcondition NA
-*/
-int ITc_email_set_unset_message_sent_cb_p(void)
-{
- START_TEST;
-
- bool bRet = CreateEmailMessageWithoutAttachment(g_hEmail);
- if ( bRet == false )
- {
- FPRINTF("[Line : %d][%s] failed to create email message without attachment\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- int nRet = email_save_message(g_hEmail);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_save_message", EmailGetError(nRet));
-
- g_bCallbackOccurred = false;
- g_bEmailSentSuccess = false;
-
- //Target API
- /**** Set Email Message Sent Callback Function ****/
- nRet = email_set_message_sent_cb(g_hEmail, email_message_sent_callback, NULL);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_set_message_sent_cb", EmailGetError(nRet));
-
- //Send an email message
- nRet = email_send_message(g_hEmail, true);
- PRINT_RESULT_CLEANUP(EMAILS_ERROR_NONE, nRet, "email_send_message", EmailGetError(nRet), email_unset_message_sent_cb(g_hEmail));
-
- if ( !g_bIsEmailSendFeatureSupported )
- {
- if ( nRet == TIZEN_ERROR_NOT_SUPPORTED )
- {
- FPRINTF("[Line : %d][%s] email_send_message() returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, EmailGetError(nRet));
- email_unset_message_sent_cb(g_hEmail);
- return 0;
- }
-
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
-
- int nEmailTimeoutId = 0;
- RUN_POLLING_LOOP;
-
- if ( !g_bCallbackOccurred )
- {
- FPRINTF("[Line : %d][%s] email_set_message_sent_cb failed to invoke callback\\n", __LINE__, API_NAMESPACE);
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
- if ( !g_bEmailSentSuccess )
- {
- FPRINTF("[Line : %d][%s] email_set_message_sent_cb invoked callback with email_sending_e = false\\n", __LINE__, API_NAMESPACE);
- email_unset_message_sent_cb(g_hEmail);
- return 1;
- }
-
- //Target API
- /**** Unset Email Message Sent Callback Function ****/
- nRet = email_unset_message_sent_cb(g_hEmail);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_unset_message_sent_cb", EmailGetError(nRet));
-
- g_bCallbackOccurred = false;
-
- //Send an email message
- nRet = email_send_message(g_hEmail, true);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_send_message", EmailGetError(nRet));
- RUN_POLLING_LOOP;
- if ( g_bCallbackOccurred )
- {
- FPRINTF("[Line : %d][%s] email_unset_message_sent_cb failed to stop callback\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- return 0;
-}
-
-//& purpose Sets the subject of an email message
-//& type: auto
-/**
-* @testcase ITc_email_set_subject_p
-* @since_tizen 2.3
-* @author SRID(gupta.sanjay)
-* @reviewer SRID(ravi.kumar2)
-* @type auto
-* @description Sets the subject of an email message
-* @scenario Creates an Email service\n
-* Sets the subject of an email message\n
-* Destroys an Email service
-* @apicovered email_set_subject
-* @passcase If sets the subject of email message successfully
-* @failcase If fails to set the subject of email message
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_email_set_subject_p(void)
-{
- START_TEST;
-
- //Target API
- /**** Set the subject of Email Message ****/
- int nRet = email_set_subject(g_hEmail, EMAILSUBJECT);
- PRINT_RESULT(EMAILS_ERROR_NONE, nRet, "email_set_subject", EmailGetError(nRet));
-
- return 0;
-}
-/** @} */
-/** @} */
+++ /dev/null
-//
-// 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 <stdio.h>
-#include <string.h>
-#include "tct_common.h"
-
-#ifdef MOBILE //Starts MOBILE
-#include "tct-email-native_mobile.h"
-#endif //MOBILE //End MOBILE
-
-#ifdef WEARABLE //Starts WEARABLE
-#include "tct-email-native_wearable.h"
-#endif //WEARABLE //End WEARABLE
-
-#ifdef TV //Starts TV
-#include "tct-email-native_tv.h"
-#endif //TV //End TV
-
-#ifdef TIZENIOT //Starts TIZENIOT
-#include "tct-email-native_tizeniot.h"
-#endif //TIZENIOT //End TIZENIOT
-
-
-#include <malloc.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <glib.h>
-#include <stdbool.h>
-
-#include <app.h>
-#include <dlog.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <errno.h>
-
-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;
-}
+++ /dev/null
-//
-// 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_EMAIL-NATIVE_H__
-#define __TCT_EMAIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void ITs_email_startup(void);
-extern void ITs_email_cleanup(void);
-
-extern int ITc_email_add_remove_attach_p(void);
-extern int ITc_email_add_remove_recipient_p(void);
-extern int ITc_email_create_destroy_message_p(void);
-extern int ITc_email_save_message_p(void);
-extern int ITc_email_send_message_with_attachment_p(void);
-extern int ITc_email_send_message_without_attachment_p(void);
-extern int ITc_email_set_body_p(void);
-extern int ITc_email_set_unset_message_sent_cb_p(void);
-extern int ITc_email_set_subject_p(void);
-
-testcase tc_array[] = {
- {"ITc_email_add_remove_attach_p",ITc_email_add_remove_attach_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_add_remove_recipient_p",ITc_email_add_remove_recipient_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_create_destroy_message_p",ITc_email_create_destroy_message_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_save_message_p",ITc_email_save_message_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_send_message_with_attachment_p",ITc_email_send_message_with_attachment_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_send_message_without_attachment_p",ITc_email_send_message_without_attachment_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_body_p",ITc_email_set_body_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_unset_message_sent_cb_p",ITc_email_set_unset_message_sent_cb_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_subject_p",ITc_email_set_subject_p,ITs_email_startup,ITs_email_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_EMAIL-NATIVE_H__
+++ /dev/null
-//
-// 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_EMAIL-NATIVE_H__
-#define __TCT_EMAIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void ITs_email_startup(void);
-extern void ITs_email_cleanup(void);
-
-extern int ITc_email_add_remove_attach_p(void);
-extern int ITc_email_add_remove_recipient_p(void);
-extern int ITc_email_create_destroy_message_p(void);
-extern int ITc_email_save_message_p(void);
-extern int ITc_email_send_message_with_attachment_p(void);
-extern int ITc_email_send_message_without_attachment_p(void);
-extern int ITc_email_set_body_p(void);
-extern int ITc_email_set_unset_message_sent_cb_p(void);
-extern int ITc_email_set_subject_p(void);
-
-testcase tc_array[] = {
- {"ITc_email_add_remove_attach_p",ITc_email_add_remove_attach_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_add_remove_recipient_p",ITc_email_add_remove_recipient_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_create_destroy_message_p",ITc_email_create_destroy_message_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_save_message_p",ITc_email_save_message_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_send_message_with_attachment_p",ITc_email_send_message_with_attachment_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_send_message_without_attachment_p",ITc_email_send_message_without_attachment_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_body_p",ITc_email_set_body_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_unset_message_sent_cb_p",ITc_email_set_unset_message_sent_cb_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_subject_p",ITc_email_set_subject_p,ITs_email_startup,ITs_email_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_EMAIL-NATIVE_H__
+++ /dev/null
-//
-// 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_EMAIL-NATIVE_H__
-#define __TCT_EMAIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void ITs_email_startup(void);
-extern void ITs_email_cleanup(void);
-
-extern int ITc_email_add_remove_attach_p(void);
-extern int ITc_email_add_remove_recipient_p(void);
-extern int ITc_email_create_destroy_message_p(void);
-extern int ITc_email_save_message_p(void);
-extern int ITc_email_send_message_with_attachment_p(void);
-extern int ITc_email_send_message_without_attachment_p(void);
-extern int ITc_email_set_body_p(void);
-extern int ITc_email_set_unset_message_sent_cb_p(void);
-extern int ITc_email_set_subject_p(void);
-
-testcase tc_array[] = {
- {"ITc_email_add_remove_attach_p",ITc_email_add_remove_attach_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_add_remove_recipient_p",ITc_email_add_remove_recipient_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_create_destroy_message_p",ITc_email_create_destroy_message_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_save_message_p",ITc_email_save_message_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_send_message_with_attachment_p",ITc_email_send_message_with_attachment_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_send_message_without_attachment_p",ITc_email_send_message_without_attachment_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_body_p",ITc_email_set_body_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_unset_message_sent_cb_p",ITc_email_set_unset_message_sent_cb_p,ITs_email_startup,ITs_email_cleanup},
- {"ITc_email_set_subject_p",ITc_email_set_subject_p,ITs_email_startup,ITs_email_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_EMAIL-NATIVE_H__
tv:armv7l:itc:location-manager;
tv:armv7l:itc:phonenumber-utils;
tv:armv7l:itc:contacts-service2;
-tv:armv7l:itc:email;
tv:armv7l:itc:messages;
tv:armv7l:itc:context;
tv:armv7l:itc:sync-manager;