workspacify
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
mod clock;
|
||||
mod rply;
|
||||
mod statestream;
|
||||
pub use clock::{Counter, Timer, Times, counts, stats};
|
||||
pub use rply::*;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub struct InvalidDeterminant(pub u8);
|
||||
impl std::fmt::Display for InvalidDeterminant {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn v2_header() {
|
||||
let mut file =
|
||||
std::io::BufReader::new(std::fs::File::open("examples/bobl.replay").unwrap());
|
||||
let header = match rply::decode(&mut file).unwrap().header {
|
||||
rply::Header::V0V1(_) => panic!("Version too low"),
|
||||
rply::Header::V2(h) => h,
|
||||
};
|
||||
assert_eq!(header.base.version, 2);
|
||||
assert_eq!(header.base.content_crc, 2_199_475_946);
|
||||
assert_eq!(header.base.initial_state_size, 2531);
|
||||
assert_eq!(header.base.identifier, 1_761_326_589);
|
||||
assert_eq!(header.frame_count, 6383);
|
||||
assert_eq!(header.block_size, 128);
|
||||
assert_eq!(header.superblock_size, 16);
|
||||
assert_eq!(header.checkpoint_commit_interval, 4);
|
||||
assert_eq!(header.checkpoint_commit_threshold, 2);
|
||||
assert_eq!(header.checkpoint_compression, rply::Compression::None);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user