Commit 712bad64 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix build with latest bctoolbox.

parent 990ab5fa
...@@ -120,12 +120,12 @@ void belle_sip_tester_uninit(void) { ...@@ -120,12 +120,12 @@ void belle_sip_tester_uninit(void) {
bc_tester_uninit(); bc_tester_uninit();
} }
void belle_sip_tester_before_each() { void belle_sip_tester_before_each(void) {
belle_sip_object_enable_leak_detector(TRUE); belle_sip_object_enable_leak_detector(TRUE);
leaked_objects_count = belle_sip_object_get_object_count(); leaked_objects_count = belle_sip_object_get_object_count();
} }
int belle_sip_tester_after_each() { void belle_sip_tester_after_each(void) {
int leaked_objects = belle_sip_object_get_object_count() - leaked_objects_count; int leaked_objects = belle_sip_object_get_object_count() - leaked_objects_count;
if (leaked_objects > 0) { if (leaked_objects > 0) {
char* format = belle_sip_strdup_printf("%d object%s leaked in suite [%s] test [%s], please fix that!", char* format = belle_sip_strdup_printf("%d object%s leaked in suite [%s] test [%s], please fix that!",
...@@ -147,14 +147,11 @@ int belle_sip_tester_after_each() { ...@@ -147,14 +147,11 @@ int belle_sip_tester_after_each() {
// if the test is NOT marked as leaking memory and it actually is, we should make it fail // if the test is NOT marked as leaking memory and it actually is, we should make it fail
if (!leaks_expected && leaked_objects > 0) { if (!leaks_expected && leaked_objects > 0) {
BC_FAIL("This test is leaking memory!"); BC_FAIL("This test is leaking memory!");
return 1;
// and reciprocally // and reciprocally
} else if (leaks_expected && leaked_objects == 0) { } else if (leaks_expected && leaked_objects == 0) {
BC_FAIL("This test is not leaking anymore, please remove LeaksMemory tag!"); BC_FAIL("This test is not leaking anymore, please remove LeaksMemory tag!");
return 1;
} }
} }
return 0;
} }
int belle_sip_tester_set_log_file(const char *filename) { int belle_sip_tester_set_log_file(const char *filename) {
......
...@@ -54,7 +54,7 @@ void belle_sip_tester_set_root_ca_path(const char *root_ca_path); ...@@ -54,7 +54,7 @@ void belle_sip_tester_set_root_ca_path(const char *root_ca_path);
void belle_sip_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args)); void belle_sip_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args));
void belle_sip_tester_uninit(void); void belle_sip_tester_uninit(void);
void belle_sip_tester_before_each(void); void belle_sip_tester_before_each(void);
int belle_sip_tester_after_each(void); void belle_sip_tester_after_each(void);
int belle_sip_tester_set_log_file(const char *filename); int belle_sip_tester_set_log_file(const char *filename);
#ifdef __cplusplus #ifdef __cplusplus
......
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