]> git.ipfire.org Git - pakfire.git/commitdiff
tests: Check if reference counting is working
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Jun 2019 01:46:44 +0000 (02:46 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Jun 2019 01:46:44 +0000 (02:46 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/testsuite.c

index 627f8ef8bc691681a818b7a7336245affa54ed18..246345f8430e74d59fc0692680d7c7d1d17f4373 100644 (file)
@@ -51,7 +51,13 @@ static int test_run(test_t* t) {
                LOG("Test failed with error code: %d\n", r);
 
        // Release pakfire
-       pakfire_unref(t->pakfire);
+       t->pakfire = pakfire_unref(t->pakfire);
+
+       // Check if Pakfire was actually released
+       if (t->pakfire) {
+               LOG("Error: Pakfire instance was not released\n");
+               return 1;
+       }
 
        return r;
 }