This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/4916
tests: clean after tests to avoid sanitize build failures
Add test_common_cleanup() in test_common.c, call in
test-{helpers,hnbap,ranap}.c
Change-Id: Ic66c005f2a264774e18bb54e58b87bef5944511c
---
M src/tests/test-helpers.c
M src/tests/test-hnbap.c
M src/tests/test-ranap.c
M src/tests/test_common.c
M src/tests/test_common.h
5 files changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/16/4916/1
diff --git a/src/tests/test-helpers.c b/src/tests/test-helpers.c
index 44fd735..33ef2e1 100644
--- a/src/tests/test-helpers.c
+++ b/src/tests/test-helpers.c
@@ -211,5 +211,6 @@
test_asn1_helpers();
test_ranap_common();
+ test_common_cleanup();
return 0;
}
diff --git a/src/tests/test-hnbap.c b/src/tests/test-hnbap.c
index ef46070..1e3607b 100644
--- a/src/tests/test-hnbap.c
+++ b/src/tests/test-hnbap.c
@@ -175,6 +175,7 @@
test_asn1_decoding();
+ test_common_cleanup();
return 0;
}
diff --git a/src/tests/test-ranap.c b/src/tests/test-ranap.c
index c1c7003..05be874 100644
--- a/src/tests/test-ranap.c
+++ b/src/tests/test-ranap.c
@@ -197,6 +197,8 @@
talloc_report(talloc_asn1_ctx, stdout);
talloc_report(tall_msgb_ctx, stdout);
//talloc_report(NULL, stdout);
+
+ test_common_cleanup();
printf("exit\n");
exit(0);
}
diff --git a/src/tests/test_common.c b/src/tests/test_common.c
index c8aafdd..5c33680 100644
--- a/src/tests/test_common.c
+++ b/src/tests/test_common.c
@@ -69,11 +69,13 @@
.num_cat = ARRAY_SIZE(log_cat),
};
+static void *msgb_ctx;
+
int test_common_init(void)
{
int rc;
- msgb_talloc_ctx_init(NULL, 0);
+ msgb_ctx = msgb_talloc_ctx_init(NULL, 0);
talloc_asn1_ctx = talloc_named_const(NULL, 0, "asn1_context");
rc = osmo_init_logging(&test_log_info);
@@ -85,3 +87,9 @@
log_set_print_filename(osmo_stderr_target, 0);
log_set_use_color(osmo_stderr_target, 0);
}
+
+void test_common_cleanup(void)
+{
+ talloc_free(msgb_ctx);
+ talloc_free(talloc_asn1_ctx);
+}
diff --git a/src/tests/test_common.h b/src/tests/test_common.h
index 1af1abd..836d999 100644
--- a/src/tests/test_common.h
+++ b/src/tests/test_common.h
@@ -1,3 +1,4 @@
#pragma once
int test_common_init(void);
+void test_common_cleanup(void);
--
To view, visit https://gerrit.osmocom.org/4916
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic66c005f2a264774e18bb54e58b87bef5944511c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>