public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Schorm <mschorm@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/perl-SDL] rawhide: Skip 't/core_palette.t' palette tests when palette is unavailable
Date: Tue, 14 Jul 2026 19:07:13 GMT	[thread overview]
Message-ID: <178405603368.1.6641489047257558361.rpms-perl-SDL-218ca4233ca3@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/perl-SDL
            Branch : rawhide
            Commit : 218ca4233ca3f687603bbe54f9a602fba116bfa0
            Author : Michal Schorm <mschorm@redhat.com>
            Date   : 2026-07-14T15:19:07+02:00
            Stats  : +54/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/perl-SDL/c/218ca4233ca3f687603bbe54f9a602fba116bfa0?branch=rawhide

            Log:
            Skip 't/core_palette.t' palette tests when palette is unavailable

The 'sdl12-compat' dummy video driver does not properly switch from
a 32-bit to an 8-bit palettized surface. After 'set_video_mode()' is
called with 32 bpp, a subsequent call requesting 8 bpp returns a
32-bit surface without a palette. The test then crashes calling
'ncolors()' on an undefined palette reference.

Add a skip condition for palette-dependent tests when the palette is
not available. Also fix the pre-existing skip count mismatch (was 4,
should be 6).

Resolves: rhbz#2464853

Co-Authored-By: Claude AI <noreply@anthropic.com>

---
diff --git a/SDL-2.548-Skip-palette-tests-when-8-bit-mode-lacks-palette.patch b/SDL-2.548-Skip-palette-tests-when-8-bit-mode-lacks-palette.patch
new file mode 100644
index 0000000..d06fa41
--- /dev/null
+++ b/SDL-2.548-Skip-palette-tests-when-8-bit-mode-lacks-palette.patch
@@ -0,0 +1,46 @@
+Skip palette tests in 't/core_palette.t' when palette is unavailable.
+
+The 'sdl12-compat' dummy video driver does not properly switch from
+a 32-bit to an 8-bit palettized surface. After 'set_video_mode()' is
+called with 32 bits per pixel, a subsequent call requesting 8 bits
+per pixel returns a 32-bit surface without a palette instead of an
+8-bit palettized one.
+
+Add a secondary skip condition inside the SKIP block to handle the
+case where the display is opened but the palette is not available.
+
+Also fix the first skip count from 4 to 6 to match the actual number
+of remaining tests in the block.
+---
+ t/core_palette.t | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/t/core_palette.t b/t/core_palette.t
+index abcdef1..1234567 100644
+--- a/t/core_palette.t
++++ b/t/core_palette.t
+@@ -37,9 +37,20 @@ my $disp = SDL::Video::set_video_mode( 640, 480, 8, SDL_SWSURFACE );
+ SKIP:
+ {
+
+-	skip( 'Cannot open display: ' . SDL::get_error(), 4 ) unless ($disp);
++	skip( 'Cannot open display: ' . SDL::get_error(), 6 ) unless ($disp);
+ 	isa_ok( $disp->format, 'SDL::PixelFormat', 'Are we a SDL::PixelFormat?' );
+
++	# The sdl12-compat dummy video driver may not support switching from
++	# a higher bit depth to an 8-bit palettized surface. When set_video_mode()
++	# was already called with 32 bits per pixel above, a subsequent call
++	# requesting 8 bpp can return a 32-bit surface without a palette.
++	skip(
++		'Palette is not available in 8-bit mode'
++			. ' (sdl12-compat may not support switching'
++			. ' from a higher bit depth)',
++		5
++	) unless ( defined $disp->format->palette );
++
+ 	isa_ok(
+ 		$disp->format->palette, 'SDL::Palette',
+ 		'Palette is SDL::Palette when BitPerPixels is 8 '
+--
+2.51.0
+

diff --git a/perl-SDL.spec b/perl-SDL.spec
index 9f0eb56..9989500 100644
--- a/perl-SDL.spec
+++ b/perl-SDL.spec
@@ -1,6 +1,6 @@
 Name:           perl-SDL
 Version:        2.548
-Release:        33%{?dist}
+Release:        34%{?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
@@ -68,6 +68,10 @@ Patch6:         SDL-2.548-Adapt-to-SDL-3.2.24.patch
 # Make the tests read-only, in upstream after 2.548,
 # <https://github.com/PerlGameDev/SDL/pull/312>
 Patch7:         SDL-2.548-Read-only-t-core_rwops.t.patch
+# Skip palette tests in t/core_palette.t when palette is unavailable.
+# The sdl12-compat dummy video driver does not support switching from
+# 32-bit to 8-bit palettized surfaces, bug #2464853.
+Patch8:         SDL-2.548-Skip-palette-tests-when-8-bit-mode-lacks-palette.patch
 BuildRequires:  coreutils
 BuildRequires:  findutils
 BuildRequires:  libGLU-devel
@@ -231,6 +235,9 @@ chmod +x %{buildroot}%{_libexecdir}/%{name}/test
 %{_libexecdir}/%{name}
 
 %changelog
+* Tue Jul 14 2026 Michal Schorm <mschorm@redhat.com> - 2.548-34
+- Skip 't/core_palette.t' palette tests when 'sdl12-compat' does not provide a palette (rhbz#2464853)
+
 * 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'
 

                 reply	other threads:[~2026-07-14 19:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178405603368.1.6641489047257558361.rpms-perl-SDL-218ca4233ca3@fedoraproject.org \
    --to=mschorm@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox