Skip to content

Commit 26b22e7

Browse files
committed
windows: make tests work with only feature backend-mmap
The tests module in mmap/windows.rs assumed that `crate::bitmap` was always available, but it is not. Hide the imports / usage of that crate behind appropriate cfgs. Fixes: 4757a4a ("do not backdoor-enable backend-bitmap in unittests") Signed-off-by: Patrick Roy <[email protected]>
1 parent 1ef0e61 commit 26b22e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mmap/windows.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ impl<B> Drop for MmapRegion<B> {
245245
mod tests {
246246
use std::os::windows::io::FromRawHandle;
247247

248+
#[cfg(feature = "backend-bitmap")]
248249
use crate::bitmap::AtomicBitmap;
249250
use crate::guest_memory::FileOffset;
250251
use crate::mmap::windows::INVALID_HANDLE_VALUE;
@@ -260,6 +261,7 @@ mod tests {
260261
}
261262

262263
#[test]
264+
#[cfg(feature = "backend-bitmap")]
263265
fn test_dirty_tracking() {
264266
// Using the `crate` prefix because we aliased `MmapRegion` to `MmapRegion<()>` for
265267
// the rest of the unit tests above.

0 commit comments

Comments
 (0)