update tizen source
[framework/messaging/msg-service.git] / TC / msgTC / MapiTransport / utc_msg_mms_reject_message.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_mms_reject_message.h"
32
33 static MSG_HANDLE_T msgHandle = NULL;
34 msg_message_t msgInfo;
35 MSG_SENDINGOPT_S sendOpt;
36
37 void sentStatusCB(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
38 {
39         return;
40 }
41
42 void startup(void)
43 {
44         MSG_ERROR_T err = MSG_SUCCESS;
45         MMS_MESSAGE_DATA_S*      mms_data;
46         MMS_PAGE_S*     page[2];
47         MMS_MEDIA_S*    media[5];
48
49         err = msg_open_msg_handle(&msgHandle);
50         if (err != MSG_SUCCESS)
51         {
52                 tet_result(TET_FAIL);
53                 return;
54         }
55
56         msg_reg_sent_status_callback(msgHandle, &sentStatusCB, (void*)"sent status callback");
57
58         msgInfo = msg_new_message();
59         mms_data = msg_mms_create_message();
60
61         msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
62         msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
63         msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
64
65         //------------>  1st Slide Composing
66         page[0] = msg_mms_add_page(mms_data, 5440);
67
68         media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
69         media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
70         media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
71         media[2]->sMedia.sText.nColor = 0x000000;
72         media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
73         media[2]->sMedia.sText.bBold = true;
74
75         //------------>  2nd Slide Composing
76         page[1] = msg_mms_add_page(mms_data, 4544);
77
78         media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
79         media[3]->sMedia.sText.nColor = 0x000000;
80         media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
81         media[3]->sMedia.sText.bItalic = true;
82         media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
83         strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
84
85         msg_mms_set_message_body(msgInfo, mms_data);
86
87         msg_mms_destroy_message(mms_data);
88
89         msg_add_address(msgInfo, "01000000000", MSG_RECIPIENTS_TYPE_TO);
90
91         memset(&sendOpt, 0x00, sizeof(sendOpt));
92
93         sendOpt.bSetting = false;
94 }
95 void cleanup(void)
96 {
97         msg_close_msg_handle(&msgHandle);
98 }
99
100 void utc_msg_mms_reject_message_001()
101 {
102         int err = MSG_SUCCESS;
103         MSG_REQUEST_S req;
104
105         memset(&req, 0x00, sizeof(req));
106
107         req.msg = msgInfo;
108         req.sendOpt = sendOpt;
109
110         //err = msg_mms_reject_message(msgHandle, &req);
111         if (err != MSG_SUCCESS)
112         {
113                 tet_result(TET_FAIL);
114                 return;
115         }
116
117         tet_result(TET_PASS);
118 }
119
120 void utc_msg_mms_reject_message_002()
121 {
122         int err = MSG_SUCCESS;
123         MSG_REQUEST_S req;
124
125         memset(&req, 0x00, sizeof(req));
126
127         req.msg = msgInfo;
128         req.sendOpt = sendOpt;
129
130         err = msg_mms_reject_message(NULL, &req);
131         if (err != MSG_SUCCESS)
132         {
133                 tet_result(TET_PASS);
134                 return;
135         }
136
137         tet_result(TET_FAIL);
138 }