Skip to content

Commit

Permalink
lib: Fix test-path-util unit test with some cwd path lengths
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen authored and GitLab committed Jun 10, 2017
1 parent 83d6ad2 commit dead275
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/test-path-util.c
Expand Up @@ -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) {
Expand Down

0 comments on commit dead275

Please sign in to comment.