From 749b2b077d0e350dd3ebeac014ab1f3c31d92ca3 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Tue, 20 Dec 2022 22:54:44 -0500 Subject: [PATCH] Re-enable the VClock ordering tests --- src/tools/miri/src/concurrency/vector_clock.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/tools/miri/src/concurrency/vector_clock.rs b/src/tools/miri/src/concurrency/vector_clock.rs index 0dcd6830b4e..d6d8e1c4b3a 100644 --- a/src/tools/miri/src/concurrency/vector_clock.rs +++ b/src/tools/miri/src/concurrency/vector_clock.rs @@ -378,8 +378,9 @@ fn index_mut(&mut self, index: VectorIdx) -> &mut VTimestamp { #[cfg(test)] mod tests { - use super::{VClock, VectorIdx}; + use super::{VClock, VTimestamp, VectorIdx}; use rustc_span::DUMMY_SP; + use std::cmp::Ordering; #[test] fn test_equal() { @@ -396,7 +397,6 @@ fn test_equal() { assert_eq!(c1, c2); } - /* #[test] fn test_partial_order() { // Small test @@ -442,14 +442,14 @@ fn test_partial_order() { ); } - fn from_slice(mut slice: &[VTimestamp]) -> VClock { + fn from_slice(mut slice: &[u32]) -> VClock { while let Some(0) = slice.last() { slice = &slice[..slice.len() - 1] } - VClock(smallvec::SmallVec::from_slice(slice)) + VClock(slice.iter().copied().map(|time| VTimestamp { time, span: DUMMY_SP }).collect()) } - fn assert_order(l: &[VTimestamp], r: &[VTimestamp], o: Option) { + fn assert_order(l: &[u32], r: &[u32], o: Option) { let l = from_slice(l); let r = from_slice(r); @@ -505,5 +505,4 @@ fn assert_order(l: &[VTimestamp], r: &[VTimestamp], o: Option) { "Invalid alt (>=):\n l: {l:?}\n r: {r:?}" ); } - */ }