From 0972c42747d36dbcd98c5b79156f434c0abe55c4 Mon Sep 17 00:00:00 2001 From: Julian Schmid Date: Sun, 11 Feb 2024 01:10:05 +0100 Subject: [PATCH] Exclude slice length tests with non 32 bit system compatibility --- etherparse/src/transport/icmpv6_header.rs | 4 ++-- etherparse/src/transport/tcp_slice.rs | 2 +- etherparse/src/transport/udp_header.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/etherparse/src/transport/icmpv6_header.rs b/etherparse/src/transport/icmpv6_header.rs index f5d33468..7eaef401 100644 --- a/etherparse/src/transport/icmpv6_header.rs +++ b/etherparse/src/transport/icmpv6_header.rs @@ -214,7 +214,7 @@ mod test { } proptest! { - #[cfg(not(target_pointer_width = "32"))] + #[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))] #[test] fn with_checksum( ip_header in ipv6_any(), @@ -391,7 +391,7 @@ mod test { proptest! { #[test] - #[cfg(not(target_pointer_width = "32"))] + #[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))] fn update_checksum( ip_header in ipv6_any(), icmp_type in icmpv6_type_any(), diff --git a/etherparse/src/transport/tcp_slice.rs b/etherparse/src/transport/tcp_slice.rs index 0280315f..1d476aec 100644 --- a/etherparse/src/transport/tcp_slice.rs +++ b/etherparse/src/transport/tcp_slice.rs @@ -380,7 +380,7 @@ impl<'a> TcpSlice<'a> { destination: [u8; 16], ) -> Result> { // check that the total length fits into the field - #[cfg(not(target_pointer_width = "32"))] + #[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))] if (core::u32::MAX as usize) < self.slice.len() { return Err(ValueTooBigError { actual: self.slice.len(), diff --git a/etherparse/src/transport/udp_header.rs b/etherparse/src/transport/udp_header.rs index 5f7db2dd..4e092716 100644 --- a/etherparse/src/transport/udp_header.rs +++ b/etherparse/src/transport/udp_header.rs @@ -718,6 +718,7 @@ mod test { proptest! { #[test] + #[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))] fn calc_checksum_ipv6( source_port in any::(), destination_port in any::(), @@ -821,6 +822,7 @@ mod test { proptest! { #[test] + #[cfg(not(any(target_pointer_width = "16", target_pointer_width = "32")))] fn calc_checksum_ipv6_raw( source_port in any::(), destination_port in any::(),