From 91736ec0ed0011b4f9cb4343771a9f376ba3c8d5 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 20 Jun 2023 14:08:58 +0200 Subject: [PATCH] xmpp-parsers: Fix size tests on 64-bit --- parsers/src/bind.rs | 2 +- parsers/src/bookmarks.rs | 2 +- parsers/src/carbons.rs | 4 ++-- parsers/src/delay.rs | 2 +- parsers/src/disco.rs | 5 +---- parsers/src/forwarding.rs | 2 +- parsers/src/iq.rs | 4 ++-- parsers/src/jid_prep.rs | 5 +---- parsers/src/jingle.rs | 2 +- parsers/src/jingle_s5b.rs | 5 +---- parsers/src/mam.rs | 2 +- parsers/src/message.rs | 2 +- parsers/src/presence.rs | 2 +- parsers/src/roster.rs | 2 +- parsers/src/stanza_error.rs | 2 +- parsers/src/stanza_id.rs | 5 +---- parsers/src/stream.rs | 2 +- parsers/src/websocket.rs | 2 +- 18 files changed, 20 insertions(+), 32 deletions(-) diff --git a/parsers/src/bind.rs b/parsers/src/bind.rs index f4f2bdf..982cbca 100644 --- a/parsers/src/bind.rs +++ b/parsers/src/bind.rs @@ -150,7 +150,7 @@ mod tests { #[test] fn test_size() { assert_size!(BindQuery, 24); - assert_size!(BindResponse, 72); + assert_size!(BindResponse, 32); } #[test] diff --git a/parsers/src/bookmarks.rs b/parsers/src/bookmarks.rs index 182c696..cbaea94 100644 --- a/parsers/src/bookmarks.rs +++ b/parsers/src/bookmarks.rs @@ -84,7 +84,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(Conference, 128); + assert_size!(Conference, 112); assert_size!(Url, 48); assert_size!(Storage, 48); } diff --git a/parsers/src/carbons.rs b/parsers/src/carbons.rs index 5ebbd52..47b08da 100644 --- a/parsers/src/carbons.rs +++ b/parsers/src/carbons.rs @@ -82,8 +82,8 @@ mod tests { assert_size!(Enable, 0); assert_size!(Disable, 0); assert_size!(Private, 0); - assert_size!(Received, 408); - assert_size!(Sent, 408); + assert_size!(Received, 288); + assert_size!(Sent, 288); } #[test] diff --git a/parsers/src/delay.rs b/parsers/src/delay.rs index cf0012d..a0c5225 100644 --- a/parsers/src/delay.rs +++ b/parsers/src/delay.rs @@ -47,7 +47,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(Delay, 120); + assert_size!(Delay, 80); } #[test] diff --git a/parsers/src/disco.rs b/parsers/src/disco.rs index 6625141..5e4e071 100644 --- a/parsers/src/disco.rs +++ b/parsers/src/disco.rs @@ -254,10 +254,7 @@ mod tests { assert_size!(DiscoInfoQuery, 24); assert_size!(DiscoInfoResult, 96); - #[cfg(rustc_nightly)] - assert_size!(Item, 120); - #[cfg(not(rustc_nightly))] - assert_size!(Item, 128); + assert_size!(Item, 88); assert_size!(DiscoItemsQuery, 24); assert_size!(DiscoItemsResult, 48); } diff --git a/parsers/src/forwarding.rs b/parsers/src/forwarding.rs index c59e9d1..4590058 100644 --- a/parsers/src/forwarding.rs +++ b/parsers/src/forwarding.rs @@ -39,7 +39,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(Forwarded, 408); + assert_size!(Forwarded, 288); } #[test] diff --git a/parsers/src/iq.rs b/parsers/src/iq.rs index 74cf019..5239b39 100644 --- a/parsers/src/iq.rs +++ b/parsers/src/iq.rs @@ -240,8 +240,8 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(IqType, 232); - assert_size!(Iq, 416); + assert_size!(IqType, 192); + assert_size!(Iq, 296); } #[test] diff --git a/parsers/src/jid_prep.rs b/parsers/src/jid_prep.rs index d37f507..69c767e 100644 --- a/parsers/src/jid_prep.rs +++ b/parsers/src/jid_prep.rs @@ -55,10 +55,7 @@ mod tests { #[test] fn test_size() { assert_size!(JidPrepQuery, 24); - #[cfg(rustc_nightly)] - assert_size!(JidPrepResponse, 72); - #[cfg(not(rustc_nightly))] - assert_size!(JidPrepResponse, 80); + assert_size!(JidPrepResponse, 40); } #[test] diff --git a/parsers/src/jingle.rs b/parsers/src/jingle.rs index c1a0f88..0784f3c 100644 --- a/parsers/src/jingle.rs +++ b/parsers/src/jingle.rs @@ -712,7 +712,7 @@ mod tests { assert_size!(Reason, 1); assert_size!(ReasonElement, 32); assert_size!(SessionId, 24); - assert_size!(Jingle, 304); + assert_size!(Jingle, 224); } #[test] diff --git a/parsers/src/jingle_s5b.rs b/parsers/src/jingle_s5b.rs index bbc845b..1e1a8e4 100644 --- a/parsers/src/jingle_s5b.rs +++ b/parsers/src/jingle_s5b.rs @@ -297,10 +297,7 @@ mod tests { assert_size!(Mode, 1); assert_size!(CandidateId, 24); assert_size!(StreamId, 24); - #[cfg(rustc_nightly)] - assert_size!(Candidate, 128); - #[cfg(not(rustc_nightly))] - assert_size!(Candidate, 136); + assert_size!(Candidate, 96); assert_size!(TransportPayload, 32); assert_size!(Transport, 88); } diff --git a/parsers/src/mam.rs b/parsers/src/mam.rs index e36f215..a8a0551 100644 --- a/parsers/src/mam.rs +++ b/parsers/src/mam.rs @@ -109,7 +109,7 @@ mod tests { fn test_size() { assert_size!(QueryId, 24); assert_size!(Query, 232); - assert_size!(Result_, 456); + assert_size!(Result_, 336); assert_size!(Complete, 1); assert_size!(Fin, 88); } diff --git a/parsers/src/message.rs b/parsers/src/message.rs index a8f9cac..1c86094 100644 --- a/parsers/src/message.rs +++ b/parsers/src/message.rs @@ -318,7 +318,7 @@ mod tests { assert_size!(Body, 24); assert_size!(Subject, 24); assert_size!(Thread, 24); - assert_size!(Message, 288); + assert_size!(Message, 208); } #[test] diff --git a/parsers/src/presence.rs b/parsers/src/presence.rs index bb8ee87..5bc3cc7 100644 --- a/parsers/src/presence.rs +++ b/parsers/src/presence.rs @@ -393,7 +393,7 @@ mod tests { fn test_size() { assert_size!(Show, 1); assert_size!(Type, 1); - assert_size!(Presence, 240); + assert_size!(Presence, 160); } #[test] diff --git a/parsers/src/roster.rs b/parsers/src/roster.rs index c6e0266..445a8bf 100644 --- a/parsers/src/roster.rs +++ b/parsers/src/roster.rs @@ -112,7 +112,7 @@ mod tests { assert_size!(Group, 24); assert_size!(Subscription, 1); assert_size!(Ask, 1); - assert_size!(Item, 104); + assert_size!(Item, 88); assert_size!(Roster, 48); } diff --git a/parsers/src/stanza_error.rs b/parsers/src/stanza_error.rs index b4d81ea..03dd103 100644 --- a/parsers/src/stanza_error.rs +++ b/parsers/src/stanza_error.rs @@ -326,7 +326,7 @@ mod tests { fn test_size() { assert_size!(ErrorType, 1); assert_size!(DefinedCondition, 1); - assert_size!(StanzaError, 232); + assert_size!(StanzaError, 192); } #[test] diff --git a/parsers/src/stanza_id.rs b/parsers/src/stanza_id.rs index eeb5d17..fadd5e8 100644 --- a/parsers/src/stanza_id.rs +++ b/parsers/src/stanza_id.rs @@ -52,10 +52,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - #[cfg(rustc_nightly)] - assert_size!(StanzaId, 96); - #[cfg(not(rustc_nightly))] - assert_size!(StanzaId, 104); + assert_size!(StanzaId, 64); assert_size!(OriginId, 24); } diff --git a/parsers/src/stream.rs b/parsers/src/stream.rs index 48eae77..21dcab5 100644 --- a/parsers/src/stream.rs +++ b/parsers/src/stream.rs @@ -85,7 +85,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(Stream, 168); + assert_size!(Stream, 136); } #[test] diff --git a/parsers/src/websocket.rs b/parsers/src/websocket.rs index fbc1fb2..ecd065d 100644 --- a/parsers/src/websocket.rs +++ b/parsers/src/websocket.rs @@ -84,7 +84,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(Open, 168); + assert_size!(Open, 136); } #[test]