From: Ian Jackson Date: Mon, 25 Apr 2022 00:26:28 +0000 (+0100) Subject: hidden: Add checks for un-notched to vpid::consistency_check X-Git-Tag: otter-1.1.0~440 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c625d627bd9a3b6d4d30ea02e03e119a99966dbd;p=otter.git hidden: Add checks for un-notched to vpid::consistency_check Signed-off-by: Ian Jackson --- diff --git a/src/vpid.rs b/src/vpid.rs index cbc433a5..a1785839 100644 --- a/src/vpid.rs +++ b/src/vpid.rs @@ -405,6 +405,8 @@ pub fn consistency_check( let occ = goccults.occults.get(occid).unwrap(); if let Some(notch) = permute_notch { assert_eq!(occ.notches.table[notch], NR::Piece(piece)); + } else { + assert!(occ.unnotched.contains(&piece)); } } } @@ -438,6 +440,11 @@ pub fn consistency_check( walk = next; } assert_eq!(nfree1, nfree2); + + for &ppiece in &occ.unnotched { + assert_eq!(gpieces.get(ppiece).unwrap().occult.passive, + Some(Passive { occid, permute_notch: None })); + } } }