Skip to content

Commit 749b2b0

Browse files
committed
Re-enable the VClock ordering tests
1 parent d2e1c37 commit 749b2b0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/tools/miri/src/concurrency/vector_clock.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,9 @@ impl IndexMut<VectorIdx> for VClock {
378378
#[cfg(test)]
379379
mod tests {
380380

381-
use super::{VClock, VectorIdx};
381+
use super::{VClock, VTimestamp, VectorIdx};
382382
use rustc_span::DUMMY_SP;
383+
use std::cmp::Ordering;
383384

384385
#[test]
385386
fn test_equal() {
@@ -396,7 +397,6 @@ mod tests {
396397
assert_eq!(c1, c2);
397398
}
398399

399-
/*
400400
#[test]
401401
fn test_partial_order() {
402402
// Small test
@@ -442,14 +442,14 @@ mod tests {
442442
);
443443
}
444444

445-
fn from_slice(mut slice: &[VTimestamp]) -> VClock {
445+
fn from_slice(mut slice: &[u32]) -> VClock {
446446
while let Some(0) = slice.last() {
447447
slice = &slice[..slice.len() - 1]
448448
}
449-
VClock(smallvec::SmallVec::from_slice(slice))
449+
VClock(slice.iter().copied().map(|time| VTimestamp { time, span: DUMMY_SP }).collect())
450450
}
451451

452-
fn assert_order(l: &[VTimestamp], r: &[VTimestamp], o: Option<Ordering>) {
452+
fn assert_order(l: &[u32], r: &[u32], o: Option<Ordering>) {
453453
let l = from_slice(l);
454454
let r = from_slice(r);
455455

@@ -505,5 +505,4 @@ mod tests {
505505
"Invalid alt (>=):\n l: {l:?}\n r: {r:?}"
506506
);
507507
}
508-
*/
509508
}

0 commit comments

Comments
 (0)