update tizen source
[framework/messaging/msg-service.git] / TC / msgTC / MapiStorage / utc_msg_update_folder.c
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 *          Sangkoo Kim <sangkoo.kim@samsung.com>
9 *          Seunghwan Lee <sh.cat.lee@samsung.com>
10 *          SoonMin Jung <sm0415.jung@samsung.com>
11 *          Jae-Young Lee <jy4710.lee@samsung.com>
12 *          KeeBum Kim <keebum.kim@samsung.com>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
21 *
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
28 *
29 */
30
31 #include "utc_msg_update_folder.h"
32
33 static MSG_HANDLE_T msgHandle = NULL;
34 msg_message_t msgInfo;
35 MSG_SENDINGOPT_S sendOpt;
36
37 void startup(void)
38 {
39         MSG_ERROR_T err = MSG_SUCCESS;
40
41         err = msg_open_msg_handle(&msgHandle);
42         if (err != MSG_SUCCESS)
43         {
44                 tet_result(TET_FAIL);
45                 return;
46         }
47
48         msgInfo = msg_new_message();
49
50         memset(&sendOpt, 0x00, sizeof(sendOpt));
51
52         sendOpt.bSetting = false;
53
54         msg_add_message(msgHandle, msgInfo, &sendOpt);
55
56         msg_set_message_id(msgInfo, 0);
57 }
58 void cleanup(void)
59 {
60         msg_close_msg_handle(&msgHandle);
61 }
62
63 void utc_msg_update_folder_001()
64 {
65         MSG_ERROR_T err = MSG_SUCCESS;
66         MSG_FOLDER_INFO_S folderInfo;
67
68         memset(&folderInfo, 0x00, sizeof(folderInfo));
69
70         folderInfo.folderId = 0;
71         folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
72
73         strncpy(folderInfo.folderName, "Test folder", MAX_FOLDER_NAME_SIZE);
74
75         err = msg_update_folder(msgHandle, &folderInfo);
76         if (err != MSG_SUCCESS)
77         {
78                 tet_result(TET_FAIL);
79                 return;
80         }
81
82         tet_result(TET_PASS);
83 }
84
85 void utc_msg_update_folder_002()
86 {
87         MSG_ERROR_T err = MSG_SUCCESS;
88         MSG_FOLDER_INFO_S folderInfo;
89
90         memset(&folderInfo, 0x00, sizeof(folderInfo));
91
92         folderInfo.folderId = 0;
93         folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
94
95         strncpy(folderInfo.folderName, "Test folder", MAX_FOLDER_NAME_SIZE);
96
97         err = msg_update_folder(NULL, &folderInfo);
98         if (err != MSG_SUCCESS)
99         {
100                 tet_result(TET_PASS);
101                 return;
102         }
103
104         tet_result(TET_FAIL);
105 }