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
6c752ae3
Commit
6c752ae3
authored
Apr 27, 2018
by
Mickaël Turnel
Browse files
Prevent tests from crashing if call is null
parent
6d4666b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
tester/flexisip_tester.c
tester/flexisip_tester.c
+20
-9
No files found.
tester/flexisip_tester.c
View file @
6c752ae3
...
...
@@ -1478,8 +1478,11 @@ void sequential_forking(void) {
/*the second should not*/
BC_ASSERT_EQUAL
(
marie2
->
stat
.
number_of_LinphoneCallIncomingReceived
,
0
,
int
,
"%d"
);
LinphoneCall
*
call
=
linphone_core_get_current_call
(
marie
->
lc
);
if
(
!
BC_ASSERT_PTR_NOT_NULL
(
call
))
return
;
/*marie accepts the call on its second device*/
linphone_call_accept
(
linphone_core_get_current_call
(
marie
->
lc
)
);
linphone_call_accept
(
call
);
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
...
...
@@ -1540,8 +1543,11 @@ void sequential_forking_with_timeout_for_highest_priority(void) {
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie2
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
,
3000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie3
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
,
3000
));
LinphoneCall
*
call
=
linphone_core_get_current_call
(
marie3
->
lc
);
if
(
!
BC_ASSERT_PTR_NOT_NULL
(
call
))
return
;
/*marie accepts the call on her third device*/
linphone_call_accept
(
linphone_core_get_current_call
(
marie3
->
lc
)
);
linphone_call_accept
(
call
);
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie3
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
...
...
@@ -1600,8 +1606,11 @@ void sequential_forking_with_no_response_for_highest_priority(void) {
/*then the second device should receive the call*/
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie2
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
,
3000
));
LinphoneCall
*
call
=
linphone_core_get_current_call
(
marie2
->
lc
);
if
(
!
BC_ASSERT_PTR_NOT_NULL
(
call
))
return
;
/*marie accepts the call on her second device*/
linphone_call_accept
(
linphone_core_get_current_call
(
marie2
->
lc
)
);
linphone_call_accept
(
call
);
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie2
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
...
...
@@ -1661,8 +1670,11 @@ void sequential_forking_with_insertion_of_higher_priority(void) {
/*this device should receive the call*/
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie3
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
,
3000
));
LinphoneCall
*
call
=
linphone_core_get_current_call
(
marie3
->
lc
);
if
(
!
BC_ASSERT_PTR_NOT_NULL
(
call
))
return
;
/*marie accepts the call on her third device*/
linphone_call_accept
(
linphone_core_get_current_call
(
marie3
->
lc
)
);
linphone_call_accept
(
call
);
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie3
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
...
...
@@ -1686,7 +1698,6 @@ void sequential_forking_with_insertion_of_higher_priority(void) {
}
void
sequential_forking_with_fallback_route
(
void
)
{
#if 0 //fixme Mickael
LinphoneCoreManager
*
pauline
=
linphone_core_manager_new
(
transport_supported
(
LinphoneTransportTls
)
?
"pauline_rc"
:
"pauline_tcp_rc"
);
LinphoneCoreManager
*
pauline2
=
linphone_core_manager_create
(
transport_supported
(
LinphoneTransportTls
)
?
"pauline_rc"
:
"pauline_tcp_rc"
);
LinphoneCoreManager
*
marie
=
linphone_core_manager_create
(
"marie_rc"
);
...
...
@@ -1734,8 +1745,11 @@ void sequential_forking_with_fallback_route(void) {
/*the call should be routed to the first server with pauline account*/
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
,
3000
));
LinphoneCall
*
call
=
linphone_core_get_current_call
(
pauline
->
lc
);
if
(
!
BC_ASSERT_PTR_NOT_NULL
(
call
))
return
;
/*pauline accepts the call*/
linphone_call_accept(
linphone_core_get_current_call(pauline->lc)
);
linphone_call_accept
(
call
);
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallConnected
,
1
,
1000
));
...
...
@@ -1752,9 +1766,6 @@ void sequential_forking_with_fallback_route(void) {
linphone_core_manager_destroy
(
pauline2
);
linphone_core_manager_destroy
(
marie
);
bctbx_list_free
(
lcs
);
#else
ms_error
(
"sequential_forking_with_fallback_route temporaly removed"
);
#endif
}
test_t
flexisip_tests
[]
=
{
...
...
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