From dae216855ca67430cc25135f4eef52f1e5edc1c2 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 19 Oct 2015 12:05:24 +0200 Subject: [PATCH] proxy_config_tester.c: add unicode test for invalid writes --- tester/proxy_config_tester.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tester/proxy_config_tester.c b/tester/proxy_config_tester.c index 918977017..e3a018758 100644 --- a/tester/proxy_config_tester.c +++ b/tester/proxy_config_tester.c @@ -87,11 +87,14 @@ static void phone_normalization_with_dial_escape_plus(void){ } #define SIP_URI_CHECK(actual, expected) { \ - LinphoneAddress* res = linphone_proxy_config_normalize_sip_uri(NULL, actual); \ + LinphoneProxyConfig *proxy = linphone_proxy_config_new(); \ + linphone_proxy_config_set_identity(proxy, "sip:username@linphone.org"); \ + LinphoneAddress* res = linphone_proxy_config_normalize_sip_uri(proxy, actual); \ char* 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); \ } @@ -99,6 +102,8 @@ static void sip_uri_normalization(void) { BC_ASSERT_PTR_NULL(linphone_proxy_config_normalize_sip_uri(NULL, "test")); SIP_URI_CHECK("test@linphone.org", "sip:test@linphone.org"); SIP_URI_CHECK("test@linphone.org;transport=tls", "sip:test@linphone.org;transport=tls"); + + SIP_URI_CHECK("١", "sip:%%d9%%a1@linphone.org"); //test that no more invalid write are done (valgrind only) } test_t proxy_config_tests[] = {