summaryrefslogtreecommitdiff
path: root/cpio/test/test_option_l.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2009-09-11 01:28:37 -0400
committerTim Kientzle <kientzle@gmail.com>2009-09-11 01:28:37 -0400
commit89eaf435abccc3c0e1314dc8b8df1b8ead7d638a (patch)
tree48a2f4fe92cf7a0fb02d35e0ad9ba8b5e67f9e1f /cpio/test/test_option_l.c
parentff8bb58006641a912545ba4f3489b50f2936a112 (diff)
downloadlibarchive-89eaf435abccc3c0e1314dc8b8df1b8ead7d638a.tar.gz
Real hardlink detection on Windows (yes, Windows stat() really does seem to be that broken!). Also, expose the core hardlink test as a non-assertion so we can assert it false.
In particular, this fixes test_option_l on Windows. SVN-Revision: 1452
Diffstat (limited to 'cpio/test/test_option_l.c')
-rw-r--r--cpio/test/test_option_l.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/cpio/test/test_option_l.c b/cpio/test/test_option_l.c
index 81135d58..f2cd5bfb 100644
--- a/cpio/test/test_option_l.c
+++ b/cpio/test/test_option_l.c
@@ -27,23 +27,18 @@ __FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_l)
{
- struct stat st, st2;
int r;
/* Create a file. */
assertMakeFile("f", 0644, "a");
- /* Stat it. */
- assertEqualInt(0, stat("f", &st));
-
/* Copy the file to the "copy" dir. */
r = systemf("echo f | %s -pd copy >copy.out 2>copy.err",
testprog);
assertEqualInt(r, 0);
/* Check that the copy is a true copy and not a link. */
- assertEqualInt(0, stat("copy/f", &st2));
- assert(st2.st_ino != st.st_ino);
+ assert(!isFileHardlinks("f", "copy/f"));
/* Copy the file to the "link" dir with the -l option. */
r = systemf("echo f | %s -pld link >link.out 2>link.err",
@@ -51,6 +46,5 @@ DEFINE_TEST(test_option_l)
assertEqualInt(r, 0);
/* Check that this is a link and not a copy. */
- assertEqualInt(0, stat("link/f", &st2));
- assert(st2.st_ino == st.st_ino);
+ assertFileHardlinks("f", "link/f");
}