squeeze/garbage

This commit is contained in:
Nikolay Volf 2016-01-27 13:38:47 +04:00
parent 8d8782056a
commit b4263c1755
1 changed files with 11 additions and 3 deletions

View File

@ -799,12 +799,20 @@ mod tests {
}
#[test]
fn blocks_get_garbage_collected() {
fn can_be_squeezed() {
let bc = get_populated_bc();
bc.squeeze_to_fit(CacheSize { blocks: 0, block_logs: 0, transaction_addresses: 0, block_details: 0, blocks_blooms: 0 } );
assert_eq!(bc.cache_size().blocks, 0);
assert_eq!(bc.cache_size().block_details, 0);
assert_eq!(bc.cache_size().blocks, 1624);
assert_eq!(bc.cache_size().block_details, 3712);
assert_eq!(bc.cache_size().block_logs, 0);
assert_eq!(bc.cache_size().blocks_blooms, 0);
}
#[test]
fn can_collect_garbage() {
let bc = get_populated_bc();
bc.collect_garbage(false);
assert_eq!(bc.cache_size().blocks, 1624);
}
}