public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-imgref] epel10.2: Skip two tests on 32-bit arches that fail due to integer overflow
@ 2026-08-27 15:35 Fabio Valentini
  0 siblings, 0 replies; only message in thread
From: Fabio Valentini @ 2026-08-27 15:35 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rust-imgref
Branch : epel10.2
Commit : 614a79029c7f5f014526659a078a4be9126649ff
Author : Fabio Valentini <decathorpe@gmail.com>
Date   : 2026-08-27T16:39:09+02:00
Stats  : +40/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rust-imgref/c/614a79029c7f5f014526659a078a4be9126649ff?branch=epel10.2

Log:
Skip two tests on 32-bit arches that fail due to integer overflow

---
diff --git a/34.patch b/34.patch
new file mode 100644
index 0000000..205f00d
--- /dev/null
+++ b/34.patch
@@ -0,0 +1,39 @@
+From 230d78bca6adbb46fe4d00fa52f18547dbd71365 Mon Sep 17 00:00:00 2001
+From: Fabio Valentini <decathorpe@gmail.com>
+Date: Thu, 27 Aug 2026 16:32:09 +0200
+Subject: [PATCH] tests: skip two tests on 32-bit arches that fail due to
+ integer overflow
+
+The value `1usize << 32` overflows on architectures that are not 64-bit.
+This makes two tests either fail for the wrong reason (integer overflow
+in "debug" mode) or pass unexpectedly (wrapping math in "release" mode
+that does not cause the expected error to happen).
+---
+ src/lib.rs | 1 +
+ src/ops.rs | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/lib.rs b/src/lib.rs
+index 4d0f2af..fadbf73 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -922,6 +922,7 @@ mod tests {
+         let _ = img.sub_image_mut(0,0,1,0);
+     }
+ 
++    #[cfg(target_pointer_width = "64")]
+     #[test]
+     #[should_panic(expected = "Invalid ImgRef params")]
+     fn oversized_dimensions() {
+diff --git a/src/ops.rs b/src/ops.rs
+index cc0708d..55f29a3 100644
+--- a/src/ops.rs
++++ b/src/ops.rs
+@@ -71,6 +71,7 @@ fn index() {
+     assert_eq!(5, img.sub_image_mut(1,1,1,1)[(0usize,0usize)]);
+ }
+ 
++#[cfg(target_pointer_width = "64")]
+ #[test]
+ #[should_panic]
+ fn index_u32_with_huge_stride_does_not_wrap() {

diff --git a/rust-imgref.spec b/rust-imgref.spec
index 00642da..c7bf966 100644
--- a/rust-imgref.spec
+++ b/rust-imgref.spec
@@ -15,6 +15,7 @@ Source:         %{crates_source}
 # Manually created patch for downstream crate metadata changes
 # * remove CC0-1.0 from license metadata (not acceptable for code in Fedora)
 Patch:          imgref-fix-metadata.diff
+Patch:          https://github.com/kornelski/imgref/pull/34.patch
 
 BuildRequires:  cargo-rpm-macros >= 24
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-27 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 15:35 [rpms/rust-imgref] epel10.2: Skip two tests on 32-bit arches that fail due to integer overflow Fabio Valentini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox