From: Valentine Wallace Date: Wed, 17 Feb 2021 18:56:13 +0000 (-0500) Subject: which monitor is failing? X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=45302ec73e99dd55e1eae7ca7f8e0eaf2b62c585;p=rust-lightning which monitor is failing? --- diff --git a/lightning-persister/src/lib.rs b/lightning-persister/src/lib.rs index dd7a0d04d..588992449 100644 --- a/lightning-persister/src/lib.rs +++ b/lightning-persister/src/lib.rs @@ -217,11 +217,13 @@ mod tests { 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); } } diff --git a/lightning-persister/src/util.rs b/lightning-persister/src/util.rs index 8f116963e..ed3aa27e6 100644 --- a/lightning-persister/src/util.rs +++ b/lightning-persister/src/util.rs @@ -155,10 +155,10 @@ mod tests { // 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"; @@ -167,13 +167,9 @@ mod tests { 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(); }