mirror of
https://github.com/bspeice/aeron-rs
synced 2024-12-22 05:48:10 -05:00
Minor cleanup of CnC descriptor test
This commit is contained in:
parent
adfa401245
commit
143e21bf0a
@ -70,7 +70,6 @@ pub const CNC_FILE: &str = "cnc.dat";
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::client::cnc_descriptor::{MetaDataDefinition, CNC_FILE, CNC_VERSION};
|
use crate::client::cnc_descriptor::{MetaDataDefinition, CNC_FILE, CNC_VERSION};
|
||||||
use crate::client::concurrent::atomic_buffer::AtomicBuffer;
|
|
||||||
use crate::driver::DriverContext;
|
use crate::driver::DriverContext;
|
||||||
use memmap::MmapOptions;
|
use memmap::MmapOptions;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
@ -78,17 +77,15 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn read_cnc_version() {
|
fn read_cnc_version() {
|
||||||
let dir = tempdir().unwrap();
|
let dir = tempdir().unwrap().into_path();
|
||||||
let dir_path = dir.as_ref().to_path_buf();
|
|
||||||
dir.close().unwrap();
|
|
||||||
|
|
||||||
let _driver = DriverContext::default()
|
let _driver = DriverContext::default()
|
||||||
.set_aeron_dir(&dir_path)
|
.set_aeron_dir(&dir)
|
||||||
|
.set_dir_delete_on_start(true)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Open the CnC location
|
// Open the CnC location
|
||||||
let cnc_path = dir_path.join(CNC_FILE);
|
let cnc_path = dir.join(CNC_FILE);
|
||||||
let cnc_file = File::open(&cnc_path).expect("Unable to open CnC file");
|
let cnc_file = File::open(&cnc_path).expect("Unable to open CnC file");
|
||||||
let mmap = unsafe {
|
let mmap = unsafe {
|
||||||
MmapOptions::default()
|
MmapOptions::default()
|
||||||
|
Loading…
Reference in New Issue
Block a user