Skip to content
Permalink
Browse files

Take extra allocation into account

  • Loading branch information
Licenser committed Jan 28, 2020
1 parent 908cacf commit ba3e6e8601bb13dc89be777b2965dfe5b4210237
Showing with 7 additions and 6 deletions.
  1. +7 −6 tests/alloc.rs
@@ -17,17 +17,18 @@ macro_rules! test {
let f = String::from(concat!("data/", stringify!($file), ".json"));
File::open(f).unwrap().read_to_end(&mut v1).unwrap();
let (count, _v) = count_alloc(|| to_tape(&mut v1));
dbg!(&count);
assert!(count.0 <= $alloc);
assert!(count.1 <= $realloc);
assert!(count.2 <= $drop);
}
};
}

test!(canada, 4, 0, 3);
test!(citm_catalog, 4, 0, 3);
test!(log, 4, 0, 3);
test!(marine_ik, 4, 1, 3);
test!(twitter, 4, 0, 3);
test!(twitterescaped, 4, 0, 3);
test!(canada, 5, 0, 4);
test!(citm_catalog, 5, 0, 4);
test!(log, 5, 0, 4);
test!(marine_ik, 5, 1, 4);
test!(twitter, 5, 0, 4);
test!(twitterescaped, 5, 0, 4);
test!(numbers, 5, 0, 4);

0 comments on commit ba3e6e8

Please sign in to comment.
You can’t perform that action at this time.