fix unit test for android

This commit is contained in:
Jehan Monnier 2018-05-23 17:55:17 +02:00
parent d900fc0787
commit fe0b526baf
3 changed files with 11 additions and 5 deletions

View file

@ -39,6 +39,12 @@
extern "C" {
#endif
#ifdef __ANDROID__
extern jobject system_context;
#else
extern void *system_context;
#endif
extern test_suite_t account_creator_test_suite;
extern test_suite_t call_test_suite;

View file

@ -121,7 +121,7 @@ static void linphone_version_test(void){
static void core_init_test(void) {
LinphoneCore* lc;
lc = linphone_factory_create_core(linphone_factory_get(),NULL,NULL,NULL);
lc = linphone_factory_create_core_2(linphone_factory_get(),NULL,NULL,NULL, NULL, system_context);
/* until we have good certificates on our test server... */
linphone_core_verify_server_certificates(lc,FALSE);
@ -138,7 +138,7 @@ static void linphone_address_test(void) {
static void core_sip_transport_test(void) {
LinphoneCore* lc;
LCSipTransports tr;
lc = linphone_factory_create_core(linphone_factory_get(),NULL,NULL,NULL);
lc = linphone_factory_create_core_2(linphone_factory_get(),NULL,NULL,NULL, NULL, system_context);
if (!BC_ASSERT_PTR_NOT_NULL(lc)) return;
linphone_core_get_sip_transports(lc,&tr);
BC_ASSERT_EQUAL(tr.udp_port,5060, int, "%d"); /*default config*/
@ -167,7 +167,7 @@ static void linphone_interpret_url_test(void) {
LinphoneAddress* address;
LinphoneProxyConfig *proxy_config;
char *tmp;
lc = linphone_factory_create_core(linphone_factory_get(),NULL,NULL,NULL);
lc = linphone_factory_create_core_2(linphone_factory_get(),NULL,NULL,NULL, NULL, system_context);
if (!BC_ASSERT_PTR_NOT_NULL( lc )) return;
proxy_config =linphone_core_create_proxy_config(lc);
@ -360,7 +360,7 @@ void linphone_proxy_config_is_server_config_changed_test(void) {
static void chat_room_test(void) {
LinphoneCore* lc;
lc = linphone_factory_create_core(linphone_factory_get(),NULL,NULL,NULL);
lc = linphone_factory_create_core_2(linphone_factory_get(),NULL,NULL,NULL, NULL, system_context);
if (!BC_ASSERT_PTR_NOT_NULL(lc)) return;
BC_ASSERT_PTR_NOT_NULL(linphone_core_get_chat_room_from_uri(lc,"sip:toto@titi.com"));
linphone_core_unref(lc);

View file

@ -265,7 +265,7 @@ static void friends_sqlite_storage(void) {
cbs = linphone_factory_create_core_cbs(linphone_factory_get());
linphone_core_cbs_set_friend_list_created(cbs, friend_list_created_cb);
linphone_core_cbs_set_friend_list_removed(cbs, friend_list_removed_cb);
lc = linphone_factory_create_core(linphone_factory_get(), cbs, NULL, NULL);
lc = linphone_factory_create_core_2(linphone_factory_get(), cbs, NULL, NULL, NULL, system_context);
linphone_core_cbs_unref(cbs);
friends = linphone_friend_list_get_friends(linphone_core_get_default_friend_list(lc));
lfl = linphone_core_create_friend_list(lc);