Commit 1eaeb178 authored by Ghislain MARY's avatar Ghislain MARY

Stricter compilation options + new compilation error fixes.

parent 0285a4fb
......@@ -193,7 +193,7 @@ else()
list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds")
endif()
if(ENABLE_STRICT)
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wno-error=unknown-pragmas" "-Wuninitialized" "-fno-strict-aliasing")
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wno-unused-parameter" "-Wno-error=unknown-pragmas" "-Wuninitialized" "-fno-strict-aliasing")
list(APPEND STRICT_OPTIONS_C "-Wdeclaration-after-statement" "-Wstrict-prototypes")
endif()
# this warning is generated by antlr so ignore it for now
......
......@@ -128,7 +128,7 @@ case "$target_os" in
esac
if test "$strict" = "true"; then
STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wno-error=unknown-pragmas -Wuninitialized -Wno-error=strict-prototypes"
STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wextra -Wno-unused-parameter -Wno-error=unknown-pragmas -Wuninitialized -Wno-error=strict-prototypes"
fi
dnl because of antlr3 we must accept a few warnings...
......
......@@ -27,6 +27,8 @@
* typedefs, macros and functions for object definition and manipulation.
*/
#define BELLE_SIP_DEFAULT_BUFSIZE_HINT 0
#define BELLE_SIP_TYPE_ID(_type) _type##_id
typedef unsigned int belle_sip_type_id_t;
......@@ -78,7 +80,8 @@ typedef unsigned int belle_sip_type_id_t;
BELLE_SIP_VPTR_INIT(object_type,parent_type,unowned), \
(belle_sip_object_destroy_t)destroy, \
(belle_sip_object_clone_t)clone, \
(belle_sip_object_marshal_t)marshal\
(belle_sip_object_marshal_t)marshal,\
BELLE_SIP_DEFAULT_BUFSIZE_HINT\
}; \
BELLE_SIP_OBJECT_VPTR_TYPE(object_type) * BELLE_SIP_OBJECT_GET_VPTR_FUNC(object_type)(void){\
return &BELLE_SIP_OBJECT_VPTR_NAME(object_type); \
......
......@@ -185,6 +185,10 @@ if(MSVC)
get_source_file_property(SIP_MESSAGE_PARSER_COMPILE_FLAGS grammars/belle_sip_messageParser.c COMPILE_FLAGS)
set(SIP_MESSAGE_PARSER_COMPILE_FLAGS "${SIP_MESSAGE_PARSER_COMPILE_FLAGS} /wd4267") # Disable "possible loss of data" warnings
set_source_files_properties(grammars/belle_sip_messageParser.c PROPERTIES COMPILE_FLAGS "${SIP_MESSAGE_PARSER_COMPILE_FLAGS}")
else()
get_source_file_property(SIP_MESSAGE_PARSER_COMPILE_FLAGS grammars/belle_sip_messageParser.c COMPILE_FLAGS)
set(SIP_MESSAGE_PARSER_COMPILE_FLAGS "${SIP_MESSAGE_PARSER_COMPILE_FLAGS} -Wno-sign-compare")
set_source_files_properties(grammars/belle_sip_messageParser.c PROPERTIES COMPILE_FLAGS "${SIP_MESSAGE_PARSER_COMPILE_FLAGS}")
endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
......
......@@ -213,7 +213,8 @@ belle_sip_object_vptr_t belle_sip_object_t_vptr={
NULL,
_belle_sip_object_uninit,
_belle_sip_object_clone,
_belle_object_marshal
_belle_object_marshal,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
};
belle_sip_object_vptr_t *belle_sip_object_t_vptr_get(void){
......
......@@ -253,7 +253,7 @@ static struct dns_resolv_conf *resconf(belle_sip_simple_resolver_context_t *ctx)
char ip[64];
char serv[10];
int using_ipv6=FALSE;
int i;
size_t i;
belle_sip_message("Resolver is using DNS server(s):");
for(i=0;i<sizeof(ctx->resconf->nameserver)/sizeof(ctx->resconf->nameserver[0]);++i){
......@@ -455,7 +455,7 @@ static int resolver_process_data(belle_sip_simple_resolver_context_t *ctx, unsig
simulated_timeout=1;
}
if (simulated_timeout || ((revents & BELLE_SIP_EVENT_TIMEOUT) && (belle_sip_time_ms()-ctx->start_time>=timeout))) {
if (simulated_timeout || ((revents & BELLE_SIP_EVENT_TIMEOUT) && ((int)(belle_sip_time_ms()-ctx->start_time)>=timeout))) {
belle_sip_error("%s timed-out", __FUNCTION__);
notify_results(ctx);
return BELLE_SIP_STOP;
......@@ -813,7 +813,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_resolver_context_t)
BELLE_SIP_VPTR_INIT(belle_sip_resolver_context_t,belle_sip_source_t,TRUE),
(belle_sip_object_destroy_t) NULL,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL
BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_END
......@@ -826,7 +827,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_simple_resolver_context_t)
BELLE_SIP_VPTR_INIT(belle_sip_simple_resolver_context_t,belle_sip_resolver_context_t,TRUE),
(belle_sip_object_destroy_t) belle_sip_simple_resolver_context_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
simple_resolver_cancel
}
......@@ -839,7 +841,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_dual_resolver_context_t)
BELLE_SIP_VPTR_INIT(belle_sip_dual_resolver_context_t,belle_sip_resolver_context_t,TRUE),
(belle_sip_object_destroy_t) belle_sip_dual_resolver_context_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
dual_resolver_cancel
}
......@@ -852,7 +855,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_combined_resolver_context_t)
BELLE_SIP_VPTR_INIT(belle_sip_combined_resolver_context_t,belle_sip_resolver_context_t,TRUE),
(belle_sip_object_destroy_t) belle_sip_combined_resolver_context_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
combined_resolver_cancel
}
......
......@@ -73,6 +73,7 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_body_handler_t)
(belle_sip_object_destroy_t) belle_sip_body_handler_destroy,
(belle_sip_object_clone_t) belle_sip_body_handler_clone,
(belle_sip_object_marshal_t) belle_sip_body_handler_marshal,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL, /* begin_transfer */
NULL, /* end_transfer */
......@@ -212,7 +213,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_memory_body_handler_t)
BELLE_SIP_VPTR_INIT(belle_sip_memory_body_handler_t,belle_sip_body_handler_t,TRUE),
(belle_sip_object_destroy_t) belle_sip_memory_body_handler_destroy,
(belle_sip_object_clone_t)belle_sip_memory_body_handler_clone,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL,
NULL,
......@@ -408,7 +410,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_user_body_handler_t)
BELLE_SIP_VPTR_INIT(belle_sip_user_body_handler_t,belle_sip_body_handler_t,TRUE),
(belle_sip_object_destroy_t) NULL,
(belle_sip_object_clone_t)belle_sip_user_body_handler_clone,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL,
NULL,
......@@ -479,10 +482,6 @@ static int belle_sip_file_body_handler_send_chunk(belle_sip_body_handler_t *base
return BELLE_SIP_STOP;
}
size_t_ret = fread(buf, 1, to_send, f);
if (size_t_ret < 0) {
fclose(f);
return BELLE_SIP_STOP;
}
*size = size_t_ret;
fclose(f);
return (((obj->base.expected_size - offset) == *size) || (*size == 0)) ? BELLE_SIP_STOP : BELLE_SIP_CONTINUE;
......@@ -495,7 +494,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_file_body_handler_t)
BELLE_SIP_VPTR_INIT(belle_sip_file_body_handler_t,belle_sip_body_handler_t,TRUE),
(belle_sip_object_destroy_t) belle_sip_file_body_handler_destroy,
(belle_sip_object_clone_t)belle_sip_file_body_handler_clone,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL,
NULL,
......@@ -639,7 +639,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_multipart_body_handler_t)
BELLE_SIP_VPTR_INIT(belle_sip_multipart_body_handler_t,belle_sip_body_handler_t,TRUE),
(belle_sip_object_destroy_t) belle_sip_multipart_body_handler_destroy,
(belle_sip_object_clone_t)belle_sip_multipart_body_handler_clone,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
belle_sip_multipart_body_handler_begin_transfer,
belle_sip_multipart_body_handler_end_transfer,
......
......@@ -148,7 +148,14 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_channel_t)
(belle_sip_object_destroy_t)belle_sip_channel_destroy,
NULL, /*clone*/
NULL, /*marshal*/
}
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL, /* transport */
0, /* reliable */
NULL, /* connect */
NULL, /* channel_send */
NULL, /* channel_recv */
NULL /* close */
BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_END
static void fix_incoming_via(belle_sip_request_t *msg, const struct addrinfo* origin){
......@@ -994,7 +1001,7 @@ static void belle_sip_channel_handle_error(belle_sip_channel_t *obj){
int belle_sip_channel_notify_timeout(belle_sip_channel_t *obj){
const int too_long=60;
if (belle_sip_time_ms() - obj->last_recv_time>=(too_long * 1000)){
if ((int)(belle_sip_time_ms() - obj->last_recv_time) >= (too_long * 1000)){
belle_sip_message("A timeout related to this channel occured and no message received during last %i seconds. This channel is suspect, moving to error state",too_long);
channel_set_state(obj,BELLE_SIP_CHANNEL_ERROR);
return TRUE;
......
......@@ -58,7 +58,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_dialog_t)
BELLE_SIP_VPTR_INIT(belle_sip_dialog_t, belle_sip_object_t,TRUE),
(belle_sip_object_destroy_t)belle_sip_dialog_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_END
const char* belle_sip_dialog_state_to_string(const belle_sip_dialog_state_t state) {
......
......@@ -196,7 +196,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_ict_t)
BELLE_SIP_VPTR_INIT(belle_sip_ict_t,belle_sip_client_transaction_t,TRUE),
(belle_sip_object_destroy_t)ict_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
(void (*)(belle_sip_transaction_t*))on_ict_terminate
},
......
......@@ -173,7 +173,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_ist_t)
BELLE_SIP_VPTR_INIT(belle_sip_ist_t,belle_sip_server_transaction_t,TRUE),
(belle_sip_object_destroy_t)ist_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
(void (*)(belle_sip_transaction_t *))ist_on_terminate
},
......
......@@ -105,7 +105,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_listening_point_t)
BELLE_SIP_VPTR_INIT(belle_sip_listening_point_t, belle_sip_object_t,FALSE),
(belle_sip_object_destroy_t)belle_sip_listening_point_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL,
NULL
......@@ -210,7 +211,7 @@ void belle_sip_listening_point_set_keep_alive(belle_sip_listening_point_t *lp,in
}
int belle_sip_listening_point_get_keep_alive(const belle_sip_listening_point_t *lp) {
return lp->keep_alive_timer?belle_sip_source_get_timeout(lp->keep_alive_timer):-1;
return lp->keep_alive_timer?(int)belle_sip_source_get_timeout(lp->keep_alive_timer):-1;
}
void belle_sip_listening_point_set_channel_listener(belle_sip_listening_point_t *lp,belle_sip_channel_listener_t* channel_listener) {
......
......@@ -157,7 +157,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_nict_t)
BELLE_SIP_VPTR_INIT(belle_sip_nict_t,belle_sip_client_transaction_t,TRUE),
(belle_sip_object_destroy_t)nict_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
(void (*)(belle_sip_transaction_t *))nict_on_terminate
},
......
......@@ -103,7 +103,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_nist_t)
BELLE_SIP_VPTR_INIT(belle_sip_nist_t,belle_sip_server_transaction_t,TRUE),
(belle_sip_object_destroy_t)nist_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
(void (*)(belle_sip_transaction_t *))nist_on_terminate
},
......
......@@ -156,8 +156,10 @@ static void on_channel_state_changed(belle_sip_channel_listener_t *l, belle_sip_
BELLE_SIP_IMPLEMENT_INTERFACE_BEGIN(belle_sip_transaction_t,belle_sip_channel_listener_t)
on_channel_state_changed,
NULL,
NULL
NULL, /* on_message_headers */
NULL, /* on_message */
NULL, /* on_sending */
NULL /* on_auth_requested */
BELLE_SIP_IMPLEMENT_INTERFACE_END
BELLE_SIP_DECLARE_IMPLEMENTED_INTERFACES_1(belle_sip_transaction_t, belle_sip_channel_listener_t);
......@@ -168,6 +170,7 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_transaction_t)
(belle_sip_object_destroy_t) transaction_destroy,
NULL,/*no clone*/
NULL,/*no marshal*/
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL /*on_terminate*/
BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_END
......@@ -287,10 +290,13 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_server_transaction_t)
BELLE_SIP_VPTR_INIT(belle_sip_server_transaction_t,belle_sip_transaction_t,FALSE),
(belle_sip_object_destroy_t) server_transaction_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL
}
},
NULL, /* send_new_response */
NULL /* on_request_retransmission */
BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_END
void belle_sip_server_transaction_init(belle_sip_server_transaction_t *t, belle_sip_provider_t *prov,belle_sip_request_t *req){
......@@ -596,7 +602,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_client_transaction_t)
BELLE_SIP_VPTR_INIT(belle_sip_client_transaction_t,belle_sip_transaction_t,FALSE),
(belle_sip_object_destroy_t)client_transaction_destroy,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
NULL
},
......
......@@ -154,7 +154,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_stream_channel_t)
BELLE_SIP_VPTR_INIT(belle_sip_stream_channel_t,belle_sip_channel_t,FALSE),
(belle_sip_object_destroy_t)stream_channel_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
"TCP",
1, /*is_reliable*/
......
......@@ -51,7 +51,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_stream_listening_point_t)
BELLE_SIP_VPTR_INIT(belle_sip_stream_listening_point_t, belle_sip_listening_point_t,TRUE),
(belle_sip_object_destroy_t)belle_sip_stream_listening_point_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
"TCP",
stream_create_channel
......
......@@ -455,7 +455,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_tls_channel_t)
BELLE_SIP_VPTR_INIT(belle_sip_tls_channel_t,belle_sip_stream_channel_t,FALSE),
(belle_sip_object_destroy_t)tls_channel_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
"TLS",
1, /*is_reliable*/
......
......@@ -38,7 +38,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_tls_listening_point_t)
BELLE_SIP_VPTR_INIT(belle_sip_tls_listening_point_t, belle_sip_stream_listening_point_t,TRUE),
(belle_sip_object_destroy_t)belle_sip_tls_listening_point_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
"TLS",
tls_create_channel
......
......@@ -87,14 +87,15 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_udp_channel_t)
BELLE_SIP_VPTR_INIT(belle_sip_udp_channel_t,belle_sip_channel_t,FALSE),
(belle_sip_object_destroy_t)udp_channel_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
"UDP",
0, /*is_reliable*/
udp_channel_connect,
udp_channel_send,
udp_channel_recv
/*no close method*/
udp_channel_recv,
NULL /*no close method*/
}
BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_END
......
......@@ -50,7 +50,8 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(belle_sip_udp_listening_point_t)
BELLE_SIP_VPTR_INIT(belle_sip_udp_listening_point_t, belle_sip_listening_point_t,TRUE),
(belle_sip_object_destroy_t)belle_sip_udp_listening_point_uninit,
NULL,
NULL
NULL,
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
"UDP",
udp_create_channel
......
......@@ -194,11 +194,11 @@ static void test_certificate_fingerprint(void) {
}
test_t authentication_helper_tests[] = {
{ "Proxy-Authenticate", test_proxy_authentication },
{ "WWW-Authenticate", test_authentication },
{ "WWW-Authenticate (with qop)", test_authentication_qop_auth },
{ "generate and parse self signed certificates", test_generate_and_parse_certificates},
{ "generate certificate fingerprint", test_certificate_fingerprint}
TEST_NO_TAG("Proxy-Authenticate", test_proxy_authentication),
TEST_NO_TAG("WWW-Authenticate", test_authentication),
TEST_NO_TAG("WWW-Authenticate (with qop)", test_authentication_qop_auth),
TEST_NO_TAG("generate and parse self signed certificates", test_generate_and_parse_certificates),
TEST_NO_TAG("generate certificate fingerprint", test_certificate_fingerprint)
};
test_suite_t authentication_helper_test_suite = {
......
......@@ -133,10 +133,10 @@ static void test_absolute_uri(void) {
}
static test_t tests[] = {
{ "Simple uri", test_basic_uri },
{ "Complex uri", test_complex_uri },
{ "File path", test_file_path },
{ "Absolute uri", test_absolute_uri }
TEST_NO_TAG("Simple uri", test_basic_uri),
TEST_NO_TAG("Complex uri", test_complex_uri),
TEST_NO_TAG("File path", test_file_path),
TEST_NO_TAG("Absolute uri", test_absolute_uri)
};
test_suite_t generic_uri_test_suite = {"Generic uri", NULL, NULL, belle_sip_tester_before_each,
......
......@@ -345,16 +345,16 @@ static void one_https_get_with_proxy(void){
test_t http_tests[] = {
{ "One http GET", one_http_get },
{ "http GET of empty body", http_get_empty_body },
{ "One https GET", one_https_get },
{ "One https GET with http proxy", one_https_get_with_proxy },
{ "http request with io error", http_get_io_error },
{ "https GET with long body", https_get_long_body },
{ "https digest GET", https_digest_get },/*, FIXME, need a server for testing
{ "https with client certificate", https_client_cert_connection }*/
{ "https POST with long body", https_post_long_body },
{ "http GET with long user body", http_get_long_user_body}
TEST_NO_TAG("One http GET", one_http_get),
TEST_NO_TAG("http GET of empty body", http_get_empty_body),
TEST_NO_TAG("One https GET", one_https_get),
TEST_NO_TAG("One https GET with http proxy", one_https_get_with_proxy),
TEST_NO_TAG("http request with io error", http_get_io_error),
TEST_NO_TAG("https GET with long body", https_get_long_body),
TEST_NO_TAG("https digest GET", https_digest_get),/*, FIXME, need a server for testing
TEST_NO_TAG("https with client certificate", https_client_cert_connection),*/
TEST_NO_TAG("https POST with long body", https_post_long_body),
TEST_NO_TAG("http GET with long user body", http_get_long_user_body)
};
test_suite_t http_test_suite = {"HTTP stack", http_before_all, http_after_all, NULL,
......
......@@ -584,7 +584,8 @@ static void check_mime_param (belle_sdp_mime_parameter_t* mime_param
if (type) BC_ASSERT_STRING_EQUAL(belle_sdp_mime_parameter_get_type(mime_param),type);
if (parameters) BC_ASSERT_STRING_EQUAL(belle_sdp_mime_parameter_get_parameters(mime_param),parameters);
}
int static compare_attribute(belle_sdp_attribute_t* attr, const char* value) {
static int compare_attribute(belle_sdp_attribute_t* attr, const char* value) {
return strcasecmp(belle_sdp_attribute_get_name(attr),"rtpmap")==0
|| strcasecmp(belle_sdp_attribute_get_value(attr),value)==0;
}
......@@ -682,25 +683,25 @@ static void test_mime_parameter(void) {
test_t sdp_tests[] = {
{ "a= (attribute)", test_attribute },
{ "a= (attribute) 2", test_attribute_2 },
{ "a=rtcp-fb", test_rtcp_fb_attribute },
{ "a=rtcp-xr", test_rtcp_xr_attribute },
{ "b= (bandwidth)", test_bandwidth },
{ "o= (IPv4 origin)", test_origin },
{ "o= (malformed origin)", test_malformed_origin },
{ "c= (IPv4 connection)", test_connection },
{ "c= (IPv6 connection)", test_connection_6 },
{ "c= (multicast)", test_connection_multicast},
{ "e= (email)", test_email },
{ "i= (info)", test_info },
{ "m= (media)", test_media },
{ "mime parameter", test_mime_parameter },
{ "Media description", test_media_description },
{ "Simple session description", test_simple_session_description },
{ "Session description", test_session_description },
{ "Session description for fax", test_image_mline },
{ "Marshal buffer overflow", test_overflow }
TEST_NO_TAG("a= (attribute)", test_attribute),
TEST_NO_TAG("a= (attribute) 2", test_attribute_2),
TEST_NO_TAG("a=rtcp-fb", test_rtcp_fb_attribute),
TEST_NO_TAG("a=rtcp-xr", test_rtcp_xr_attribute),
TEST_NO_TAG("b= (bandwidth)", test_bandwidth),
TEST_NO_TAG("o= (IPv4 origin)", test_origin),
TEST_NO_TAG("o= (malformed origin)", test_malformed_origin),
TEST_NO_TAG("c= (IPv4 connection)", test_connection),
TEST_NO_TAG("c= (IPv6 connection)", test_connection_6),
TEST_NO_TAG("c= (multicast)", test_connection_multicast),
TEST_NO_TAG("e= (email)", test_email),
TEST_NO_TAG("i= (info)", test_info),
TEST_NO_TAG("m= (media)", test_media),
TEST_NO_TAG("mime parameter", test_mime_parameter),
TEST_NO_TAG("Media description", test_media_description),
TEST_NO_TAG("Simple session description", test_simple_session_description),
TEST_NO_TAG("Session description", test_session_description),
TEST_NO_TAG("Session description for fax", test_image_mline),
TEST_NO_TAG("Marshal buffer overflow", test_overflow)
};
test_suite_t sdp_test_suite = {"SDP", NULL, NULL, belle_sip_tester_before_each, belle_sip_tester_after_each,
......
......@@ -311,9 +311,9 @@ static void test_presence_marshal(void) {
test_t core_tests[] = {
{ "Object Data", test_object_data },
{ "Dictionary", test_dictionary },
{ "Presence marshal", test_presence_marshal }
TEST_NO_TAG("Object Data", test_object_data),
TEST_NO_TAG("Dictionary", test_dictionary),
TEST_NO_TAG("Presence marshal", test_presence_marshal)
};
test_suite_t core_test_suite = {"Core", NULL, NULL, belle_sip_tester_before_each, belle_sip_tester_after_each,
......
......@@ -1135,47 +1135,47 @@ static void test_accept_header(void) {
}
test_t headers_tests[] = {
{ "Address", test_address_header },
{ "Address tel uri", test_address_header_with_tel_uri },
{ "Header address (very long)", test_very_long_address_header },
{ "Address with error", test_address_with_error_header },
{ "Allow", test_allow_header },
{ "Authorization", test_authorization_header },
{ "Call-ID", test_call_id_header },
{ "Contact (Simple)", test_simple_contact_header },
{ "Contact (Complex)", test_complex_contact_header },
{ "Contact (Param-less address spec)", test_contact_header_with_paramless_address_spec },
{ "Content-Length", test_content_length_header },
{ "Content-Type", test_content_type_header },
{ "CSeq", test_cseq_header },
{ "Date", test_date_header },
{ "Expires", test_expires_header },
{ "From", test_from_header },
{ "From (Param-less address spec)", test_from_header_with_paramless_address_spec },
{ "Max-Forwards", test_max_forwards_header },
{ "Privacy", test_privacy_header },
{ "P-Preferred-Identity", test_p_preferred_identity_header },
{ "Proxy-Authenticate", test_proxy_authenticate_header },
{ "Proxy-Authorization", test_proxy_authorization_header },
{ "Record-Route", test_record_route_header },
{ "Refer-To", test_refer_to_header },
{ "Referred-By", test_referred_by_header },
{ "Replaces", test_replaces_header },
{ "Replaces (Escaped)", test_replaces_escaped_header },
{ "Route", test_route_header },
{ "Service-Route", test_service_route_header },
{ "Subscription-State", test_subscription_state_header },
{ "To", test_to_header },
{ "To (Param-less address spec)", test_to_header_with_paramless_address_spec },
{ "User-Agent", test_user_agent_header },
{ "Via", test_via_header },
{ "WWW-Authenticate", test_www_authenticate_header },
{ "Header extension", test_header_extension_1 },
{ "Header extension 2", test_header_extension_2 },
{ "Header event", test_event_header },
{ "Header Supported", test_supported_header },
{ "Header Content-Disposition", test_content_disposition_header },
{ "Header Accept", test_accept_header }
TEST_NO_TAG("Address", test_address_header),
TEST_NO_TAG("Address tel uri", test_address_header_with_tel_uri),
TEST_NO_TAG("Header address (very long)", test_very_long_address_header),
TEST_NO_TAG("Address with error", test_address_with_error_header),
TEST_NO_TAG("Allow", test_allow_header),
TEST_NO_TAG("Authorization", test_authorization_header),
TEST_NO_TAG("Call-ID", test_call_id_header),
TEST_NO_TAG("Contact (Simple)", test_simple_contact_header),
TEST_NO_TAG("Contact (Complex)", test_complex_contact_header),
TEST_NO_TAG("Contact (Param-less address spec)", test_contact_header_with_paramless_address_spec),
TEST_NO_TAG("Content-Length", test_content_length_header),
TEST_NO_TAG("Content-Type", test_content_type_header),
TEST_NO_TAG("CSeq", test_cseq_header),
TEST_NO_TAG("Date", test_date_header),
TEST_NO_TAG("Expires", test_expires_header),
TEST_NO_TAG("From", test_from_header),
TEST_NO_TAG("From (Param-less address spec)", test_from_header_with_paramless_address_spec),
TEST_NO_TAG("Max-Forwards", test_max_forwards_header),
TEST_NO_TAG("Privacy", test_privacy_header),
TEST_NO_TAG("P-Preferred-Identity", test_p_preferred_identity_header),
TEST_NO_TAG("Proxy-Authenticate", test_proxy_authenticate_header),
TEST_NO_TAG("Proxy-Authorization", test_proxy_authorization_header),
TEST_NO_TAG("Record-Route", test_record_route_header),
TEST_NO_TAG("Refer-To", test_refer_to_header),
TEST_NO_TAG("Referred-By", test_referred_by_header),
TEST_NO_TAG("Replaces", test_replaces_header),
TEST_NO_TAG("Replaces (Escaped)", test_replaces_escaped_header),
TEST_NO_TAG("Route", test_route_header),
TEST_NO_TAG("Service-Route", test_service_route_header),
TEST_NO_TAG("Subscription-State", test_subscription_state_header),
TEST_NO_TAG("To", test_to_header),
TEST_NO_TAG("To (Param-less address spec)", test_to_header_with_paramless_address_spec),
TEST_NO_TAG("User-Agent", test_user_agent_header),
TEST_NO_TAG("Via", test_via_header),
TEST_NO_TAG("WWW-Authenticate", test_www_authenticate_header),
TEST_NO_TAG("Header extension", test_header_extension_1),
TEST_NO_TAG("Header extension 2", test_header_extension_2),
TEST_NO_TAG("Header event", test_event_header),
TEST_NO_TAG("Header Supported", test_supported_header),
TEST_NO_TAG("Header Content-Disposition", test_content_disposition_header),
TEST_NO_TAG("Header Accept", test_accept_header)
};
test_suite_t headers_test_suite = {"Headers", NULL, NULL, belle_sip_tester_before_each, belle_sip_tester_after_each,
......
......@@ -1011,33 +1011,33 @@ void testGetBody(void) {
/* NOTE - ORDER IS IMPORTANT - MUST TEST fread() AFTER fprintf() */
test_t message_tests[] = {
{ "REGISTER", testRegisterMessage },
{ "INVITE", testInviteMessage },
{ "INVITE with tel uri", testInviteMessageWithTelUri},
{ "Option message", testOptionMessage },
{ "REGISTER (Raw)", testRegisterRaw },
{ "401 Response", test401Response },
{ "Response without response phrase",test401ResponseWithoutResponsePhrase},
{ "Origin extraction", test_extract_source },
{ "SIP frag", test_sipfrag },
{ "Malformed invite", testMalformedMessage },
{ "Malformed from", testMalformedFrom },
{ "Malformed mandatory field", testMalformedMandatoryField },
{ "Malformed invite with bad begin", testMalformedMessageWithWrongStart },
{ "Malformed register", testMalformedOptionnalHeaderInMessage },
{ "Channel parser error recovery", channel_parser_tester_recovery_from_error},
{ "Channel parser malformed start", channel_parser_malformed_start},
{ "Channel parser truncated start", channel_parser_truncated_start},
{ "Channel parser truncated start with garbage",channel_parser_truncated_start_with_garbage},
TEST_NO_TAG("REGISTER", testRegisterMessage),
TEST_NO_TAG("INVITE", testInviteMessage),
TEST_NO_TAG("INVITE with tel uri", testInviteMessageWithTelUri),
TEST_NO_TAG("Option message", testOptionMessage),
TEST_NO_TAG("REGISTER (Raw)", testRegisterRaw),
TEST_NO_TAG("401 Response", test401Response),
TEST_NO_TAG("Response without response phrase",test401ResponseWithoutResponsePhrase),
TEST_NO_TAG("Origin extraction", test_extract_source),
TEST_NO_TAG("SIP frag", test_sipfrag),
TEST_NO_TAG("Malformed invite", testMalformedMessage),
TEST_NO_TAG("Malformed from", testMalformedFrom),
TEST_NO_TAG("Malformed mandatory field", testMalformedMandatoryField),
TEST_NO_TAG("Malformed invite with bad begin", testMalformedMessageWithWrongStart),
TEST_NO_TAG("Malformed register", testMalformedOptionnalHeaderInMessage),
TEST_NO_TAG("Channel parser error recovery", channel_parser_tester_recovery_from_error),
TEST_NO_TAG("Channel parser malformed start", channel_parser_malformed_start),
TEST_NO_TAG("Channel parser truncated start", channel_parser_truncated_start),
TEST_NO_TAG("Channel parser truncated start with garbage",channel_parser_truncated_start_with_garbage),
TEST_ONE_TAG("RFC2543 compatibility", testRFC2543Compat, "LeaksMemory"),
TEST_ONE_TAG("RFC2543 compatibility with branch id",testRFC2543CompatWithBranch, "LeaksMemory"),
{ "Uri headers in sip INVITE",testUriHeadersInInvite},
{ "Uris components in request",testUrisComponentsForRequest},
{ "Generic message test",testGenericMessage},
{ "HTTP get",testHttpGet},
{ "HTTP 200 Ok",testHttp200Ok},
{ "Channel parser for HTTP reponse",channel_parser_http_response},
{ "Get body size",testGetBody}
TEST_NO_TAG("Uri headers in sip INVITE",testUriHeadersInInvite),
TEST_NO_TAG("Uris components in request",testUrisComponentsForRequest),
TEST_NO_TAG("Generic message test",testGenericMessage),
TEST_NO_TAG("HTTP get",testHttpGet),
TEST_NO_TAG("HTTP 200 Ok",testHttp200Ok),
TEST_NO_TAG("Channel parser for HTTP reponse",channel_parser_http_response),
TEST_NO_TAG("Get body size",testGetBody)
};
test_suite_t message_test_suite = {"Message", NULL, NULL, belle_sip_tester_before_each, belle_sip_tester_after_each,
......
......@@ -874,29 +874,29 @@ static void simple_publish_with_early_refresher(void) {
}
test_t refresher_tests[] = {
{ "REGISTER Expires header", register_expires_header },
{ "REGISTER Expires in Contact", register_expires_in_contact },
{ "REGISTER Expires header digest", register_expires_header_digest },
{ "REGISTER Expires in Contact digest auth", register_expires_in_contact_header_digest_auth },
{ "REGISTER with failure", register_with_failure },
{ "REGISTER with early refresher",register_early_refresher},
TEST_NO_TAG("REGISTER Expires header", register_expires_header),
TEST_NO_TAG("REGISTER Expires in Contact", register_expires_in_contact),
TEST_NO_TAG("REGISTER Expires header digest", register_expires_header_digest),
TEST_NO_TAG("REGISTER Expires in Contact digest auth", register_expires_in_contact_header_digest_auth),
TEST_NO_TAG("REGISTER with failure", register_with_failure),
TEST_NO_TAG("REGISTER with early refresher",register_early_refresher),