chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bc17a4
)
hidden: Add checks for un-notched to vpid::consistency_check
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 25 Apr 2022 00:26:28 +0000
(
01:26
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 25 Apr 2022 00:31:17 +0000
(
01:31
+0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/vpid.rs
patch
|
blob
|
history
diff --git
a/src/vpid.rs
b/src/vpid.rs
index cbc433a5016203838e1214d092b451089025f321..a1785839a4e7087b056fcbb58ecb7d1777d0845b 100644
(file)
--- 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 }));
+ }
}
}