summaryrefslogtreecommitdiff
path: root/tests/test-mutable-tree.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2016-12-02 13:45:04 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2016-12-05 15:20:56 +0000
commite1c48c8adbd14f8767d44d46b1a7a5f896ab1129 (patch)
tree736082a328e2e9eec0227c1765ce29b0d860b14d /tests/test-mutable-tree.c
parent7bb0ff46a438977297329ad6949faa4fae06f543 (diff)
downloadostree-e1c48c8adbd14f8767d44d46b1a7a5f896ab1129.tar.gz
[ASAN] tests: Cleanup all current remaining leaks
We now run fully through ASAN here. Closes: #609 Approved by: jlebon
Diffstat (limited to 'tests/test-mutable-tree.c')
-rw-r--r--tests/test-mutable-tree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test-mutable-tree.c b/tests/test-mutable-tree.c
index b357f691..9df36ac6 100644
--- a/tests/test-mutable-tree.c
+++ b/tests/test-mutable-tree.c
@@ -84,7 +84,7 @@ test_ensure_parent_dirs (void)
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
g_autoptr(GPtrArray) split_path = NULL;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
const char *pathname = "/foo/bar/baz";
const char *checksum = "01234567890123456789012345678901";
g_autofree char *source_checksum = NULL;
@@ -103,6 +103,7 @@ test_ensure_parent_dirs (void)
g_assert_false (ostree_mutable_tree_lookup (tree, "bar", &source_checksum2,
&source_subdir2, &error));
+ g_clear_error (&error);
}
static void
@@ -110,7 +111,7 @@ test_ensure_dir (void)
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *parent = NULL;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
const char *dirname = "foo";
const char *filename = "bar";
const char *checksum = "01234567890123456789012345678901";
@@ -122,13 +123,14 @@ test_ensure_dir (void)
g_assert (ostree_mutable_tree_replace_file (tree, filename, checksum, &error));
g_assert_false (ostree_mutable_tree_ensure_dir (tree, filename, &parent, &error));
+ g_clear_error (&error);
}
static void
test_replace_file (void)
{
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
const char *filename = "bar";
const char *checksum = "01234567890123456789012345678901";
const char *checksum2 = "ABCDEF01234567890123456789012345";
@@ -157,7 +159,7 @@ test_contents_checksum (void)
const char *subdir_checksum = "ABCD0123456789012345678901234567";
glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
glnx_unref_object OstreeMutableTree *subdir = NULL;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
g_assert_null (ostree_mutable_tree_get_contents_checksum (tree));
ostree_mutable_tree_set_contents_checksum (tree, checksum);