From 79e9269f141d0e4a4bfd88747381557bde54384c Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 6 May 2022 23:33:19 +0100 Subject: [PATCH] Add value size checks tests --- lib/src/sql/value/value.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/src/sql/value/value.rs b/lib/src/sql/value/value.rs index 264d835a..18c58ef4 100644 --- a/lib/src/sql/value/value.rs +++ b/lib/src/sql/value/value.rs @@ -1333,6 +1333,28 @@ mod tests { assert_eq!(String::from("something"), Value::from("something").as_string()); } + #[test] + fn check_size() { + assert_eq!(88, std::mem::size_of::()); + assert_eq!(48, std::mem::size_of::()); + assert_eq!(24, std::mem::size_of::()); + assert_eq!(16, std::mem::size_of::()); + assert_eq!(12, std::mem::size_of::()); + assert_eq!(24, std::mem::size_of::()); + assert_eq!(24, std::mem::size_of::()); + assert_eq!(56, std::mem::size_of::()); + assert_eq!(24, std::mem::size_of::()); + assert_eq!(24, std::mem::size_of::()); + assert_eq!(24, std::mem::size_of::()); + assert_eq!(80, std::mem::size_of::()); + assert_eq!(48, std::mem::size_of::()); + assert_eq!(40, std::mem::size_of::()); + assert_eq!(8, std::mem::size_of::>()); + assert_eq!(8, std::mem::size_of::>()); + assert_eq!(8, std::mem::size_of::>()); + assert_eq!(96, std::mem::size_of::>()); + } + #[test] fn serialize_deserialize() { let val = Value::parse(