mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
cros_async: fix unittest for uring
It was broken by the RawFd removal from GuestMemory. Change-Id: Ifa927fb7f6a84db55ca27e0f8ffa42475a3f8c58 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2533723 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Michael Hoyle <mikehoyle@google.com> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
parent
a596a07b0c
commit
a7d1886067
1 changed files with 5 additions and 7 deletions
|
@ -299,17 +299,15 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn read_to_mem() {
|
fn read_to_mem() {
|
||||||
use vm_memory::{GuestAddress, GuestMemory};
|
|
||||||
|
|
||||||
use crate::uring_mem::VecIoWrapper;
|
use crate::uring_mem::VecIoWrapper;
|
||||||
|
use std::io::Write;
|
||||||
|
use tempfile::tempfile;
|
||||||
|
|
||||||
let io_obj = Box::pin({
|
let io_obj = Box::pin({
|
||||||
// Use guest memory as a test file, it implements AsRawFd.
|
// Use guest memory as a test file, it implements AsRawFd.
|
||||||
let source = GuestMemory::new(&[(GuestAddress(0), 8192)]).unwrap();
|
let mut source = tempfile().unwrap();
|
||||||
source
|
let data = vec![0x55; 8192];
|
||||||
.get_slice_at_addr(GuestAddress(0), 8192)
|
source.write(&data).unwrap();
|
||||||
.unwrap()
|
|
||||||
.write_bytes(0x55);
|
|
||||||
UringSource::new(source).unwrap()
|
UringSource::new(source).unwrap()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue