summaryrefslogtreecommitdiff
path: root/test/test_fcntl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_fcntl.rs')
-rw-r--r--test/test_fcntl.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs
index c8773219..1bcf12cb 100644
--- a/test/test_fcntl.rs
+++ b/test/test_fcntl.rs
@@ -58,20 +58,8 @@ fn test_readlink() {
Mode::empty()).unwrap();
let expected_dir = src.to_str().unwrap();
- // When the size of the buffer is bigger than the expected directory length
- let mut buf = vec![0; src.to_str().unwrap().len() + 1];
- assert_eq!(readlink(&dst, &mut buf).unwrap().to_str().unwrap(), expected_dir);
- assert_eq!(readlinkat(dirfd, "b", &mut buf).unwrap().to_str().unwrap(), expected_dir);
-
- // When the size of the buffer is equal to the expected directory length
- let mut exact_buf = vec![0; src.to_str().unwrap().len()];
- assert_eq!(readlink(&dst, &mut exact_buf).unwrap().to_str().unwrap(), expected_dir);
- assert_eq!(readlinkat(dirfd, "b", &mut exact_buf).unwrap().to_str().unwrap(), expected_dir);
-
- // When the size of the buffer is smaller than the expected directory length
- let mut small_buf = vec![0;0];
- assert_eq!(readlink(&dst, &mut small_buf).unwrap().to_str().unwrap(), "");
- assert_eq!(readlinkat(dirfd, "b", &mut small_buf).unwrap().to_str().unwrap(), "");
+ assert_eq!(readlink(&dst).unwrap().to_str().unwrap(), expected_dir);
+ assert_eq!(readlinkat(dirfd, "b").unwrap().to_str().unwrap(), expected_dir);
}