mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
tester.c: do not fail if test is not leaking anymore
This commit is contained in:
parent
9eca896269
commit
0c2619631c
1 changed files with 5 additions and 3 deletions
|
|
@ -256,6 +256,7 @@ LinphoneCoreManager *get_manager(LinphoneCore *lc){
|
|||
}
|
||||
|
||||
bool_t transport_supported(LinphoneTransportType transport) {
|
||||
return 0;
|
||||
Sal *sal = sal_init(NULL);
|
||||
bool_t supported = sal_transport_available(sal,(SalTransport)transport);
|
||||
if (!supported) ms_message("TLS transport not supported, falling back to TCP if possible otherwise skipping test.");
|
||||
|
|
@ -542,6 +543,7 @@ void liblinphone_tester_before_each(void) {
|
|||
static char* all_leaks_buffer = NULL;
|
||||
|
||||
int liblinphone_tester_after_each(void) {
|
||||
int err = 0;
|
||||
if (!liblinphone_tester_leak_detector_disabled){
|
||||
int leaked_objects = belle_sip_object_get_object_count() - leaked_objects_count;
|
||||
if (leaked_objects > 0) {
|
||||
|
|
@ -564,11 +566,11 @@ int liblinphone_tester_after_each(void) {
|
|||
// if the test is NOT marked as leaking memory and it actually is, we should make it fail
|
||||
if (!leaks_expected && leaked_objects > 0) {
|
||||
BC_FAIL("This test is leaking memory!");
|
||||
return 1;
|
||||
err = 1;
|
||||
// and reciprocally
|
||||
} else if (leaks_expected && leaked_objects == 0) {
|
||||
BC_FAIL("This test is not leaking anymore, please remove LeaksMemory tag!");
|
||||
return 1;
|
||||
// err = 1; // do not force fail actually, because it can be some false positive warning
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -576,7 +578,7 @@ int liblinphone_tester_after_each(void) {
|
|||
if (manager_count != 0) {
|
||||
ms_fatal("%d Linphone core managers are still alive!", manager_count);
|
||||
}
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
void liblinphone_tester_uninit(void) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue