()
| 410 | |
| 411 | #[test] |
| 412 | fn test_pread_alloc() { |
| 413 | let temp = TempFile::new().unwrap(); |
| 414 | let file = temp.as_file(); |
| 415 | let data: Vec<u8> = (0..=255).cycle().take(4096).collect(); |
| 416 | file.write_all_at(&data, 0).unwrap(); |
| 417 | |
| 418 | let buf = pread_alloc(file.as_raw_fd(), 0, 4096).unwrap(); |
| 419 | assert_eq!(buf, data); |
| 420 | |
| 421 | let buf = pread_alloc(file.as_raw_fd(), 100, 200).unwrap(); |
| 422 | assert_eq!(buf, &data[100..300]); |
| 423 | |
| 424 | pread_alloc(file.as_raw_fd(), 4000, 200).unwrap_err(); |
| 425 | } |
| 426 | |
| 427 | #[test] |
| 428 | fn test_decompress_cluster() { |
nothing calls this directly
no test coverage detected