Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
f0d7040f
Commit
f0d7040f
authored
May 20, 2014
by
Guillaume BIENKOWSKI
Browse files
unit tests for transient messages
parent
d491197c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
tester/message_tester.c
tester/message_tester.c
+15
-0
No files found.
tester/message_tester.c
View file @
f0d7040f
...
...
@@ -234,12 +234,19 @@ static void text_message_with_external_body(void) {
LinphoneChatMessage
*
message
=
linphone_chat_room_create_message
(
chat_room
,
"Bli bli bli
\n
blu"
);
linphone_chat_message_set_external_body_url
(
message
,
message_external_body_url
=
"http://www.linphone.org"
);
linphone_chat_room_send_message2
(
chat_room
,
message
,
liblinphone_tester_chat_message_state_change
,
pauline
->
lc
);
/* check transient message list: the message should be in it, and should be the only one */
CU_ASSERT_EQUAL
(
ms_list_size
(
chat_room
->
transient_messages
),
1
);
CU_ASSERT_EQUAL
(
ms_list_nth_data
(
chat_room
->
transient_messages
,
0
),
message
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneMessageReceived
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneMessageDelivered
,
1
));
CU_ASSERT_EQUAL
(
pauline
->
stat
.
number_of_LinphoneMessageInProgress
,
1
);
CU_ASSERT_EQUAL
(
marie
->
stat
.
number_of_LinphoneMessageExtBodyReceived
,
1
);
CU_ASSERT_EQUAL
(
ms_list_size
(
chat_room
->
transient_messages
),
0
);
linphone_core_manager_destroy
(
marie
);
linphone_core_manager_destroy
(
pauline
);
}
...
...
@@ -254,10 +261,18 @@ static void text_message_with_send_error(void) {
sal_set_send_error
(
marie
->
lc
->
sal
,
-
1
);
linphone_chat_room_send_message2
(
chat_room
,
message
,
liblinphone_tester_chat_message_state_change
,
marie
->
lc
);
/* check transient message list: the message should be in it, and should be the only one */
CU_ASSERT_EQUAL
(
ms_list_size
(
chat_room
->
transient_messages
),
1
);
CU_ASSERT_EQUAL
(
ms_list_nth_data
(
chat_room
->
transient_messages
,
0
),
message
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneMessageNotDelivered
,
1
));
/*CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageInProgress,1);*/
CU_ASSERT_EQUAL
(
pauline
->
stat
.
number_of_LinphoneMessageReceived
,
0
);
/* the message should have been discarded from transient list after an error */
CU_ASSERT_EQUAL
(
ms_list_size
(
chat_room
->
transient_messages
),
0
);
sal_set_send_error
(
marie
->
lc
->
sal
,
0
);
linphone_core_manager_destroy
(
marie
);
linphone_core_manager_destroy
(
pauline
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment