From cff7c7adb17bcfcb36dedcb6255c570119b5983f Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Mon, 19 Feb 2024 15:47:47 +0200 Subject: [PATCH] [ofono] Don't care about whitespace in config unit test. JB#61330 New glib keeps some extra line feed on the merged conf file data. It shouldn't really matter so ignore such differences on the test. --- ofono/unit/test-conf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ofono/unit/test-conf.c b/ofono/unit/test-conf.c index 48d9fb9b..5dfe022b 100644 --- a/ofono/unit/test-conf.c +++ b/ofono/unit/test-conf.c @@ -75,6 +75,7 @@ static void test_merge1(const char *conf, const char *conf1, const char *out) char *file1 = g_strconcat(subdir, "/bar.conf", NULL); GKeyFile *k = g_key_file_new(); char *data; + char *out_stripped = g_strstrip(g_strdup(out)); g_assert(!mkdir(subdir, 0700)); g_assert(g_file_set_contents(file, conf, -1, NULL)); @@ -84,8 +85,9 @@ static void test_merge1(const char *conf, const char *conf1, const char *out) g_key_file_set_list_separator(k, ','); ofono_conf_merge_files(k, file); data = g_key_file_to_data(k, NULL, NULL); + g_strstrip(data); DBG("\n%s", data); - g_assert(!g_strcmp0(data, out)); + g_assert(!g_strcmp0(data, out_stripped)); g_free(data); g_key_file_unref(k); @@ -94,6 +96,7 @@ static void test_merge1(const char *conf, const char *conf1, const char *out) remove(subdir); remove(dir); + g_free(out_stripped); g_free(file); g_free(file1); g_free(dir);