From b11a950bb1d7acb8128335e1b44db1080d4d3ba5 Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Fri, 3 Apr 2020 04:06:00 -0400 Subject: [PATCH] test verifying size of a Trade struct --- src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 977b105..413e675 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,4 +49,22 @@ mod tests { Ok(false) )); } + + #[test] + fn memory_size_of_trades_struct() { + use markets::crypto::{Exchange, Ticker, Side}; + + struct Trade { + pub time: u64, + pub price: f64, + pub amount: f64, + pub exch: Exchange, + pub ticker: Ticker, + pub server_time: Option, + pub side: Option, + } + + assert_eq!(std::mem::size_of::(), 48); + assert_eq!(std::mem::size_of::(), 2); + } }