From 7954f36d80d3b93ce031724fdfac03a7030f9b23 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Fri, 17 Apr 2020 16:26:42 +0900 Subject: [PATCH] Tweak tests as a bonus after required rebase... --- ledger-tool/src/main.rs | 4 ++-- runtime/src/append_vec.rs | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 0634d3eb347147..2ae72e2096fd86 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -18,8 +18,8 @@ use solana_ledger::{ }; use solana_runtime::{append_vec::AppendVec, bank::Bank}; use solana_sdk::{ - account::Account, clock::Slot, genesis_config::GenesisConfig, native_token::lamports_to_sol, pubkey::Pubkey, - shred_version::compute_shred_version, + account::Account, clock::Slot, genesis_config::GenesisConfig, native_token::lamports_to_sol, + pubkey::Pubkey, shred_version::compute_shred_version, }; use solana_vote_program::vote_state::VoteState; use std::{ diff --git a/runtime/src/append_vec.rs b/runtime/src/append_vec.rs index 3b5c93205d5fb8..514f3c5b19b2ce 100644 --- a/runtime/src/append_vec.rs +++ b/runtime/src/append_vec.rs @@ -597,6 +597,13 @@ pub mod tests { let _av = AppendVec::new(&path.path, true, 0); } + #[test] + #[should_panic(expected = "Unable to open data path")] + fn test_append_vec_new_not_existing() { + let path = get_append_vec_path("test_append_vec_new_not_existing"); + let _av = AppendVec::new(&path.path, false, 1); + } + #[test] fn test_append_vec_set_file_bad_size() { let file = get_append_vec_path("test_append_vec_set_file_bad_size"); @@ -616,7 +623,7 @@ pub mod tests { } #[test] - fn test_append_vec_new_empty_tmp_rw() { + fn test_append_vec_new_empty_map_rw() { let file = get_append_vec_path("test_append_vec_new_empty_map_rw"); let path = &file.path; @@ -630,7 +637,7 @@ pub mod tests { } #[test] - fn test_append_vec_new_empty_tmp_ro() { + fn test_append_vec_new_empty_map_ro() { let file = get_append_vec_path("test_append_vec_new_empty_map_ro"); let path = &file.path;