From 7fc5dea4d690ca6bfb498757eb3657bfd8415474 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 28 Feb 2019 03:47:04 +0100 Subject: [PATCH] jingle_ice_udp, jingle_rtp: Add a size test. --- src/jingle_ice_udp.rs | 16 ++++++++++++++++ src/jingle_rtp.rs | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/jingle_ice_udp.rs b/src/jingle_ice_udp.rs index 8cb47da8..40a07a62 100644 --- a/src/jingle_ice_udp.rs +++ b/src/jingle_ice_udp.rs @@ -90,6 +90,22 @@ mod tests { use minidom::Element; use try_from::TryFrom; + #[cfg(target_pointer_width = "32")] + #[test] + fn test_size() { + assert_size!(Transport, 36); + assert_size!(Type, 1); + assert_size!(Candidate, 72); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_size() { + assert_size!(Transport, 72); + assert_size!(Type, 1); + assert_size!(Candidate, 104); + } + #[test] fn test_simple() { let elem: Element = " diff --git a/src/jingle_rtp.rs b/src/jingle_rtp.rs index 95194edc..366cfeec 100644 --- a/src/jingle_rtp.rs +++ b/src/jingle_rtp.rs @@ -78,6 +78,24 @@ mod tests { use minidom::Element; use try_from::TryFrom; + #[cfg(target_pointer_width = "32")] + #[test] + fn test_size() { + assert_size!(Description, 36); + assert_size!(Channels, 1); + assert_size!(PayloadType, 52); + assert_size!(Parameter, 24); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_size() { + assert_size!(Description, 72); + assert_size!(Channels, 1); + assert_size!(PayloadType, 80); + assert_size!(Parameter, 48); + } + #[test] fn test_simple() { let elem: Element = "