+++ /dev/null
-%define MODULE_NAME email
-%define MODULE_LIBNAME capi-messaging-email
-Name: core-%{MODULE_NAME}-tests
-Summary: Core API unit TC (%{name})
-Version: 0.1
-Release: 0
-Group: Development/Tools
-License: Apache-2.0
-Source0: %{name}-%{version}.tar.gz
-BuildRequires: pkgconfig(%{MODULE_LIBNAME})
-BuildRequires: cmake
-BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(storage)
-BuildRequires: pkgconfig(glib-2.0)
-%description
-Core API unit 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="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%else
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -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/utc/%{name}.xml %{buildroot}/usr/share/packages/
-
-%post
-
-%postun
-
-
-%files
-/usr/apps/%{name}/*
-/usr/share/packages/%{name}.xml
-/usr/share/license/%{name}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="core-email-tests" version="0.1.0" api-version="6.0">
- <label>CoreEmailTest</label>
- <author email="test@tizen.org" href="www.tizen.org">test</author>
- <description>Core API test Application</description>
- <ui-application appid="core.email-tests" exec="/usr/apps/core-email-tests/bin/tct-email-core" 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>
+++ /dev/null
-SET(PKG_NAME "email")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-core")
-SET(RPM_NAME "core-${PKG_NAME}-tests")
-SET(CAPI_LIB "capi-messaging-email")
-SET(TC_SOURCES
- utc-messaging-email.c
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- ${CAPI_LIB}
- capi-appfw-application
- capi-system-info
- glib-2.0
- storage
- 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}
-)
-
-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
-#!/bin/bash
-#
-# Copyright (c) 2016 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.
-#
-
-# extract TCT configuration directory from TCT_CONFIG_FILE (/home/owner/share/TCT_CONFIG)
-APP_DIR=/usr/apps
-TCT_CONFIG_FILE=/home/owner/share/TCT_CONFIG
-PKG_NAME=$1
-MODE=$2
-
-if [ $PKG_NAME == "" ] || [ $MODE == "" ]; then
- echo ""
- echo "****************FATAL ERROR : post-inst.sh***************************"
- echo "PackageName/Mode is not supplied with post-inst.sh"
- echo "Necessary Resource Files if any can not be processed"
- echo "********************************************************************"
- echo ""
- return;
-fi
-
-if [ ! -f $TCT_CONFIG_FILE ];then
- echo ""
- echo "****************FATAL ERROR : $PKG_NAME/post-inst.sh***************************"
- echo "$TCT_CONFIG_FILE is not Found : Can Not Read TCT Configuration Directory"
- echo "$PKG_NAME : Necessary Resource Files if any can not be processed"
- echo "********************************************************************"
- echo ""
- return;
-fi
-DEVICE_SUITE_TARGET_30=`cat $TCT_CONFIG_FILE | grep DEVICE_SUITE_TARGET_30 | cut -f 2- -d '='`
-if [ $DEVICE_SUITE_TARGET_30 == "" ]; then
- echo ""
- echo "****************FATAL ERROR : $PKG_NAME/post-inst.sh***************************"
- echo "'DEVICE_SUITE_TARGET_30' key-value pair is not Found"
- echo "$PKG_NAME : Necessary Resource Files if any can not be processed"
- echo "********************************************************************"
- echo ""
- return;
-fi
-DEVICE_USER_30=`cat $TCT_CONFIG_FILE | grep DEVICE_USER_30 | cut -f 2- -d '='`
-if [ $DEVICE_USER_30 == "" ]; then
- echo ""
- echo "****************FATAL ERROR : $PKG_NAME/post-inst.sh***************************"
- echo "'DEVICE_USER_30' key-value pair is not Found"
- echo "$PKG_NAME : Necessary Resource Files if any can not be processed"
- echo "********************************************************************"
- echo ""
- return;
-fi
-DEVICE_PHYSICAL_STORAGE_30=`cat $TCT_CONFIG_FILE | grep DEVICE_PHYSICAL_STORAGE_30 | cut -f 2- -d '='`
-if [ $DEVICE_PHYSICAL_STORAGE_30 == "" ]; then
- echo ""
- echo "****************FATAL ERROR : $PKG_NAME/post-inst.sh***************************"
- echo "'DEVICE_PHYSICAL_STORAGE_30' key-value pair is not Found"
- echo "$PKG_NAME : Necessary Resource Files if any can not be processed"
- echo "********************************************************************"
- echo ""
- return;
-fi
-
-
-if [ $MODE == "inst" ]; then
- echo "Installing pre-requisites for the package $PKG_NAME"
- mkdir -p $DEVICE_PHYSICAL_STORAGE_30/res
- echo "Installing the pre-requisites for the package $PKG_NAME ======> Completed"
-else
- echo "Un-installing the pre-requisites for the package $PKG_NAME"
- rm -rf $DEVICE_PHYSICAL_STORAGE_30/res
- #rm -rf $DEVICE_PHYSICAL_STORAGE_30/testemail.txt
- echo "Un-installing the pre-requisites for the package $PKG_NAME ======> Completed"
-fi
+++ /dev/null
-email_add_attach
-email_add_recipient
-email_create_message
-email_destroy_message
-email_remove_all_attachments
-email_remove_all_recipients
-email_save_message
-email_send_message
-email_set_body
-email_set_message_sent_cb
-email_set_subject
-email_unset_message_sent_cb
+++ /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 <malloc.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <glib.h>
-#include <stdbool.h>
-#include "tct_common.h"
-#include <app.h>
-#include <dlog.h>
-
-
-
-#ifdef MOBILE
-#include "tct-email-core_mobile.h"
-#endif //MOBILE
-
-#ifdef TIZENIOT
-#include "tct-email-core_tizeniot.h"
-#endif //TIZENIOT
-
-#ifdef WEARABLE
-#include "tct-email-core_wearable.h"
-#endif //WEARABLE
-
-#ifdef TV
-#include "tct-email-core_tv.h"
-#endif // TV
-
-
-
-
-
-
-
-
-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)) )
- {
- DUMP_UTC_ERRLOG();
- 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);
-
- CLOSE_UTC_ERRLOG();
- 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 utc_messaging_email_startup(void);
-extern void utc_messaging_email_cleanup(void);
-
-extern int utc_messaging_email_create_message_p(void);
-extern int utc_messaging_email_create_message_n(void);
-extern int utc_messaging_email_destroy_message_p(void);
-extern int utc_messaging_email_destroy_message_n(void);
-extern int utc_messaging_email_set_subject_p(void);
-extern int utc_messaging_email_set_subject_n(void);
-extern int utc_messaging_email_set_body_p(void);
-extern int utc_messaging_email_set_body_n(void);
-extern int utc_messaging_email_add_recipient_p(void);
-extern int utc_messaging_email_add_recipient_n(void);
-extern int utc_messaging_email_remove_all_recipients_p(void);
-extern int utc_messaging_email_remove_all_recipients_n(void);
-extern int utc_messaging_email_save_message_p(void);
-extern int utc_messaging_email_save_message_n(void);
-extern int utc_messaging_email_add_attach_p(void);
-extern int utc_messaging_email_add_attach_n(void);
-extern int utc_messaging_email_remove_all_attachments_p(void);
-extern int utc_messaging_email_remove_all_attachments_n(void);
-extern int utc_messaging_email_send_message_p(void);
-extern int utc_messaging_email_send_message_n(void);
-extern int utc_messaging_email_set_message_sent_cb_p(void);
-extern int utc_messaging_email_set_message_sent_cb_n(void);
-extern int utc_messaging_email_unset_message_sent_cb_p(void);
-extern int utc_messaging_email_unset_message_sent_cb_n(void);
-
-testcase tc_array[] = {
- {"utc_messaging_email_create_message_p",utc_messaging_email_create_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_create_message_n",utc_messaging_email_create_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_destroy_message_p",utc_messaging_email_destroy_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_destroy_message_n",utc_messaging_email_destroy_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_subject_p",utc_messaging_email_set_subject_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_subject_n",utc_messaging_email_set_subject_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_body_p",utc_messaging_email_set_body_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_body_n",utc_messaging_email_set_body_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_recipient_p",utc_messaging_email_add_recipient_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_recipient_n",utc_messaging_email_add_recipient_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_recipients_p",utc_messaging_email_remove_all_recipients_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_recipients_n",utc_messaging_email_remove_all_recipients_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_save_message_p",utc_messaging_email_save_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_save_message_n",utc_messaging_email_save_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_attach_p",utc_messaging_email_add_attach_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_attach_n",utc_messaging_email_add_attach_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_attachments_p",utc_messaging_email_remove_all_attachments_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_attachments_n",utc_messaging_email_remove_all_attachments_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_send_message_p",utc_messaging_email_send_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_send_message_n",utc_messaging_email_send_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_message_sent_cb_p",utc_messaging_email_set_message_sent_cb_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_message_sent_cb_n",utc_messaging_email_set_message_sent_cb_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_unset_message_sent_cb_p",utc_messaging_email_unset_message_sent_cb_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_unset_message_sent_cb_n",utc_messaging_email_unset_message_sent_cb_n,utc_messaging_email_startup,utc_messaging_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 utc_messaging_email_startup(void);
-extern void utc_messaging_email_cleanup(void);
-
-extern int utc_messaging_email_create_message_p(void);
-extern int utc_messaging_email_create_message_n(void);
-extern int utc_messaging_email_destroy_message_p(void);
-extern int utc_messaging_email_destroy_message_n(void);
-extern int utc_messaging_email_set_subject_p(void);
-extern int utc_messaging_email_set_subject_n(void);
-extern int utc_messaging_email_set_body_p(void);
-extern int utc_messaging_email_set_body_n(void);
-extern int utc_messaging_email_add_recipient_p(void);
-extern int utc_messaging_email_add_recipient_n(void);
-extern int utc_messaging_email_remove_all_recipients_p(void);
-extern int utc_messaging_email_remove_all_recipients_n(void);
-extern int utc_messaging_email_save_message_p(void);
-extern int utc_messaging_email_save_message_n(void);
-extern int utc_messaging_email_add_attach_p(void);
-extern int utc_messaging_email_add_attach_n(void);
-extern int utc_messaging_email_remove_all_attachments_p(void);
-extern int utc_messaging_email_remove_all_attachments_n(void);
-extern int utc_messaging_email_send_message_p(void);
-extern int utc_messaging_email_send_message_n(void);
-extern int utc_messaging_email_set_message_sent_cb_p(void);
-extern int utc_messaging_email_set_message_sent_cb_n(void);
-extern int utc_messaging_email_unset_message_sent_cb_p(void);
-extern int utc_messaging_email_unset_message_sent_cb_n(void);
-
-testcase tc_array[] = {
- {"utc_messaging_email_create_message_p",utc_messaging_email_create_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_create_message_n",utc_messaging_email_create_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_destroy_message_p",utc_messaging_email_destroy_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_destroy_message_n",utc_messaging_email_destroy_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_subject_p",utc_messaging_email_set_subject_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_subject_n",utc_messaging_email_set_subject_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_body_p",utc_messaging_email_set_body_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_body_n",utc_messaging_email_set_body_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_recipient_p",utc_messaging_email_add_recipient_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_recipient_n",utc_messaging_email_add_recipient_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_recipients_p",utc_messaging_email_remove_all_recipients_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_recipients_n",utc_messaging_email_remove_all_recipients_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_save_message_p",utc_messaging_email_save_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_save_message_n",utc_messaging_email_save_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_attach_p",utc_messaging_email_add_attach_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_attach_n",utc_messaging_email_add_attach_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_attachments_p",utc_messaging_email_remove_all_attachments_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_attachments_n",utc_messaging_email_remove_all_attachments_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_send_message_p",utc_messaging_email_send_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_send_message_n",utc_messaging_email_send_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_message_sent_cb_p",utc_messaging_email_set_message_sent_cb_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_message_sent_cb_n",utc_messaging_email_set_message_sent_cb_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_unset_message_sent_cb_p",utc_messaging_email_unset_message_sent_cb_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_unset_message_sent_cb_n",utc_messaging_email_unset_message_sent_cb_n,utc_messaging_email_startup,utc_messaging_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 utc_messaging_email_startup(void);
-extern void utc_messaging_email_cleanup(void);
-
-extern int utc_messaging_email_create_message_p(void);
-extern int utc_messaging_email_create_message_n(void);
-extern int utc_messaging_email_destroy_message_p(void);
-extern int utc_messaging_email_destroy_message_n(void);
-extern int utc_messaging_email_set_subject_p(void);
-extern int utc_messaging_email_set_subject_n(void);
-extern int utc_messaging_email_set_body_p(void);
-extern int utc_messaging_email_set_body_n(void);
-extern int utc_messaging_email_add_recipient_p(void);
-extern int utc_messaging_email_add_recipient_n(void);
-extern int utc_messaging_email_remove_all_recipients_p(void);
-extern int utc_messaging_email_remove_all_recipients_n(void);
-extern int utc_messaging_email_save_message_p(void);
-extern int utc_messaging_email_save_message_n(void);
-extern int utc_messaging_email_add_attach_p(void);
-extern int utc_messaging_email_add_attach_n(void);
-extern int utc_messaging_email_remove_all_attachments_p(void);
-extern int utc_messaging_email_remove_all_attachments_n(void);
-extern int utc_messaging_email_send_message_p(void);
-extern int utc_messaging_email_send_message_n(void);
-extern int utc_messaging_email_set_message_sent_cb_p(void);
-extern int utc_messaging_email_set_message_sent_cb_n(void);
-extern int utc_messaging_email_unset_message_sent_cb_p(void);
-extern int utc_messaging_email_unset_message_sent_cb_n(void);
-
-testcase tc_array[] = {
- {"utc_messaging_email_create_message_p",utc_messaging_email_create_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_create_message_n",utc_messaging_email_create_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_destroy_message_p",utc_messaging_email_destroy_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_destroy_message_n",utc_messaging_email_destroy_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_subject_p",utc_messaging_email_set_subject_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_subject_n",utc_messaging_email_set_subject_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_body_p",utc_messaging_email_set_body_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_body_n",utc_messaging_email_set_body_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_recipient_p",utc_messaging_email_add_recipient_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_recipient_n",utc_messaging_email_add_recipient_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_recipients_p",utc_messaging_email_remove_all_recipients_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_recipients_n",utc_messaging_email_remove_all_recipients_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_save_message_p",utc_messaging_email_save_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_save_message_n",utc_messaging_email_save_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_attach_p",utc_messaging_email_add_attach_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_add_attach_n",utc_messaging_email_add_attach_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_attachments_p",utc_messaging_email_remove_all_attachments_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_remove_all_attachments_n",utc_messaging_email_remove_all_attachments_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_send_message_p",utc_messaging_email_send_message_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_send_message_n",utc_messaging_email_send_message_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_message_sent_cb_p",utc_messaging_email_set_message_sent_cb_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_set_message_sent_cb_n",utc_messaging_email_set_message_sent_cb_n,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_unset_message_sent_cb_p",utc_messaging_email_unset_message_sent_cb_p,utc_messaging_email_startup,utc_messaging_email_cleanup},
- {"utc_messaging_email_unset_message_sent_cb_n",utc_messaging_email_unset_message_sent_cb_n,utc_messaging_email_startup,utc_messaging_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.
-//
-#include "assert.h"
-#include <messaging/email.h>
-#include <stdlib.h>
-#include <string.h>
-#include <storage.h>
-#include <glib-object.h>
-#include <glib-2.0/glib.h>
-
-#define CONFIG_LINE_LEN_MAX 2048 //maximum key-value line length
-#define CONFIG_VALUE_LEN_MAX 1024 //maximum length of value
-#define DEFAULT_ADDRESS "test-email-account-test@tizen.org"
-#define EAMIL_FEATURE "http://tizen.org/feature/email"
-
-static char* file="testemail.txt";
-static char* email_path=NULL;
-static char g_pstrRecipient[CONFIG_VALUE_LEN_MAX] = {0,};
-static bool is_email_supported = false;
-
-static bool storage_device_cb(int storage_id, storage_type_e type, storage_state_e state, const char* path, void* user_data){
- if(type==STORAGE_TYPE_INTERNAL){
- email_path=(char*)malloc(strlen(path)+strlen(file)+5);
- snprintf(email_path, strlen(path)+strlen(file)+5,"%s/%s",path,file);
- return false;
- }
- return true;
-}
-
-bool _get_value_from_config(char* key, char* value)
-{
- if ( NULL == key )
- {
- return false;
- }
- FILE* pfilePtr = fopen(CONFIGFILE_PATH, "r");
- if ( NULL == pfilePtr )
- {
- return false;
- }
-
- char* pszKey = NULL;
- char* pszValue = NULL;
- char* pszDelim = "=\n";
- char szConfigLine[CONFIG_LINE_LEN_MAX] = {0,};
-
- while ( !feof(pfilePtr) )
- {
- if ( fgets(szConfigLine, CONFIG_LINE_LEN_MAX, pfilePtr) != NULL )
- {
- pszKey = strtok(szConfigLine, pszDelim);
- pszValue = strtok(NULL, pszDelim);
-
- if ( 0 == strcmp(pszKey, key) )
- {
- break;
- }
-
- pszKey = NULL;
- pszValue = NULL;
- }
- }
-
- fclose(pfilePtr);
- if ( NULL == pszValue )
- {
- return false;
- }
-
- if ( strlen(pszValue) >= CONFIG_VALUE_LEN_MAX )
- {
- return false;
- }
-
- memset(value, 0, CONFIG_VALUE_LEN_MAX);
- g_strlcpy(value, pszValue, CONFIG_VALUE_LEN_MAX);
- return true;
-}
-
-/**
- * @function utc_messaging_email_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void utc_messaging_email_startup(void)
-{
- /* start of TC */
- system_info_get_platform_bool(EAMIL_FEATURE, &is_email_supported);
-
- storage_foreach_device_supported(storage_device_cb,NULL);
- if ( true != _get_value_from_config("EMAIL_RECIPIENT", g_pstrRecipient) )
- {
- g_strlcpy(g_pstrRecipient, DEFAULT_ADDRESS, CONFIG_VALUE_LEN_MAX);
- }
-}
-
-/**
- * @function utc_messaging_email_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void utc_messaging_email_cleanup(void)
-{
-}
-
-/**
- * @testcase utc_messaging_email_create_message_p
- * @since_tizen 2.3
- * @description Test inserting for creating the message of email
- */
-int utc_messaging_email_create_message_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_create_message(&msg);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_destroy_message(msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_create_message_n
- * @since_tizen 2.3
- * @description Test fail inserting for creating the message of email
- */
-int utc_messaging_email_create_message_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_create_message(NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_destroy_message_p
- * @since_tizen 2.3
- * @description Test inserting for free the created message
- */
-int utc_messaging_email_destroy_message_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_destroy_message(msg);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_destroy_message(msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_destroy_message_n
- * @since_tizen 2.3
- * @description Test fail inserting for free the created message
- */
-int utc_messaging_email_destroy_message_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_destroy_message(NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_set_subject_p
- * @since_tizen 2.3
- * @description Test inserting for setting the subject in a message
- */
-int utc_messaging_email_set_subject_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_set_subject(msg, "title: First email!!!");
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_set_subject(msg, "title: First email!!!");
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_set_subject_n
- * @since_tizen 2.3
- * @description Test fail inserting for setting the subject in a message
- */
-int utc_messaging_email_set_subject_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_set_subject(NULL, "title: First email!!!");
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_set_body_p
- * @since_tizen 2.3
- * @description Test inserting for setting the body in a message
- */
-int utc_messaging_email_set_body_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_set_body(msg, "First SMS message!!!");
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_set_body(msg, "First SMS message!!!");
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_set_body_n
- * @since_tizen 2.3
- * @description Test fail inserting for setting the body in a message
- */
-int utc_messaging_email_set_body_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_set_body(NULL, "First SMS message!!!");
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-
-/**
- * @testcase utc_messaging_email_add_recipient_p
- * @since_tizen 2.3
- * @description Test inserting for adding the recipients in a message
- */
-int utc_messaging_email_add_recipient_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO,g_pstrRecipient);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO,g_pstrRecipient);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_add_recipient_n
- * @since_tizen 2.3
- * @description Test fail inserting for adding the recipients in a message
- */
-int utc_messaging_email_add_recipient_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_add_recipient(msg, 100, g_pstrRecipient);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO, g_pstrRecipient);
- assert_eq (ret, EMAILS_ERROR_INVALID_PARAMETER);
-
- ret = email_create_message(&msg);
-
- ret = email_add_recipient(msg, 100, g_pstrRecipient);
- assert_eq (ret, EMAILS_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_remove_all_recipients_p
- * @since_tizen 2.3
- * @description Test inserting for removing the recipients in a message
- */
-int utc_messaging_email_remove_all_recipients_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_remove_all_recipients(msg);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO, g_pstrRecipient);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_remove_all_recipients(msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_remove_all_recipients_n
- * @since_tizen 2.3
- * @description Test fail inserting for removing the recipients in a message
- */
-int utc_messaging_email_remove_all_recipients_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_remove_all_recipients(NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_save_message_p
- * @since_tizen 2.3
- * @description Test inserting for adding the message in a DB
- */
-int utc_messaging_email_save_message_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_save_message(msg);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_save_message(msg);
- assert_eq(ret, EMAILS_ERROR_NONE);
-
- ret = email_destroy_message(msg);
- assert_eq(ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_save_message_n
- * @since_tizen 2.3
- * @description Test fail inserting for adding the message in a DB
- */
-int utc_messaging_email_save_message_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_save_message(NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_add_attach_p
- * @since_tizen 2.3
- * @description Test inserting for adding the attachment in a message
- */
-int utc_messaging_email_add_attach_p(void)
-{
-
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
- FILE* file = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_add_attach(msg, email_path);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- file = fopen(email_path, "w");
- assert_neq (file, NULL);
- fclose(file);
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_add_attach(msg, email_path);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_add_attach_n
- * @since_tizen 2.3
- * @description Test fail inserting for adding the attachment in a message
- */
-int utc_messaging_email_add_attach_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_add_attach(NULL, NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_remove_all_attachments_p
- * @since_tizen 2.3
- * @description Test inserting for removing all attachments in a message
- */
-int utc_messaging_email_remove_all_attachments_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
- FILE* file = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_remove_all_attachments(msg);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- file = fopen(email_path, "w");
- assert_neq(file, NULL);
- fclose(file);
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_add_attach(msg, email_path);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_remove_all_attachments(msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_remove_all_attachments_n
- * @since_tizen 2.3
- * @description Test fail inserting for removing all attachments in a message
- */
-int utc_messaging_email_remove_all_attachments_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_remove_all_attachments(NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_send_message_p
- * @since_tizen 2.3
- * @description Test inserting for sending the message
- */
-int utc_messaging_email_send_message_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_send_message(msg, false);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO, g_pstrRecipient);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_set_body(msg, "First email message!!!");
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_save_message(msg);
- assert_eq(ret, EMAILS_ERROR_NONE);
-
- ret = email_send_message(msg, false);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_send_message_n
- * @since_tizen 2.3
- * @description Test fail inserting for sending the message
- */
-int utc_messaging_email_send_message_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_send_message(NULL, false);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-static void email_cb(email_h handle, email_sending_e result, void *user_data)
-{
- printf("CALLBACK EXECUTED\n");
- printf("transport status = %d\n", result);
-}
-
-/**
- * @testcase utc_messaging_email_set_message_sent_cb_p
- * @since_tizen 2.3
- * @description Test inserting for setting callback function of sending status
- */
-int utc_messaging_email_set_message_sent_cb_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_set_message_sent_cb(msg, email_cb, NULL);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_set_message_sent_cb(msg, email_cb, NULL);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_set_message_sent_cb_n
- * @since_tizen 2.3
- * @description Test fail inserting for setting callback function of sending status
- */
-int utc_messaging_email_set_message_sent_cb_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_set_message_sent_cb(NULL, NULL, NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_unset_message_sent_cb_p
- * @since_tizen 2.3
- * @description Test inserting for removing the callback function
- */
-int utc_messaging_email_unset_message_sent_cb_p(void)
-{
- int ret = EMAILS_ERROR_NONE;
- email_h msg = NULL;
-
- if (false == is_email_supported)
- {
- ret = email_unset_message_sent_cb(msg);
- assert_eq(ret, EMAILS_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = email_create_message(&msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_set_message_sent_cb(msg, email_cb, NULL);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- ret = email_unset_message_sent_cb(msg);
- assert_eq (ret, EMAILS_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_messaging_email_unset_message_sent_cb_n
- * @since_tizen 2.3
- * @description Test fail inserting for removing the callback function
- */
-int utc_messaging_email_unset_message_sent_cb_n(void)
-{
- int ret = EMAILS_ERROR_NONE;
-
- ret = email_unset_message_sent_cb(NULL);
- assert_eq (ret, (false == is_email_supported ? EMAILS_ERROR_NOT_SUPPORTED : EMAILS_ERROR_INVALID_PARAMETER));
-
- return 0;
-}
-
tv:armv7l:utc:geofence-manager;
tv:armv7l:utc:phonenumber-utils;
tv:armv7l:utc:contacts-service2;
-tv:armv7l:utc:email;
tv:armv7l:utc:messages;
tv:armv7l:utc:context;
tv:armv7l:utc:sync-manager;