From 853219c67f5977ac0ccbd4892b4b2a17c78d6271 Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Wed, 19 Aug 2020 15:57:29 +0100 Subject: [PATCH] tests: Assert that the fake home didn't already exist Signed-off-by: Simon McVittie <smcv@collabora.com> --- tests/fake-home.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/fake-home.c b/tests/fake-home.c index a1f59352e..5bd39f8cb 100644 --- a/tests/fake-home.c +++ b/tests/fake-home.c @@ -57,7 +57,9 @@ fake_home_new (const gchar *home) g_assert_cmpstr (dirname, !=, "/tmp"); g_assert_cmpstr (dirname, !=, "/var/tmp"); fake_home->home = g_strdup (home); - g_assert_cmpint (g_mkdir_with_parents (fake_home->home, 0755), ==, 0); + g_assert_cmpint (g_mkdir_with_parents (dirname, 0755) == 0 ? 0 : errno, ==, 0); + /* It should not already exist */ + g_assert_cmpint (g_mkdir (fake_home->home, 0755) == 0 ? 0 : errno, ==, 0); g_free (dirname); } else -- GitLab