From dead275d577c87b8f8ba476a7709db758dfffb9b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 10 Jun 2017 10:35:54 +0300 Subject: [PATCH] lib: Fix test-path-util unit test with some cwd path lengths The component-component directory might not have been created at all, in which case the following symlink creations would fail since they were already created to the same directory in a previous test. --- src/lib/test-path-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/test-path-util.c b/src/lib/test-path-util.c index 0d1c761c82..9c05617397 100644 --- a/src/lib/test-path-util.c +++ b/src/lib/test-path-util.c @@ -133,7 +133,7 @@ static void test_link_alloc(void) string_t *basedir = t_str_new(256); str_append(basedir, cwd); str_append(basedir, "/"TEMP_DIRNAME); - size_t len = nearest_power(I_MAX(127, str_len(basedir))) - + size_t len = nearest_power(I_MAX(127, str_len(basedir) + strlen(COMPONENT_COMPONENT) + 1)) - strlen(COMPONENT_COMPONENT); while(str_len(basedir) < len) { -- 2.47.3