summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-path-util.c30
-rw-r--r--src/test/test-stat-util.c6
2 files changed, 24 insertions, 12 deletions
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c
index 72b931568..c27624b43 100644
--- a/src/test/test-path-util.c
+++ b/src/test/test-path-util.c
@@ -117,23 +117,33 @@ static void test_path_equal_root(void) {
/* Make sure that files_same works as expected. */
- assert_se(files_same("/", "/") > 0);
- assert_se(files_same("/", "//") > 0);
+ assert_se(files_same("/", "/", 0) > 0);
+ assert_se(files_same("/", "/", AT_SYMLINK_NOFOLLOW) > 0);
+ assert_se(files_same("/", "//", 0) > 0);
+ assert_se(files_same("/", "//", AT_SYMLINK_NOFOLLOW) > 0);
- assert_se(files_same("/", "/./") > 0);
- assert_se(files_same("/", "/../") > 0);
+ assert_se(files_same("/", "/./", 0) > 0);
+ assert_se(files_same("/", "/./", AT_SYMLINK_NOFOLLOW) > 0);
+ assert_se(files_same("/", "/../", 0) > 0);
+ assert_se(files_same("/", "/../", AT_SYMLINK_NOFOLLOW) > 0);
- assert_se(files_same("/", "/.../") == -ENOENT);
+ assert_se(files_same("/", "/.../", 0) == -ENOENT);
+ assert_se(files_same("/", "/.../", AT_SYMLINK_NOFOLLOW) == -ENOENT);
/* The same for path_equal_or_files_same. */
- assert_se(path_equal_or_files_same("/", "/"));
- assert_se(path_equal_or_files_same("/", "//"));
+ assert_se(path_equal_or_files_same("/", "/", 0));
+ assert_se(path_equal_or_files_same("/", "/", AT_SYMLINK_NOFOLLOW));
+ assert_se(path_equal_or_files_same("/", "//", 0));
+ assert_se(path_equal_or_files_same("/", "//", AT_SYMLINK_NOFOLLOW));
- assert_se(path_equal_or_files_same("/", "/./"));
- assert_se(path_equal_or_files_same("/", "/../"));
+ assert_se(path_equal_or_files_same("/", "/./", 0));
+ assert_se(path_equal_or_files_same("/", "/./", AT_SYMLINK_NOFOLLOW));
+ assert_se(path_equal_or_files_same("/", "/../", 0));
+ assert_se(path_equal_or_files_same("/", "/../", AT_SYMLINK_NOFOLLOW));
- assert_se(!path_equal_or_files_same("/", "/.../"));
+ assert_se(!path_equal_or_files_same("/", "/.../", 0));
+ assert_se(!path_equal_or_files_same("/", "/.../", AT_SYMLINK_NOFOLLOW));
}
static void test_find_binary(const char *self) {
diff --git a/src/test/test-stat-util.c b/src/test/test-stat-util.c
index 93d025dac..2825dbc52 100644
--- a/src/test/test-stat-util.c
+++ b/src/test/test-stat-util.c
@@ -38,8 +38,10 @@ static void test_files_same(void) {
assert_se(fd >= 0);
assert_se(symlink(name, name_alias) >= 0);
- assert_se(files_same(name, name));
- assert_se(files_same(name, name_alias));
+ assert_se(files_same(name, name, 0));
+ assert_se(files_same(name, name, AT_SYMLINK_NOFOLLOW));
+ assert_se(files_same(name, name_alias, 0));
+ assert_se(!files_same(name, name_alias, AT_SYMLINK_NOFOLLOW));
unlink(name);
unlink(name_alias);