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
369d6751
Commit
369d6751
authored
Jul 01, 2015
by
Gautier Pelloux-Prayer
Browse files
tester: check that no linphone core exists before each test fixing crash on iOS
parent
060dfb0f
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
44 additions
and
29 deletions
+44
-29
tester/call_tester.c
tester/call_tester.c
+1
-1
tester/dtmf_tester.c
tester/dtmf_tester.c
+1
-1
tester/eventapi_tester.c
tester/eventapi_tester.c
+6
-5
tester/flexisip_tester.c
tester/flexisip_tester.c
+1
-1
tester/liblinphone_tester.h
tester/liblinphone_tester.h
+4
-1
tester/log_collection_tester.c
tester/log_collection_tester.c
+1
-1
tester/message_tester.c
tester/message_tester.c
+1
-1
tester/multi_call_tester.c
tester/multi_call_tester.c
+3
-3
tester/multicast_call_tester.c
tester/multicast_call_tester.c
+1
-1
tester/offeranswer_tester.c
tester/offeranswer_tester.c
+1
-1
tester/player_tester.c
tester/player_tester.c
+1
-1
tester/presence_tester.c
tester/presence_tester.c
+1
-1
tester/proxy_config_tester.c
tester/proxy_config_tester.c
+1
-1
tester/quality_reporting_tester.c
tester/quality_reporting_tester.c
+1
-1
tester/register_tester.c
tester/register_tester.c
+3
-1
tester/setup_tester.c
tester/setup_tester.c
+4
-4
tester/stun_tester.c
tester/stun_tester.c
+1
-1
tester/tester.c
tester/tester.c
+10
-1
tester/tunnel_tester.c
tester/tunnel_tester.c
+1
-1
tester/upnp_tester.c
tester/upnp_tester.c
+1
-1
No files found.
tester/call_tester.c
View file @
369d6751
...
...
@@ -4377,7 +4377,7 @@ test_t call_tests[] = {
test_suite_t
call_test_suite
=
{
"Single Call"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
call_tests
)
/
sizeof
(
call_tests
[
0
]),
call_tests
...
...
tester/dtmf_tester.c
View file @
369d6751
...
...
@@ -173,7 +173,7 @@ test_t dtmf_tests[] = {
test_suite_t
dtmf_test_suite
=
{
"DTMF"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
dtmf_tests
)
/
sizeof
(
dtmf_tests
[
0
]),
dtmf_tests
...
...
tester/eventapi_tester.c
View file @
369d6751
...
...
@@ -242,10 +242,11 @@ static void subscribe_test_with_args2(bool_t terminated_by_subscriber, RefreshTe
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie
->
stat
.
number_of_LinphoneSubscriptionOutgoingInit
,
1
,
1000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneSubscriptionIncomingReceived
,
1
,
3000
));
/*check good receipt of custom headers*/
BC_ASSERT_STRING_EQUAL
(
linphone_event_get_custom_header
(
pauline
->
lev
,
"My-Header"
),
"pouet"
);
BC_ASSERT_STRING_EQUAL
(
linphone_event_get_custom_header
(
pauline
->
lev
,
"My-Header2"
),
"pimpon"
);
if
(
pauline
->
stat
.
number_of_LinphoneSubscriptionIncomingReceived
==
1
)
{
/*check good receipt of custom headers*/
BC_ASSERT_STRING_EQUAL
(
linphone_event_get_custom_header
(
pauline
->
lev
,
"My-Header"
),
"pouet"
);
BC_ASSERT_STRING_EQUAL
(
linphone_event_get_custom_header
(
pauline
->
lev
,
"My-Header2"
),
"pimpon"
);
}
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie
->
stat
.
number_of_LinphoneSubscriptionActive
,
1
,
5000
));
BC_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneSubscriptionActive
,
1
,
5000
));
...
...
@@ -368,7 +369,7 @@ test_t event_tests[] = {
test_suite_t
event_test_suite
=
{
"Event"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
event_tests
)
/
sizeof
(
event_tests
[
0
]),
event_tests
...
...
tester/flexisip_tester.c
View file @
369d6751
...
...
@@ -936,7 +936,7 @@ test_t flexisip_tests[] = {
test_suite_t
flexisip_test_suite
=
{
"Flexisip"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
flexisip_tests
)
/
sizeof
(
flexisip_tests
[
0
]),
flexisip_tests
...
...
tester/liblinphone_tester.h
View file @
369d6751
...
...
@@ -52,6 +52,7 @@ extern test_suite_t video_test_suite;
extern
test_suite_t
multicast_call_test_suite
;
extern
test_suite_t
multi_call_test_suite
;
extern
test_suite_t
proxy_config_test_suite
;
extern
int
manager_count
;
extern
int
liblinphone_tester_ipv6_available
(
void
);
...
...
@@ -329,5 +330,7 @@ static const int audio_cmp_max_shift=20;
int
linphone_core_manager_get_max_audio_down_bw
(
const
LinphoneCoreManager
*
mgr
);
int
linphone_core_manager_get_max_audio_up_bw
(
const
LinphoneCoreManager
*
mgr
);
void
video_call_base_2
(
LinphoneCoreManager
*
pauline
,
LinphoneCoreManager
*
marie
,
bool_t
using_policy
,
LinphoneMediaEncryption
mode
,
bool_t
callee_video_enabled
,
bool_t
caller_video_enabled
);
#endif
/* LIBLINPHONE_TESTER_H_ */
int
liblinphone_tester_setup
();
#endif
/* LIBLINPHONE_TESTER_H_ */
tester/log_collection_tester.c
View file @
369d6751
...
...
@@ -326,7 +326,7 @@ test_t log_collection_tests[] = {
test_suite_t
log_collection_test_suite
=
{
"LogCollection"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
log_collection_tests
)
/
sizeof
(
log_collection_tests
[
0
]),
log_collection_tests
...
...
tester/message_tester.c
View file @
369d6751
...
...
@@ -1717,7 +1717,7 @@ test_t message_tests[] = {
test_suite_t
message_test_suite
=
{
"Message"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
message_tests
)
/
sizeof
(
message_tests
[
0
]),
message_tests
...
...
tester/multi_call_tester.c
View file @
369d6751
...
...
@@ -283,9 +283,9 @@ static void simple_encrypted_conference_with_ice(LinphoneMediaEncryption mode) {
...
linphone_core_iterate() at linphonecore.c:2 620
...
linphone_core_set_stun_server() initiates an asynchronous resolution, but it needs a few iteration before it is completed.
By calling private function linphone_core_get_stun_server_addrinfo() we make sure to wait that the resolution is done before the
By calling private function linphone_core_get_stun_server_addrinfo() we make sure to wait that the resolution is done before the
test calls actually start.
*/
linphone_core_get_stun_server_addrinfo
(
marie
->
lc
);
...
...
@@ -555,7 +555,7 @@ test_t multi_call_tests[] = {
test_suite_t
multi_call_test_suite
=
{
"Multi call"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
multi_call_tests
)
/
sizeof
(
multi_call_tests
[
0
]),
multi_call_tests
...
...
tester/multicast_call_tester.c
View file @
369d6751
...
...
@@ -271,7 +271,7 @@ test_t multicast_call_tests[] = {
test_suite_t
multicast_call_test_suite
=
{
"Multicast Call"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
multicast_call_tests
)
/
sizeof
(
multicast_call_tests
[
0
]),
multicast_call_tests
...
...
tester/offeranswer_tester.c
View file @
369d6751
...
...
@@ -418,7 +418,7 @@ static test_t offeranswer_tests[] = {
test_suite_t
offeranswer_test_suite
=
{
"Offer-answer"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
offeranswer_tests
)
/
sizeof
(
offeranswer_tests
[
0
]),
offeranswer_tests
...
...
tester/player_tester.c
View file @
369d6751
...
...
@@ -84,7 +84,7 @@ test_t player_tests[] = {
test_suite_t
player_test_suite
=
{
"Player"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
player_tests
)
/
sizeof
(
test_t
),
player_tests
...
...
tester/presence_tester.c
View file @
369d6751
...
...
@@ -484,7 +484,7 @@ test_t presence_tests[] = {
test_suite_t
presence_test_suite
=
{
"Presence"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
presence_tests
)
/
sizeof
(
presence_tests
[
0
]),
presence_tests
...
...
tester/proxy_config_tester.c
View file @
369d6751
...
...
@@ -68,7 +68,7 @@ test_t proxy_config_tests[] = {
test_suite_t
proxy_config_test_suite
=
{
"Proxy config"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
proxy_config_tests
)
/
sizeof
(
proxy_config_tests
[
0
]),
proxy_config_tests
...
...
tester/quality_reporting_tester.c
View file @
369d6751
...
...
@@ -396,7 +396,7 @@ test_t quality_reporting_tests[] = {
test_suite_t
quality_reporting_test_suite
=
{
"QualityReporting"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
quality_reporting_tests
)
/
sizeof
(
quality_reporting_tests
[
0
]),
quality_reporting_tests
...
...
tester/register_tester.c
View file @
369d6751
...
...
@@ -314,6 +314,7 @@ static void simple_authenticated_register(){
counters
=
&
lcm
->
stat
;
register_with_refresh
(
lcm
,
FALSE
,
auth_domain
,
route
);
BC_ASSERT_EQUAL
(
counters
->
number_of_auth_info_requested
,
0
,
int
,
"%d"
);
linphone_core_manager_destroy
(
lcm
);
}
static
void
ha1_authenticated_register
(){
...
...
@@ -329,6 +330,7 @@ static void ha1_authenticated_register(){
counters
=
&
lcm
->
stat
;
register_with_refresh
(
lcm
,
FALSE
,
auth_domain
,
route
);
BC_ASSERT_EQUAL
(
counters
->
number_of_auth_info_requested
,
0
,
int
,
"%d"
);
linphone_core_manager_destroy
(
lcm
);
}
static
void
authenticated_register_with_no_initial_credentials
(){
...
...
@@ -892,7 +894,7 @@ test_t register_tests[] = {
test_suite_t
register_test_suite
=
{
"Register"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
register_tests
)
/
sizeof
(
register_tests
[
0
]),
register_tests
...
...
tester/setup_tester.c
View file @
369d6751
...
...
@@ -268,7 +268,7 @@ static void devices_reload_test(void) {
static
void
codec_usability_test
(
void
)
{
LinphoneCoreManager
*
mgr
=
linphone_core_manager_new2
(
"empty_rc"
,
FALSE
);
PayloadType
*
pt
=
linphone_core_find_payload_type
(
mgr
->
lc
,
"PCMU"
,
8000
,
-
1
);
BC_ASSERT_TRUE
(
pt
!=
NULL
);
if
(
!
pt
)
goto
end
;
/*no limit*/
...
...
@@ -279,12 +279,12 @@ static void codec_usability_test(void) {
linphone_core_set_upload_bandwidth
(
mgr
->
lc
,
50
);
linphone_core_set_download_bandwidth
(
mgr
->
lc
,
50
);
BC_ASSERT_FALSE
(
linphone_core_check_payload_type_usability
(
mgr
->
lc
,
pt
));
/*reasonable limit*/
linphone_core_set_upload_bandwidth
(
mgr
->
lc
,
200
);
linphone_core_set_download_bandwidth
(
mgr
->
lc
,
200
);
BC_ASSERT_TRUE
(
linphone_core_check_payload_type_usability
(
mgr
->
lc
,
pt
));
end:
linphone_core_manager_destroy
(
mgr
);
}
...
...
@@ -308,7 +308,7 @@ test_t setup_tests[] = {
test_suite_t
setup_test_suite
=
{
"Setup"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
setup_tests
)
/
sizeof
(
setup_tests
[
0
]),
setup_tests
...
...
tester/stun_tester.c
View file @
369d6751
...
...
@@ -112,7 +112,7 @@ test_t stun_tests[] = {
test_suite_t
stun_test_suite
=
{
"Stun"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
stun_tests
)
/
sizeof
(
stun_tests
[
0
]),
stun_tests
...
...
tester/tester.c
View file @
369d6751
...
...
@@ -32,7 +32,7 @@
static
bool_t
liblinphone_tester_ipv6_enabled
=
FALSE
;
static
int
liblinphone_tester_keep_accounts_flag
=
0
;
static
int
liblinphone_tester_keep_record_files
=
FALSE
;
static
int
manager_count
=
0
;
int
manager_count
=
0
;
const
char
*
test_domain
=
"sipopen.example.org"
;
const
char
*
auth_domain
=
"sip.example.org"
;
...
...
@@ -233,6 +233,7 @@ bool_t transport_supported(LinphoneTransportType transport) {
return
supported
;
}
LinphoneCoreManager
*
linphone_core_manager_init
(
const
char
*
rc_file
)
{
LinphoneCoreManager
*
mgr
=
ms_new0
(
LinphoneCoreManager
,
1
);
char
*
rc_path
=
NULL
;
...
...
@@ -441,3 +442,11 @@ int linphone_core_manager_get_max_audio_up_bw(const LinphoneCoreManager *mgr) {
return
linphone_core_manager_get_max_audio_bw_base
(
mgr
->
stat
.
audio_upload_bandwidth
,
sizeof
(
mgr
->
stat
.
audio_upload_bandwidth
)
/
sizeof
(
int
));
}
int
liblinphone_tester_setup
()
{
if
(
manager_count
!=
0
)
{
ms_error
(
"%d linphone core manager still alive!"
,
manager_count
);
return
1
;
}
return
0
;
}
tester/tunnel_tester.c
View file @
369d6751
...
...
@@ -270,7 +270,7 @@ test_t tunnel_tests[] = {
test_suite_t
tunnel_test_suite
=
{
"Tunnel"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
tunnel_tests
)
/
sizeof
(
tunnel_tests
[
0
]),
tunnel_tests
...
...
tester/upnp_tester.c
View file @
369d6751
...
...
@@ -58,7 +58,7 @@ test_t upnp_tests[] = {
test_suite_t
upnp_test_suite
=
{
"Upnp"
,
NULL
,
liblinphone_tester_setup
,
NULL
,
sizeof
(
upnp_tests
)
/
sizeof
(
upnp_tests
[
0
]),
upnp_tests
...
...
Prev
1
2
Next
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