LinphoneAddress* res;\ char* actual_str;\ linphone_proxy_config_set_identity(proxy, "sip:[email protected]"); \ res = linphone_proxy_config_normalize_sip_uri(proxy, actual); \ actual_str = linphone_address_as_string_uri_only(res); \ BC_ASSERT_STRING_EQUAL(actual_str, expected); \ ms_free(actual_str); \ linphone_address_destroy(res); \ linphone_proxy_config_destroy(proxy); \ } static void sip_uri_normalization(void) { char* expected ="sip:%d9%[email protected]"; BC_ASSERT_PTR_NULL(linphone_proxy_config_normalize_sip_uri(NULL, "test")); SIP_URI_CHECK("*****@*****.**", "sip:[email protected]"); SIP_URI_CHECK("[email protected];transport=tls", "sip:[email protected];transport=tls"); SIP_URI_CHECK("١", expected); //test that no more invalid memory writes are made (valgrind only) } test_t proxy_config_tests[] = { TEST_NO_TAG("Phone normalization without proxy", phone_normalization_without_proxy), TEST_NO_TAG("Phone normalization with proxy", phone_normalization_with_proxy), TEST_NO_TAG("Phone normalization with dial escape plus", phone_normalization_with_dial_escape_plus), TEST_NO_TAG("SIP URI normalization", sip_uri_normalization) }; test_suite_t proxy_config_test_suite = {"Proxy config", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, sizeof(proxy_config_tests) / sizeof(proxy_config_tests[0]), proxy_config_tests};
/*low limit*/ 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); } test_t setup_tests[] = { TEST_NO_TAG("Version check", linphone_version_test), TEST_NO_TAG("Linphone Address", linphone_address_test), TEST_NO_TAG("Linphone proxy config address equal (internal api)", linphone_proxy_config_address_equal_test), TEST_NO_TAG("Linphone proxy config server address change (internal api)", linphone_proxy_config_is_server_config_changed_test), TEST_NO_TAG("Linphone core init/uninit", core_init_test), TEST_NO_TAG("Linphone random transport port",core_sip_transport_test), TEST_NO_TAG("Linphone interpret url", linphone_interpret_url_test), TEST_NO_TAG("LPConfig from buffer", linphone_lpconfig_from_buffer), TEST_NO_TAG("LPConfig zero_len value from buffer", linphone_lpconfig_from_buffer_zerolen_value), TEST_NO_TAG("LPConfig zero_len value from file", linphone_lpconfig_from_file_zerolen_value), TEST_NO_TAG("LPConfig zero_len value from XML", linphone_lpconfig_from_xml_zerolen_value), TEST_NO_TAG("Chat room", chat_room_test), TEST_NO_TAG("Devices reload", devices_reload_test), TEST_NO_TAG("Codec usability", codec_usability_test) };
BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallOutgoingRinging, 1)); /*assert that the call never gets connected nor terminated*/ BC_ASSERT_FALSE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallConnected, 1)); BC_ASSERT_EQUAL(mgr->stat.number_of_LinphoneCallEnd, 0, int, "%d"); BC_ASSERT_EQUAL(mgr->stat.number_of_LinphoneCallError, 0, int, "%d"); linphone_core_terminate_call(mgr->lc, call); BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallEnd, 1)); BC_ASSERT_TRUE(wait_for(mgr->lc, mgr->lc, &mgr->stat.number_of_LinphoneCallReleased, 1)); pclose(sipp_out); } linphone_core_manager_destroy(mgr); } static test_t tests[] = { TEST_NO_TAG("SIP UPDATE within incoming reinvite without sdp", sip_update_within_icoming_reinvite_with_no_sdp), TEST_NO_TAG("Call with audio mline before video in sdp", call_with_audio_mline_before_video_in_sdp), TEST_NO_TAG("Call with video mline before audio in sdp", call_with_video_mline_before_audio_in_sdp), TEST_NO_TAG("Call with multiple audio mline in sdp", call_with_multiple_audio_mline_in_sdp), TEST_NO_TAG("Call with multiple video mline in sdp", call_with_multiple_video_mline_in_sdp), TEST_NO_TAG("Call invite 200ok without contact header", call_invite_200ok_without_contact_header) }; test_suite_t complex_sip_call_test_suite = { "Complex SIP Call", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, sizeof(tests) / sizeof(tests[0]), tests
} BC_ASSERT_TRUE (wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphonePresenceActivityOnline,1)); BC_ASSERT_EQUAL(pauline->stat.number_of_NewSubscriptionRequest,1, int, "%d"); BC_ASSERT_EQUAL(marie->stat.number_of_NotifyPresenceReceived,1, int, "%d"); linphone_core_manager_destroy(marie); /*unsubscribe is not reported ?*/ BC_ASSERT_FALSE(wait_for(NULL,pauline->lc,&pauline->stat.number_of_NewSubscriptionRequest,2)); /*just to wait for unsubscription even if not notified*/ linphone_core_manager_destroy(pauline); } test_t presence_tests[] = { TEST_ONE_TAG("Simple Subscribe", simple_subscribe,"presence"), TEST_ONE_TAG("Simple Subscribe with early NOTIFY", simple_subscribe_with_early_notify,"presence"), TEST_NO_TAG("Simple Subscribe with friend from rc", simple_subscribe_with_friend_from_rc), TEST_ONE_TAG("Simple Publish", simple_publish, "LeaksMemory"), TEST_ONE_TAG("Simple Publish with expires", publish_with_expires, "LeaksMemory"), /*TEST_ONE_TAG("Call with presence", call_with_presence, "LeaksMemory"),*/ TEST_NO_TAG("Unsubscribe while subscribing", unsubscribe_while_subscribing), TEST_NO_TAG("Presence information", presence_information), TEST_NO_TAG("App managed presence failure", subscribe_failure_handle_by_app), TEST_NO_TAG("Presence SUBSCRIBE forked", subscribe_presence_forked), TEST_NO_TAG("Presence SUBSCRIBE expired", subscribe_presence_expired), }; test_suite_t presence_test_suite = {"Presence", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, sizeof(presence_tests) / sizeof(presence_tests[0]), presence_tests};