summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Barth <abarth@google.com>2021-08-11 16:18:52 -0700
committergVisor bot <gvisor-bot@google.com>2021-08-11 16:21:33 -0700
commit23f8e8481678593b83842b58306e2e960752ff4a (patch)
tree5d1a9148512ad92278336cb16995d0b3b35f4d6f
parentc2353e4055ac77d5a205594b5e3d2697b96abd7d (diff)
Fix LinkTest.OldnameDoesNotExist
Previous, this test was the same as OldnameIsEmpty. This CL makes the test check what happens if the old name does not exist. PiperOrigin-RevId: 390243070
-rw-r--r--test/syscalls/linux/link.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/syscalls/linux/link.cc b/test/syscalls/linux/link.cc
index 4f9ca1a65..8b208f99a 100644
--- a/test/syscalls/linux/link.cc
+++ b/test/syscalls/linux/link.cc
@@ -142,7 +142,8 @@ TEST(LinkTest, OldnameIsEmpty) {
TEST(LinkTest, OldnameDoesNotExist) {
const std::string oldname = NewTempAbsPath();
const std::string newname = NewTempAbsPath();
- EXPECT_THAT(link("", newname.c_str()), SyscallFailsWithErrno(ENOENT));
+ EXPECT_THAT(link(oldname.c_str(), newname.c_str()),
+ SyscallFailsWithErrno(ENOENT));
}
TEST(LinkTest, NewnameCannotExist) {