Add test for size for size of session types

This commit is contained in:
Joseph Birr-Pixton 2019-05-26 21:25:33 +01:00
parent 8aec7342fc
commit c66eabf935
1 changed files with 13 additions and 0 deletions

View File

@ -1939,3 +1939,16 @@ fn exercise_key_log_file_for_server() {
server.process_new_packets().unwrap();
}
}
fn assert_lt(left: usize, right: usize) {
if left >= right {
panic!("expected {} < {}", left, right);
}
}
#[test]
fn session_types_are_not_huge() {
// Arbitrary sizes
assert_lt(mem::size_of::<ServerSession>(), 1536);
assert_lt(mem::size_of::<ClientSession>(), 1536);
}