From 8a4755106d191bb99a4ff5c60fab7ce434418cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 20 Dec 2023 07:36:04 +0100 Subject: [PATCH] girepository: Add gthash test to tests and run it --- girepository/gthash.c | 1 + girepository/{gthash-test.c => tests/gthash.c} | 2 ++ girepository/tests/meson.build | 1 + 3 files changed, 4 insertions(+) rename girepository/{gthash-test.c => tests/gthash.c} (99%) diff --git a/girepository/gthash.c b/girepository/gthash.c index 4a23e4ace..bc1c22a53 100644 --- a/girepository/gthash.c +++ b/girepository/gthash.c @@ -131,6 +131,7 @@ gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) builder->dirmap_offset = ALIGN_VALUE (offset, 4); builder->packed_size = builder->dirmap_offset + (num_elts * sizeof(guint16)); out: + g_strfreev (strs); cmph_config_destroy (config); cmph_io_vector_adapter_destroy (io); return builder->buildable; diff --git a/girepository/gthash-test.c b/girepository/tests/gthash.c similarity index 99% rename from girepository/gthash-test.c rename to girepository/tests/gthash.c index ac55db91d..1b5dce115 100644 --- a/girepository/gthash-test.c +++ b/girepository/tests/gthash.c @@ -53,6 +53,8 @@ test_build_retrieve (void) g_assert (gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); g_assert (gi_typelib_hash_search (buf, "VolumeMonitor", 4) == 9); g_assert (gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); + + g_free (buf); } int diff --git a/girepository/tests/meson.build b/girepository/tests/meson.build index a3386a166..c89a8660e 100644 --- a/girepository/tests/meson.build +++ b/girepository/tests/meson.build @@ -3,6 +3,7 @@ girepository_tests = {} # Some GIR files are needed to test against if enable_gir girepository_tests += { + 'gthash' : {}, 'repository' : { 'depends': [glib_gir, gobject_gir], },