Commit 98196343 authored by jehan's avatar jehan

fix unit test

parent eb313fd2
......@@ -71,7 +71,7 @@ libbellesip_la_LIBADD=libbellesip_generated.la $(ANTLR_LIBS) $(TLS_LIBS)
libbellesip_la_LDFLAGS=-no-undefined
INCLUDES=-I$(top_srcdir)/include
AM_CPPFLAGS=-I$(top_srcdir)/include
EXTRA_DIST=$(grammar_files)
......
......@@ -182,6 +182,7 @@ static int belle_sip_dialog_init_as_uac(belle_sip_dialog_t *obj, belle_sip_reque
obj->route_set=belle_sip_list_prepend(obj->route_set,belle_sip_object_ref(belle_sip_header_route_create(
(belle_sip_header_address_t*)elem->data)));
}
check_route_set(obj->route_set);
obj->remote_target=(belle_sip_header_address_t*)belle_sip_object_ref(ct);
obj->local_cseq=belle_sip_header_cseq_get_seq_number(cseq);
......
......@@ -21,7 +21,7 @@ belle_sip_tester_LDFLAGS=$(CUNIT_LIBS)
belle_sip_object_describe_SOURCES=describe.c
INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/src
AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/src
LDADD=$(top_builddir)/src/libbellesip.la
......
......@@ -161,12 +161,13 @@ void unregister_user(belle_sip_stack_t * stack
CU_ASSERT_EQUAL(using_transaction,use_transaction);
belle_sip_provider_remove_sip_listener(prov,l);
}
belle_sip_request_t* register_user_at_domain(belle_sip_stack_t * stack
belle_sip_request_t* try_register_user_at_domain(belle_sip_stack_t * stack
,belle_sip_provider_t *prov
,const char *transport
,int use_transaction
,const char* username
,const char* domain) {
,const char* domain
,int success_expected) {
belle_sip_request_t *req,*copy;
char identity[256];
char uri[256];
......@@ -203,14 +204,22 @@ belle_sip_request_t* register_user_at_domain(belle_sip_stack_t * stack
int i;
for(i=0;!is_register_ok && i<2 ;i++)
belle_sip_stack_sleep(stack,5000);
CU_ASSERT_EQUAL(is_register_ok,1);
CU_ASSERT_EQUAL(is_register_ok,success_expected);
CU_ASSERT_EQUAL(using_transaction,use_transaction);
belle_sip_provider_remove_sip_listener(prov,l);
return copy;
}
belle_sip_request_t* register_user_at_domain(belle_sip_stack_t * stack
,belle_sip_provider_t *prov
,const char *transport
,int use_transaction
,const char* username
,const char* domain) {
return try_register_user_at_domain(stack,prov,transport,use_transaction,username,domain,1);
}
belle_sip_request_t* register_user(belle_sip_stack_t * stack
,belle_sip_provider_t *prov
,const char *transport
......@@ -252,7 +261,8 @@ static void stateful_register_udp_delayed(void){
static void stateful_register_udp_with_send_error(void){
belle_sip_stack_set_send_error(stack,-1);
register_test(NULL,1);
belle_sip_request_t *req;
try_register_user(stack, prov, NULL,1,"tester",0);
belle_sip_stack_set_send_error(stack,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