summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2015-05-04 17:58:26 -0400
committerMatthew Barnes <mbarnes@redhat.com>2015-05-06 21:50:17 -0400
commit7a62d64968160d27cbd90aeeed754eb185135f91 (patch)
treeb6bc24af82d7ac03f42ec58f15507caa8cca869f /tests
parent4f33515316a374867e093171f219cbd6e5e4f5bd (diff)
downloadostree-7a62d64968160d27cbd90aeeed754eb185135f91.tar.gz
Use g_autofree instead of gs_free
Diffstat (limited to 'tests')
-rw-r--r--tests/test-bsdiff.c6
-rw-r--r--tests/test-gpg-verify-result.c4
-rw-r--r--tests/test-keyfile-utils.c4
-rw-r--r--tests/test-mutable-tree.c12
-rw-r--r--tests/test-ot-tool-util.c8
-rw-r--r--tests/test-varint.c2
6 files changed, 18 insertions, 18 deletions
diff --git a/tests/test-bsdiff.c b/tests/test-bsdiff.c
index 1769cb9c..4078a2b8 100644
--- a/tests/test-bsdiff.c
+++ b/tests/test-bsdiff.c
@@ -66,9 +66,9 @@ test_bsdiff (void)
struct bsdiff_stream bsdiff_stream;
struct bspatch_stream bspatch_stream;
int i;
- gs_free guint8 *old = g_new (guint8, OLD_SIZE);
- gs_free guint8 *new = g_new (guint8, NEW_SIZE);
- gs_free guint8 *new_generated = g_new0 (guint8, NEW_SIZE);
+ g_autofree guint8 *old = g_new (guint8, OLD_SIZE);
+ g_autofree guint8 *new = g_new (guint8, NEW_SIZE);
+ g_autofree guint8 *new_generated = g_new0 (guint8, NEW_SIZE);
gs_unref_object GOutputStream *out = g_memory_output_stream_new_resizable ();
gs_unref_object GInputStream *in = NULL;
diff --git a/tests/test-gpg-verify-result.c b/tests/test-gpg-verify-result.c
index c00e90a5..19b23b87 100644
--- a/tests/test-gpg-verify-result.c
+++ b/tests/test-gpg-verify-result.c
@@ -56,8 +56,8 @@ test_fixture_setup (TestFixture *fixture,
gpgme_data_t data_buffer;
gpgme_data_t signature_buffer;
OstreeGpgVerifyResult *result;
- gs_free char *homedir = NULL;
- gs_free char *filename = NULL;
+ g_autofree char *homedir = NULL;
+ g_autofree char *filename = NULL;
GError *local_error = NULL;
/* Mimic what OstreeGpgVerifier does to create OstreeGpgVerifyResult.
diff --git a/tests/test-keyfile-utils.c b/tests/test-keyfile-utils.c
index 25e86f62..551b508b 100644
--- a/tests/test-keyfile-utils.c
+++ b/tests/test-keyfile-utils.c
@@ -181,8 +181,8 @@ test_copy_group (void)
for (ii = 0; ii < length; ii++)
{
- gs_free char *value = NULL;
- gs_free char *value2 = NULL;
+ g_autofree char *value = NULL;
+ g_autofree char *value2 = NULL;
value = g_key_file_get_value (g_keyfile, section, keys[ii], NULL);
value2 = g_key_file_get_value (g_keyfile, section, keys[ii], NULL);
diff --git a/tests/test-mutable-tree.c b/tests/test-mutable-tree.c
index 771ccabd..d351f40f 100644
--- a/tests/test-mutable-tree.c
+++ b/tests/test-mutable-tree.c
@@ -72,7 +72,7 @@ test_mutable_tree_walk (void)
{
gs_unref_object OstreeMutableTree *subdir = NULL;
gs_unref_object OstreeMutableTree *a = NULL;
- gs_free char *source_checksum = NULL;
+ g_autofree char *source_checksum = NULL;
ostree_mutable_tree_lookup (tree, "a", &source_checksum, &a, &error);
g_assert (ostree_mutable_tree_walk (a, split_path, 1, &subdir, &error));
g_assert (subdir);
@@ -88,9 +88,9 @@ test_ensure_parent_dirs (void)
GError *error = NULL;
const char *pathname = "/foo/bar/baz";
const char *checksum = "01234567890123456789012345678901";
- gs_free char *source_checksum = NULL;
+ g_autofree char *source_checksum = NULL;
gs_unref_object OstreeMutableTree *source_subdir = NULL;
- gs_free char *source_checksum2 = NULL;
+ g_autofree char *source_checksum2 = NULL;
gs_unref_object OstreeMutableTree *source_subdir2 = NULL;
g_assert (ot_util_path_split_validate (pathname, &split_path, &error));
@@ -116,7 +116,7 @@ test_ensure_dir (void)
const char *dirname = "foo";
const char *filename = "bar";
const char *checksum = "01234567890123456789012345678901";
- gs_free char *source_checksum = NULL;
+ g_autofree char *source_checksum = NULL;
gs_unref_object OstreeMutableTree *source_subdir = NULL;
g_assert (ostree_mutable_tree_ensure_dir (tree, dirname, &parent, &error));
@@ -139,7 +139,7 @@ test_replace_file (void)
g_assert (ostree_mutable_tree_replace_file (tree, filename, checksum, &error));
{
- gs_free char *out_checksum = NULL;
+ g_autofree char *out_checksum = NULL;
gs_unref_object OstreeMutableTree *subdir = NULL;
g_assert (ostree_mutable_tree_lookup (tree, filename, &out_checksum, &subdir, &error));
g_assert_cmpstr (checksum, ==, out_checksum);
@@ -147,7 +147,7 @@ test_replace_file (void)
g_assert (ostree_mutable_tree_replace_file (tree, filename, checksum2, &error));
{
- gs_free char *out_checksum = NULL;
+ g_autofree char *out_checksum = NULL;
gs_unref_object OstreeMutableTree *subdir = NULL;
g_assert (ostree_mutable_tree_lookup (tree, filename, &out_checksum, &subdir, &error));
g_assert_cmpstr (checksum2, ==, out_checksum);
diff --git a/tests/test-ot-tool-util.c b/tests/test-ot-tool-util.c
index e9b35213..04041323 100644
--- a/tests/test-ot-tool-util.c
+++ b/tests/test-ot-tool-util.c
@@ -87,8 +87,8 @@ test_ot_parse_keyvalue (void)
for (i = 0; i < G_N_ELEMENTS (keyvalue); i++)
{
- gs_free char *out_key = NULL;
- gs_free char *out_value = NULL;
+ g_autofree char *out_key = NULL;
+ g_autofree char *out_value = NULL;
g_assert_true (ot_parse_keyvalue (keyvalue[i],
&out_key,
&out_value,
@@ -98,8 +98,8 @@ test_ot_parse_keyvalue (void)
}
{
- gs_free char *out_key = NULL;
- gs_free char *out_value = NULL;
+ g_autofree char *out_key = NULL;
+ g_autofree char *out_value = NULL;
g_assert_false (ot_parse_keyvalue ("blabla",
&out_key,
&out_value,
diff --git a/tests/test-varint.c b/tests/test-varint.c
index e069fc57..c62b397d 100644
--- a/tests/test-varint.c
+++ b/tests/test-varint.c
@@ -36,7 +36,7 @@ check_one_roundtrip (guint64 val)
if (g_test_verbose ())
{
gs_unref_variant GVariant *v = g_variant_new_from_data (G_VARIANT_TYPE ("ay"), buf->str, buf->len, TRUE, NULL, NULL);
- gs_free char *data = g_variant_print (v, FALSE);
+ g_autofree char *data = g_variant_print (v, FALSE);
g_test_message ("%" G_GUINT64_FORMAT " -> %s", val, data);
}
g_assert (_ostree_read_varuint64 ((guint8*)buf->str, buf->len, &newval, &bytes_read));