public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-SDL] rawhide: Update 't/core_surface.t' to accept both 4-bit and 8-bit BitsPerPixel
@ 2026-07-14 19:07 Michal Schorm
0 siblings, 0 replies; only message in thread
From: Michal Schorm @ 2026-07-14 19:07 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/perl-SDL
Branch : rawhide
Commit : 6d5655b5d1cc899bce4aa6369964e208f9b3727f
Author : Michal Schorm <mschorm@redhat.com>
Date : 2026-07-14T15:18:34+02:00
Stats : +40/-33 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/perl-SDL/c/6d5655b5d1cc899bce4aa6369964e208f9b3727f?branch=rawhide
Log:
Update 't/core_surface.t' to accept both 4-bit and 8-bit BitsPerPixel
'test/data/icon.bmp' is a 4-bit paletted BMP. The SDL compat stack
('sdl12-compat' / 'sdl2-compat' / SDL3) may promote it to 8-bit
internally, so the test now accepts either value.
Replaces the previous Patch5 which hard-coded BitsPerPixel to 4.
Co-Authored-By: Claude AI <noreply@anthropic.com>
---
diff --git a/SDL-2.548-core_surface.t-Accept-4-or-8-BitsPerPixel-for-icon.bmp.patch b/SDL-2.548-core_surface.t-Accept-4-or-8-BitsPerPixel-for-icon.bmp.patch
new file mode 100644
index 0000000..a148e87
--- /dev/null
+++ b/SDL-2.548-core_surface.t-Accept-4-or-8-BitsPerPixel-for-icon.bmp.patch
@@ -0,0 +1,32 @@
+Accept both 4 and 8 BitsPerPixel for 'test/data/icon.bmp' in
+'t/core_surface.t'.
+
+'test/data/icon.bmp' is a 4-bit paletted BMP file. Depending on the
+SDL version and compatibility layer ('sdl12-compat' on top of
+'sdl2-compat' on top of SDL3), 'SDL_LoadBMP' may report BitsPerPixel
+as either 4 (native) or 8 (promoted). Both values are valid.
+
+Replaces the previous Patch5 which hard-coded BitsPerPixel to 4.
+---
+ t/core_surface.t | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/t/core_surface.t b/t/core_surface.t
+index 897536b6..12345678 100644
+--- a/t/core_surface.t
++++ b/t/core_surface.t
+@@ -51,7 +51,10 @@ is( $image->h, 32, 'image has height' );
+
+ my $pixel_format = $image->format;
+ isa_ok( $pixel_format, 'SDL::PixelFormat' );
+-is( $pixel_format->BitsPerPixel, 8, ' BitsPerPixel' );
++# test/data/icon.bmp is a 4-bit BMP, but SDL may promote it to 8-bit
++# internally depending on the SDL version and compatibility layer.
++ok( $pixel_format->BitsPerPixel == 4 || $pixel_format->BitsPerPixel == 8,
++ ' BitsPerPixel is 4 or 8 (got ' . $pixel_format->BitsPerPixel . ')' );
+ is( $pixel_format->BytesPerPixel, 1, ' BytesPerPixel' );
+ is( $pixel_format->Rloss, 8, ' Rloss' );
+ is( $pixel_format->Gloss, 8, ' Gloss' );
+--
+2.51.0
+
diff --git a/SDL-2.548-core_surface.t-test-data-icon.bmp-is-really-4-bits-p.patch b/SDL-2.548-core_surface.t-test-data-icon.bmp-is-really-4-bits-p.patch
deleted file mode 100644
index 5c39f38..0000000
--- a/SDL-2.548-core_surface.t-test-data-icon.bmp-is-really-4-bits-p.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 39c0ab8fc0b2277ece593b9b50f79f6e1ccd1fc5 Mon Sep 17 00:00:00 2001
-From: Daniel Kamil Kozar <dkk089@gmail.com>
-Date: Thu, 12 Jun 2025 21:43:54 +0200
-Subject: [PATCH] core_surface.t: test/data/icon.bmp is really 4 bits per pixel
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Petr Písař <ppisar@redhat.com>
----
- t/core_surface.t | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/t/core_surface.t b/t/core_surface.t
-index 897536b6..baa962aa 100644
---- a/t/core_surface.t
-+++ b/t/core_surface.t
-@@ -51,7 +51,7 @@ is( $image->h, 32, 'image has height' );
-
- my $pixel_format = $image->format;
- isa_ok( $pixel_format, 'SDL::PixelFormat' );
--is( $pixel_format->BitsPerPixel, 8, ' BitsPerPixel' );
-+is( $pixel_format->BitsPerPixel, 4, ' BitsPerPixel' );
- is( $pixel_format->BytesPerPixel, 1, ' BytesPerPixel' );
- is( $pixel_format->Rloss, 8, ' Rloss' );
- is( $pixel_format->Gloss, 8, ' Gloss' );
---
-2.50.1
-
diff --git a/perl-SDL.spec b/perl-SDL.spec
index 44599ea..9f0eb56 100644
--- a/perl-SDL.spec
+++ b/perl-SDL.spec
@@ -1,6 +1,6 @@
Name: perl-SDL
Version: 2.548
-Release: 32%{?dist}
+Release: 33%{?dist}
Summary: Simple DirectMedia Layer for Perl
# COPYING: GPL-2.0 text
# lib/pods/SDL.pod: GPL-1.0-or-later OR Artistic-1.0-Perl
@@ -58,9 +58,10 @@ Patch3: SDL-2.548-Fix-reference-counting-in-set_event_filter.patch
# <https://github.com/PerlGameDev/SDL/issues/294>, in upstream after 2.548,
# <https://github.com/PerlGameDev/SDL/pull/309>
Patch4: SDL-2.548-Fix-building-in-ISO-C23.patch
-# Adapt t/core_surface.t test to SDL3, incompatible with SDL2, bug #2341036,
-# proposed to upstream, <https://github.com/PerlGameDev/SDL/pull/310>
-Patch5: SDL-2.548-core_surface.t-test-data-icon.bmp-is-really-4-bits-p.patch
+# Accept both 4 and 8 BitsPerPixel for test/data/icon.bmp in
+# t/core_surface.t -- SDL may report either value depending on the
+# SDL compat stack version. Replaces a previous patch that hard-coded 4.
+Patch5: SDL-2.548-core_surface.t-Accept-4-or-8-BitsPerPixel-for-icon.bmp.patch
# Adapt t/core.t test to SDL-3.2.24, bug #2401791, in upstream after 2.548,
# <https://github.com/PerlGameDev/SDL/pull/311>
Patch6: SDL-2.548-Adapt-to-SDL-3.2.24.patch
@@ -230,6 +231,9 @@ chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%{_libexecdir}/%{name}
%changelog
+* Tue Jul 14 2026 Michal Schorm <mschorm@redhat.com> - 2.548-33
+- Update 't/core_surface.t' to accept both 4-bit and 8-bit 'BitsPerPixel' for 'test/data/icon.bmp'
+
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.548-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-14 19:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14 19:07 [rpms/perl-SDL] rawhide: Update 't/core_surface.t' to accept both 4-bit and 8-bit BitsPerPixel Michal Schorm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox