From 96065dc26dd5687651a2b348d36526ca490f2089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sat, 23 Apr 2022 15:28:49 +0200 Subject: [PATCH] Fix size tests on architectures with 32-bit pointers --- parsers/src/jingle_ft.rs | 8 ++++---- parsers/src/rtt.rs | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/parsers/src/jingle_ft.rs b/parsers/src/jingle_ft.rs index 491028f..c4e118e 100644 --- a/parsers/src/jingle_ft.rs +++ b/parsers/src/jingle_ft.rs @@ -335,10 +335,10 @@ mod tests { #[cfg(target_pointer_width = "32")] #[test] fn test_size() { - assert_size!(Range, 40); - assert_size!(File, 128); - assert_size!(Description, 128); - assert_size!(Checksum, 144); + assert_size!(Range, 32); + assert_size!(File, 112); + assert_size!(Description, 112); + assert_size!(Checksum, 128); assert_size!(Received, 16); } diff --git a/parsers/src/rtt.rs b/parsers/src/rtt.rs index 3e57d8a..881351f 100644 --- a/parsers/src/rtt.rs +++ b/parsers/src/rtt.rs @@ -247,6 +247,18 @@ mod tests { use super::*; use std::convert::TryInto; + #[cfg(target_pointer_width = "32")] + #[test] + fn test_size() { + assert_size!(Event, 1); + assert_size!(Insert, 20); + assert_size!(Erase, 12); + assert_size!(Wait, 4); + assert_size!(Action, 24); + assert_size!(Rtt, 32); + } + + #[cfg(target_pointer_width = "64")] #[test] fn test_size() { assert_size!(Event, 1);