persisted_chan_data_0 = persister_0.load_channel_data(nodes[0].keys_manager).unwrap();
assert_eq!(persisted_chan_data_0.keys().len(), 1);
for mon in persisted_chan_data_0.values() {
+ println!("VMW: checking mon 0 update id:");
assert_eq!(mon.get_latest_update_id(), $expected_update_id);
}
persisted_chan_data_1 = persister_1.load_channel_data(nodes[1].keys_manager).unwrap();
assert_eq!(persisted_chan_data_1.keys().len(), 1);
for mon in persisted_chan_data_1.values() {
+ println!("VMW: checking mon 1 update id:");
assert_eq!(mon.get_latest_update_id(), $expected_update_id);
}
}
// monitor's file. We induce this failure by making the `tmp` file a
// directory.
// Explanation: given "from" = the file being renamed, "to" = the
- // renamee that already exists: Windows should fail because it'll fail
- // whenever "to" is a directory, and Unix should fail because if "from" is a
+ // renamee that already exists: Unix should fail because if "from" is a
// file, then "to" is also required to be a file.
#[test]
+ #[cfg(not(target_os = "windows"))]
fn test_rename_failure() {
let test_writeable = TestWriteable{};
let filename = "test_rename_failure_filename";
fs::create_dir_all(get_full_filepath(path.to_string(), filename.to_string())).unwrap();
match write_to_file(path.to_string(), filename.to_string(), &test_writeable) {
Err(e) => {
- println!("VMW: error in test_rename_failure: {:?}", e);
- #[cfg(not(target_os = "windows"))]
assert_eq!(e.kind(), io::ErrorKind::Other);
- #[cfg(target_os = "windows")]
- assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
}
- _ => panic!("Unexpected error message")
+ _ => panic!("Unexpected Ok(())")
}
fs::remove_dir_all(path).unwrap();
}