1
0
mirror of https://github.com/bspeice/aeron-rs synced 2025-07-05 07:44:51 -04:00

Minor cleanup of the CnC version check

This commit is contained in:
2019-10-02 23:11:44 -04:00
parent 27a8ce0dd4
commit 49bfb1edb9
2 changed files with 19 additions and 2 deletions

View File

@ -60,9 +60,12 @@ pub struct MetaDataDefinition {
_pid: i64,
}
/// Version code for the Aeron CnC file format
pub const CNC_VERSION: i32 = crate::sematic_version_compose(0, 0, 16);
#[cfg(test)]
mod tests {
use crate::client::cnc_descriptor::MetaDataDefinition;
use crate::client::cnc_descriptor::{MetaDataDefinition, CNC_VERSION};
use crate::driver::{DriverContext, MediaDriver};
use memmap::MmapOptions;
use std::fs::File;
@ -87,6 +90,6 @@ mod tests {
};
let metadata: &MetaDataDefinition = unsafe { &*(mmap.as_ptr().cast()) };
assert_eq!(metadata.cnc_version, 16);
assert_eq!(metadata.cnc_version, CNC_VERSION);
}
}