Commit 97b27aba authored by jehan's avatar jehan

implement recv error path, start ipv6

parent 7d343308
......@@ -64,6 +64,14 @@ void belle_sip_provider_clean_channels(belle_sip_provider_t *p);
**/
int belle_sip_provider_add_authorization(belle_sip_provider_t *p, belle_sip_request_t* request,belle_sip_response_t *resp,belle_sip_list_t** auth_infos);
/**
* Can be used to simulate network recv error, for tests.
* @param stack
* @param recv_error if <=0, will cause channel error to be reported
**/
void belle_sip_provider_set_recv_error(belle_sip_provider_t *prov, int recv_error);
BELLE_SIP_END_DECLS
#define BELLE_SIP_PROVIDER(obj) BELLE_SIP_CAST(obj,belle_sip_provider_t)
......
......@@ -10,7 +10,7 @@ generated_src= \
belle_sdpLexer.c belle_sdpLexer.h
$(builddir)/generated_src_stamp : $(grammar_files)
$(ANTLR) -make -fo $(builddir) $(grammar_files)
$(ANTLR) -make -fo $(builddir) $(grammar_files)
touch $(builddir)/generated_src_stamp
$(generated_src) : $(builddir)/generated_src_stamp
......
......@@ -198,12 +198,15 @@ sess_id: DIGIT*;
// ;should be unique for this originating username/host
sess_version: DIGIT+;
//;0 is a new session
//;0 is a new session
connection_address: multicast_address
| addr;
connection_address:
multicast_address: (decimal_uchar decimal_uchar decimal_uchar DOT) decimal_uchar '/' ttl ( '/' integer )?;
/*multicast_address
|*/addr;
multicast_address: unicast_address '/' ttl;
// (decimal_uchar DOT decimal_uchar DOT decimal_uchar DOT) decimal_uchar '/' ttl ( '/' integer )?;
//;multicast addresses may be in the range
//;224.0.0.0 to 239.255.255.255
......@@ -249,25 +252,32 @@ phone: text;//'+' DIGIT*POS_DIGIT (SPACE | '-' | DIGIT)*;
nettype: alpha_num+;//'IN';
// ;list to be extended
addrtype: alpha_num+; //'IP4' | 'IP6';
addrtype: alpha_num+ ; //'IP4' | 'IP6';
//;list to be extended
addr: (fqdn)=>fqdn | unicast_address ;
addr: unicast_address ;
fqdn : ( domainlabel DOT )* toplabel DOT? ;
fqdn: (alpha_num |'-'|DOT)*;
// ;fully qualified domain name as specified in RFC1035
domainlabel : alpha_num | (alpha_num ( alpha_num | DASH )* alpha_num) ;
toplabel : alpha | (alpha ( alpha_num | DASH )* alpha_num) ;
unicast_address : (alpha_num | DOT | COLON| DASH)*; /*might be better defined*/
/* ipv4_address
|ipv6_address
|fqdn*/
unicast_address: ipv4_address ;//| ipv6_address
ipv4_address : decimal_uchar DOT decimal_uchar DOT decimal_uchar DOT decimal_uchar ;
ipv4_address : b1 DOT decimal_uchar DOT decimal_uchar DOT b4;
b1: decimal_uchar;
//;less than "224"; not "0" or "127"
b4: decimal_uchar;
//;not "0"
//ip6_address : ;//to be defined
text : ~(CR|LF)*;
ipv6_address : (hexpart)=>hexpart ( COLON ipv4_address )? ;
hexpart : hexseq | hexseq COLON COLON hexseq? | COLON COLON hexseq? ;
hexseq : hex4 ( COLON hex4)* ;
hex4 : hexdigit+; /* hexdigit hexdigit hexdigit ;*/
text : ~(CR|LF)* ;
//default is to interpret this as IS0-10646 UTF8
//ISO 8859-1 requires a "a=charset:ISO-8859-1"
//session-level attribute to be used
......@@ -275,21 +285,26 @@ text : ~(CR|LF)*;
byte_string options { greedy = false; }: (.)* ;
//any byte except NUL, CR or LF
decimal_uchar: d+=DIGIT+ {$d->count<=3}? ;
decimal_uchar: integer;// (d+=DIGIT+ {$d !=NULL && $d->count<=3}?)
integer: POS_DIGIT DIGIT*;
integer: DIGIT+;
email_safe : byte_string;
token : alpha_num | '!' | '#' | '$' |'&'| '%'| '\'' | '*' |'+' | '-' | '.' ;
alpha_num: ALPHA | DIGIT;
token : alpha_num | '!' | '#' | '$' |'&'| '%'| '\'' | '*' |'+' | DASH | DOT ;
alpha_num: (alpha | DIGIT) ;
hexdigit: (HEX_CHAR | DIGIT) ;
alpha: (COMMON_CHAR | HEX_CHAR);
DIGIT: ZERO | POS_DIGIT;
fragment ZERO: '0';
fragment POS_DIGIT : '1'..'9';
ALPHA: 'a'..'z'|'A'..'Z';
//ALPHA: 'a'..'z'|'A'..'Z';
COMMON_CHAR
: 'g'..'z' | 'G'..'Z' ;
HEX_CHAR: 'a'..'f' |'A'..'F';
SPACE: ' ';
//CRLF : CR LF { USER1 = (int)(ctx->pLexer->input->currentLine - ctx->pLexer->input->data);};
......@@ -301,4 +316,5 @@ DOT: '.';
EQUAL: '=';
COLON: ':';
SLASH: '/';
DASH: '-';
ANY_EXCEPT_CR_LF: ~(CR|LF);
......@@ -458,7 +458,17 @@ int belle_sip_header_via_marshal(belle_sip_header_via_t* via, char* buff,unsigne
unsigned int current_offset=offset;
current_offset+=belle_sip_header_marshal(BELLE_SIP_HEADER(via), buff,current_offset, buff_size);
current_offset+=snprintf(buff+current_offset,buff_size-current_offset,"%s/%s",via->protocol,via->transport);
current_offset+=snprintf(buff+current_offset,buff_size-current_offset," %s",via->host);
if (via->host) {
if (strchr(via->host,':')) { /*ipv6*/
current_offset+=snprintf(buff+current_offset,buff_size-current_offset," [%s]",via->host);
} else {
current_offset+=snprintf(buff+current_offset,buff_size-current_offset," %s",via->host);
}
} else {
belle_sip_warning("no host found in this via");
}
if (via->port > 0) {
current_offset+=snprintf(buff+current_offset,buff_size-current_offset,":%i",via->port);
}
......
......@@ -195,6 +195,7 @@ struct belle_sip_source{
unsigned char cancelled;
unsigned char expired;
belle_sip_socket_t sock;
unsigned int notify_required; /*for testing purpose, use to ask for being scheduled*/
};
void belle_sip_socket_source_init(belle_sip_source_t *s, belle_sip_source_func_t func, void *data, belle_sip_socket_t fd, unsigned int events, unsigned int timeout_value_ms);
......@@ -455,6 +456,7 @@ struct belle_sip_stack{
int transport_timeout;
int tx_delay; /*used to simulate network transmission delay, for tests*/
int send_error; /* used to simulate network error. if <0, channel_send will return this value*/
};
belle_sip_hop_t* belle_sip_hop_create(const char* transport, const char* host,int port);
......@@ -477,6 +479,7 @@ struct belle_sip_provider{
belle_sip_list_t *server_transactions;
belle_sip_list_t *dialogs;
belle_sip_list_t *auth_contexts;
};
belle_sip_provider_t *belle_sip_provider_new(belle_sip_stack_t *s, belle_sip_listening_point_t *lp);
......
......@@ -359,7 +359,12 @@ void belle_sip_main_loop_iterate(belle_sip_main_loop_t *ml){
if (!s->cancelled){
if (s->fd!=(belle_sip_fd_t)-1){
revents=belle_sip_source_get_revents(s,pfd);
if (s->notify_required) { /*for testing purpose to force channel to read*/
revents=BELLE_SIP_EVENT_READ;
s->notify_required=0; /*reset*/
} else {
revents=belle_sip_source_get_revents(s,pfd);
}
}
if (revents!=0 || (s->timeout>=0 && cur>=s->expire_ms)){
char *objdesc=belle_sip_object_to_string((belle_sip_object_t*)s);
......
......@@ -1055,7 +1055,7 @@ other_transport
: token;
sent_by
: host {belle_sip_header_via_set_host($header_via::current,(const char*)$host.text->chars);}
: host {belle_sip_header_via_set_host($header_via::current,$host.ret);}
( COLON port {belle_sip_header_via_set_port($header_via::current,$port.ret);} )? ;
/*
warning
......@@ -1196,19 +1196,24 @@ password : ( unreserved |'&' | EQUAL | '+' | '$' | COMMA )*;
hostport[belle_sip_uri_t* uri]
scope { belle_sip_uri_t* current; }
@init {$hostport::current=uri;}
: host ( COLON port {belle_sip_uri_set_port($hostport::current,$port.ret);})? {belle_sip_uri_set_host($hostport::current,(const char *)$host.text->chars);};
host : (hostname | ipv4address | ipv6reference) ;
: host ( COLON port {belle_sip_uri_set_port($hostport::current,$port.ret);})? {belle_sip_uri_set_host($hostport::current,$host.ret);};
host returns [const char* ret]
scope { const char* current; }
@init {$host::current=NULL;}
: (hostname {$host::current=(const char *)$hostname.text->chars;}
| ipv4address {$host::current=(const char *)$ipv4address.text->chars;}
| ipv6reference ) {$ret=$host::current;};
hostname : ( domainlabel '.' )* toplabel '.'? ;
domainlabel : alphanum | (alphanum ( alphanum | '-' )* alphanum) ;
toplabel : alpha | (alpha ( alphanum | '-' )* alphanum) ;
ipv4address : three_digit '.' three_digit '.' three_digit '.' three_digit;
ipv6reference : '[' ipv6address ']';
ipv6address : hexpart ( COLON ipv4address )?;
ipv4address : three_digit '.' three_digit '.' three_digit '.' three_digit ;
ipv6reference : '[' ipv6address ']'{$host::current=(const char *)$ipv6address.text->chars;};
ipv6address : hexpart ( COLON ipv4address )? ;
hexpart : hexseq | hexseq '::' ( hexseq )? | '::' ( hexseq )?;
hexseq : hex4 ( COLON hex4)*;
hex4 : hexdigit hexdigit hexdigit hexdigit ;
hex4 : hexdigit+;/* hexdigit hexdigit hexdigit ;*/
port returns [int ret]: DIGIT+ { $ret=atoi((const char *)$text->chars); };
......
......@@ -78,7 +78,11 @@ int belle_sip_uri_marshal(const belle_sip_uri_t* uri, char* buff,unsigned int of
current_offset+=snprintf(buff+current_offset,buff_size-current_offset,"%s@",uri->user);
}
if (uri->host) {
current_offset+=snprintf(buff+current_offset,buff_size-current_offset,"%s",uri->host);
if (strchr(uri->host,':')) { /*ipv6*/
current_offset+=snprintf(buff+current_offset,buff_size-current_offset,"[%s]",uri->host);
} else {
current_offset+=snprintf(buff+current_offset,buff_size-current_offset,"%s",uri->host);
}
} else {
belle_sip_warning("no host found in this uri");
}
......@@ -317,3 +321,4 @@ int belle_sip_uri_equals(const belle_sip_uri_t* uri_a,const belle_sip_uri_t* uri
*/
return 1;
}
......@@ -129,7 +129,7 @@ static size_t belle_sip_channel_input_stream_get_buff_length(belle_sip_channel_i
return MAX_CHANNEL_BUFF_SIZE - (input_stream->write_ptr-input_stream->read_ptr);
}
void belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revents){
int belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revents){
int num;
int offset;
int i;
......@@ -138,11 +138,15 @@ void belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revent
int content_length;
if (revents) {
num=belle_sip_channel_recv(obj,obj->input_stream.write_ptr,belle_sip_channel_input_stream_get_buff_length(&obj->input_stream)-1);
/*write ptr is only incremented if data were acquired from the transport*/
obj->input_stream.write_ptr+=num;
/*first null terminate the read buff*/
*obj->input_stream.write_ptr='\0';
if (obj->recv_error>0) {
num=belle_sip_channel_recv(obj,obj->input_stream.write_ptr,belle_sip_channel_input_stream_get_buff_length(&obj->input_stream)-1);
/*write ptr is only incremented if data were acquired from the transport*/
obj->input_stream.write_ptr+=num;
/*first null terminate the read buff*/
*obj->input_stream.write_ptr='\0';
} else {
num=obj->recv_error;
}
}
else
num=obj->input_stream.write_ptr-obj->input_stream.read_ptr;
......@@ -206,7 +210,7 @@ void belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revent
}
}
return;
return BELLE_SIP_CONTINUE;
message_ready:
obj->incoming_messages=belle_sip_list_append(obj->incoming_messages,obj->input_stream.msg);
belle_sip_channel_input_stream_reset(&obj->input_stream,message_size);
......@@ -215,16 +219,18 @@ void belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revent
/*process residu*/
belle_sip_channel_process_data(obj,0);
}
return;
return BELLE_SIP_CONTINUE;
} else if (num == 0) {
channel_set_state(obj,BELLE_SIP_CHANNEL_DISCONNECTED);
belle_sip_channel_close(obj);
return BELLE_SIP_STOP;
} else {
belle_sip_error("Receive error on channel [%p]",obj);
channel_set_state(obj,BELLE_SIP_CHANNEL_ERROR);
belle_sip_channel_close(obj);
return BELLE_SIP_STOP;
}
return;
return BELLE_SIP_CONTINUE;
}
......@@ -236,7 +242,7 @@ void belle_sip_channel_init(belle_sip_channel_t *obj, belle_sip_stack_t *stack,c
if (strcmp(bindip,"::0")!=0 && strcmp(bindip,"0.0.0.0")!=0)
obj->local_ip=belle_sip_strdup(bindip);
obj->local_port=localport;
obj->recv_error=1;/*not set*/
belle_sip_channel_input_stream_reset(&obj->input_stream,0);
}
......
......@@ -88,6 +88,7 @@ struct belle_sip_channel{
belle_sip_message_t *msg;
belle_sip_list_t* incoming_messages;
belle_sip_channel_input_stream_t input_stream;
int recv_error; /* used to simulate network error. if <=0, channel_recv will return this value*/
};
#define BELLE_SIP_CHANNEL(obj) BELLE_SIP_CAST(obj,belle_sip_channel_t)
......@@ -141,7 +142,7 @@ void channel_set_state(belle_sip_channel_t *obj, belle_sip_channel_state_t state
void channel_process_queue(belle_sip_channel_t *obj);
/*just invokes the listeners to process data*/
void belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revents);
int belle_sip_channel_process_data(belle_sip_channel_t *obj,unsigned int revents);
BELLE_SIP_DECLARE_CUSTOM_VPTR_BEGIN(belle_sip_channel_t,belle_sip_source_t)
const char *transport;
......
......@@ -794,3 +794,13 @@ int belle_sip_provider_add_authorization(belle_sip_provider_t *p, belle_sip_requ
}
return result;
}
void belle_sip_provider_set_recv_error(belle_sip_provider_t *prov, int recv_error) {
belle_sip_list_t *lps;
belle_sip_list_t *channels;
for(lps=prov->lps;lps!=NULL;lps=lps->next){
for(channels=((belle_sip_listening_point_t*)lps->data)->channels;channels!=NULL;channels=channels->next){
((belle_sip_channel_t*)channels->data)->recv_error=recv_error;
((belle_sip_source_t*)channels->data)->notify_required=(recv_error<=0);
}
}
}
......@@ -154,9 +154,10 @@ static int stream_channel_process_data(belle_sip_channel_t *obj,unsigned int rev
return BELLE_SIP_CONTINUE;
} else if ( obj->state == BELLE_SIP_CHANNEL_READY) {
belle_sip_channel_process_data(obj,revents);
return belle_sip_channel_process_data(obj,revents);
} else {
belle_sip_warning("Unexpected event [%i], in state [%s] for channel [%p]",revents,belle_sip_channel_state_to_string(obj->state),obj);
return BELLE_SIP_STOP;
}
return BELLE_SIP_CONTINUE;
}
......
......@@ -104,6 +104,22 @@ static void test_connection(void) {
belle_sip_object_unref(BELLE_SIP_OBJECT(lConnection));
belle_sip_free(l_raw_connection);
}
static void test_connection_6(void) {
belle_sdp_connection_t* lTmp;
belle_sdp_connection_t* lConnection = belle_sdp_connection_parse("c=IN IP6 2a01:e35:1387:1020:6233:4bff:fe0b:5663");
char* l_raw_connection = belle_sip_object_to_string(BELLE_SIP_OBJECT(lConnection));
belle_sip_object_unref(BELLE_SIP_OBJECT(lConnection));
lTmp = belle_sdp_connection_parse(l_raw_connection);
lConnection = BELLE_SDP_CONNECTION(belle_sip_object_clone(BELLE_SIP_OBJECT(lTmp)));
belle_sip_object_unref(BELLE_SIP_OBJECT(lTmp));
CU_ASSERT_STRING_EQUAL(belle_sdp_connection_get_address(lConnection), "2a01:e35:1387:1020:6233:4bff:fe0b:5663");
CU_ASSERT_STRING_EQUAL(belle_sdp_connection_get_address_type(lConnection), "IP6");
CU_ASSERT_STRING_EQUAL(belle_sdp_connection_get_network_type(lConnection), "IN");
belle_sip_object_unref(BELLE_SIP_OBJECT(lConnection));
belle_sip_free(l_raw_connection);
}
static void test_email(void) {
belle_sdp_email_t* lTmp;
belle_sdp_email_t* l_email = belle_sdp_email_parse("e= jehan <jehan@linphone.org>");
......@@ -275,7 +291,7 @@ static void simple_session_description(void) {
static void test_session_description(void) {
const char* l_src = "v=0\r\n"\
"o=jehan-mac 1239 1239 IN IP4 192.168.0.18\r\n"\
"o=jehan-mac 1239 1239 IN IP6 2a01:e35:1387:1020:6233:4bff:fe0b:5663\r\n"\
"s=SIP Talk\r\n"\
"c=IN IP4 192.168.0.18\r\n"\
"b=AS:380\r\n"\
......@@ -310,8 +326,8 @@ static void test_session_description(void) {
belle_sdp_origin_t* l_origin = belle_sdp_session_description_get_origin(l_session_description);
CU_ASSERT_PTR_NOT_NULL(l_origin);
CU_ASSERT_STRING_EQUAL(belle_sdp_origin_get_address(l_origin),"192.168.0.18")
CU_ASSERT_STRING_EQUAL(belle_sdp_origin_get_address_type(l_origin),"IP4")
CU_ASSERT_STRING_EQUAL(belle_sdp_origin_get_address(l_origin),"2a01:e35:1387:1020:6233:4bff:fe0b:5663")
CU_ASSERT_STRING_EQUAL(belle_sdp_origin_get_address_type(l_origin),"IP6")
CU_ASSERT_STRING_EQUAL(belle_sdp_origin_get_network_type(l_origin),"IN")
CU_ASSERT_EQUAL(belle_sdp_origin_get_session_id(l_origin),1239)
CU_ASSERT_EQUAL(belle_sdp_origin_get_session_version(l_origin),1239)
......@@ -433,7 +449,10 @@ int belle_sdp_test_suite () {
/* add the tests to the suite */
/* NOTE - ORDER IS IMPORTANT - MUST TEST fread() AFTER fprintf() */
if (NULL == CU_add_test(pSuite, "connection", test_connection)) {
if (NULL == CU_add_test(pSuite, "test_connection", test_connection)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_connection_6", test_connection_6)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "attribute", test_attribute)) {
......@@ -463,7 +482,7 @@ int belle_sdp_test_suite () {
if (NULL == CU_add_test(pSuite, "simple_session_description", simple_session_description)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "session_description", test_session_description)) {
if (NULL == CU_add_test(pSuite, "test_session_description", test_session_description)) {
return CU_get_error();
}
return 0;
......
......@@ -156,7 +156,7 @@ void test_simple_header_to(void) {
}
void test_header_via(void) {
belle_sip_header_via_t* L_tmp;
belle_sip_header_via_t* L_via = belle_sip_header_via_parse("Via: SIP/2.0/UDP 192.168.0.19:5062;rport;received=192.169.0.4;branch=z9hG4bK368560724");
belle_sip_header_via_t* L_via = belle_sip_header_via_parse("Via: SIP/2.0/UDP [::1]:5062;rport;received=192.169.0.4;branch=z9hG4bK368560724");
char* l_raw_header = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_via));
belle_sip_object_unref(BELLE_SIP_OBJECT(L_via));
L_tmp = belle_sip_header_via_parse(l_raw_header);
......@@ -166,7 +166,7 @@ void test_header_via(void) {
CU_ASSERT_STRING_EQUAL(belle_sip_header_via_get_protocol(L_via), "SIP/2.0");
CU_ASSERT_STRING_EQUAL(belle_sip_header_via_get_transport(L_via), "UDP");
CU_ASSERT_STRING_EQUAL(belle_sip_header_via_get_host(L_via), "192.168.0.19");
CU_ASSERT_STRING_EQUAL(belle_sip_header_via_get_host(L_via), "::1");
CU_ASSERT_EQUAL(belle_sip_header_via_get_port(L_via),5062);
CU_ASSERT_TRUE(belle_sip_parameters_is_parameter(BELLE_SIP_PARAMETERS(L_via),"rport"));
......
......@@ -20,14 +20,6 @@
#include <stdio.h>
#include "CUnit/Basic.h"
static int init_suite_uri(void) {
return 0;
}
static int clean_suite_uri(void) {
return 0;
}
static void testSIMPLEURI(void) {
belle_sip_uri_t* L_tmp;
......@@ -60,6 +52,29 @@ static void testCOMPLEXURI(void) {
CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_transport_param(L_uri), "tcp");
belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
}
static void testIPV6URI_base(const char* ip6) {
belle_sip_uri_t* L_tmp;
char uri[256];
snprintf(uri,sizeof(uri),"sip:toto@[%s]:5060;transport=tcp",ip6);
belle_sip_uri_t * L_uri = belle_sip_uri_parse(uri);
char* l_raw_uri = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_uri));
belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
L_tmp = belle_sip_uri_parse(l_raw_uri);
L_uri = BELLE_SIP_URI(belle_sip_object_clone(BELLE_SIP_OBJECT(L_tmp)));
belle_sip_object_unref(BELLE_SIP_OBJECT(L_tmp));
belle_sip_free(l_raw_uri);
CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_user(L_uri), "toto");
CU_ASSERT_EQUAL(belle_sip_uri_get_port(L_uri), 5060);
CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_host(L_uri),ip6);
CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_transport_param(L_uri), "tcp");
belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
}
static void testIPV6URI(void) {
testIPV6URI_base("fe80::1");
testIPV6URI_base("2a01:e35:1387:1020:6233:4bff:fe0b:5663");
}
static void testSIPSURI(void) {
belle_sip_uri_t * L_uri = belle_sip_uri_parse("sips:linphone.org");
......@@ -268,30 +283,41 @@ static void test_uri_equals(void) {
}
int belle_sip_uri_test_suite () {
CU_pSuite pSuite = NULL;
/* add a suite to the registry */
pSuite = CU_add_suite("Uri", init_suite_uri, clean_suite_uri);
if (NULL == pSuite) {
return CU_get_error();
}
/* add the tests to the suite */
/* NOTE - ORDER IS IMPORTANT - MUST TEST fread() AFTER fprintf() */
if ((NULL == CU_add_test(pSuite, "test of simple uri", testSIMPLEURI))
|| (NULL == CU_add_test(pSuite, "test of complex uri", testCOMPLEXURI))
|| (NULL == CU_add_test(pSuite, "test of ip uri", test_ip_host))
|| (NULL == CU_add_test(pSuite, "test of lr uri", test_lr))
|| (NULL == CU_add_test(pSuite, "test of maddr uri", test_maddr))
|| (NULL == CU_add_test(pSuite, "test of headers", test_headers))
|| (NULL == CU_add_test(pSuite, "test of uri parameters", test_uri_parameters))
|| (NULL == CU_add_test(pSuite, "test of sips uri", testSIPSURI))
|| (NULL == CU_add_test(pSuite, "test of uri equal", test_uri_equals))
|| (NULL == CU_add_test(pSuite, "test of error uri", testSIMPLEURI_error)))
{
return CU_get_error();
}
return CU_get_error();
CU_pSuite pSuite = CU_add_suite("Uri", NULL, NULL);
if (NULL == CU_add_test(pSuite, "testSIMPLEURI", testSIMPLEURI)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "testCOMPLEXURI", testCOMPLEXURI)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_ip_host", test_ip_host)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_lr", test_lr)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_maddr", test_maddr)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_headers", test_headers)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_uri_parameters", test_uri_parameters)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "testSIPSURI", testSIPSURI)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "test_uri_equals", test_uri_equals)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "testSIMPLEURI_error", testSIMPLEURI_error)) {
return CU_get_error();
}
if (NULL == CU_add_test(pSuite, "testIPV6URI", testIPV6URI)) {
return CU_get_error();
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment