Skip to content

Commit aee7a3f

Browse files
committed
fix: unblock hdf5 checkpoint tests
1 parent dfb013f commit aee7a3f

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/io/checkpoint.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(non_local_definitions)]
2+
13
use std::path::Path;
24
use std::time::{SystemTime, UNIX_EPOCH};
35

src/state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use num_complex::Complex64;
22

33
use crate::grid::Grid3;
44

5+
#[derive(Debug, Clone, PartialEq)]
56
pub struct State3 {
67
pub psi: Vec<Complex64>,
78
}

tests/hdf5_roundtrip.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![cfg(feature = "checkpoint-hdf5")]
22

33
use std::path::PathBuf;
4+
use std::time::{SystemTime, UNIX_EPOCH};
45

56
use kore::{
67
io::{load_checkpoint, save_checkpoint, CURRENT_SCHEMA_VERSION},
@@ -10,7 +11,11 @@ use num_complex::Complex64;
1011
use tempfile::tempdir;
1112

1213
fn temp_file(name: &str) -> PathBuf {
13-
tempdir().unwrap().into_path().join(name)
14+
let unique = SystemTime::now()
15+
.duration_since(UNIX_EPOCH)
16+
.unwrap()
17+
.as_nanos();
18+
std::env::temp_dir().join(format!("{name}-{unique}.h5"))
1419
}
1520

1621
#[test]

0 commit comments

Comments
 (0)