Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
struct testsuite ts;
static int test_run(int i, struct test* t) {
+ struct pakfire_ctx* ctx = NULL;
struct pakfire* p = NULL;
FILE* c = NULL;
t->pakfire = NULL;
}
- if (t->ctx)
- pakfire_ctx_unref(t->ctx);
+ // Release context
+ if (t->ctx) {
+ ctx = pakfire_ctx_unref(t->ctx);
+
+ // Check if the context was actually released
+ if (ctx) {
+ LOG("Error: Context was not released in test %s\n", t->name);
+ r = 1;
+ }
+
+ // Reset pointer (just in case)
+ t->ctx = NULL;
+ }
// Close the configuration file
if (c)