Skip to content

Commit

Permalink
Add a simple test for size of SupportedMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
locka99 committed Apr 19, 2019
1 parent baf2db1 commit ae55846
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions types/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod parse;
mod serialize;
mod variant;
mod hello;
mod supported_message;

use std::fmt::Debug;
use std::cmp::PartialEq;
Expand Down
10 changes: 10 additions & 0 deletions types/src/tests/supported_message.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::supported_message::SupportedMessage;

#[test]
fn size() {
// Test that the SupportedMessage size isn't huge
use std::mem;
let size = mem::size_of::<SupportedMessage>();
println!("SupportedMessage size = {}", size);
assert!(size <= 16);
}

0 comments on commit ae55846

Please sign in to comment.