Skip to content

Fixed "/Users/runner/work/SharpSDL3/SharpSDL3/tests/SharpSDL3.Tests/N… - #17

Merged
Blizzardo1 merged 2 commits into
mainfrom
jd-scatter-feature/unit-tests
Apr 16, 2026
Merged

Fixed "/Users/runner/work/SharpSDL3/SharpSDL3/tests/SharpSDL3.Tests/N…#17
Blizzardo1 merged 2 commits into
mainfrom
jd-scatter-feature/unit-tests

Conversation

@Blizzardo1

@Blizzardo1 Blizzardo1 commented Apr 16, 2026

Copy link
Copy Markdown
Owner

…ativeSurfaceTests.cs(27,87): error CS0117: 'PixelFormat' does not contain a definition for 'Rgb888' [/Users/runner/work/SharpSDL3/SharpSDL3/tests/SharpSDL3.Tests/SharpSDL3.Tests.csproj]"; changed to Bgra8888 for testing

Summary by Sourcery

Update surface format test to use a valid pixel format constant.

Bug Fixes:

  • Replace unsupported PixelFormat.Rgb888 usage in NativeSurfaceTests with a supported format to resolve compilation failure.

Tests:

  • Adjust NativeSurfaceTests surface creation formats to cover Bgra8888 instead of the invalid Rgb888.

…ativeSurfaceTests.cs(27,87): error CS0117: 'PixelFormat' does not contain a definition for 'Rgb888' [/Users/runner/work/SharpSDL3/SharpSDL3/tests/SharpSDL3.Tests/SharpSDL3.Tests.csproj]"; changed to Bgra8888 for testing
Copilot AI review requested due to automatic review settings April 16, 2026 17:45
@sourcery-ai

sourcery-ai Bot commented Apr 16, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates a failing surface format unit test to use a valid pixel format enum value supported by the current SDL/SharpSDL3 API.

File-Level Changes

Change Details Files
Update the tested pixel formats array to replace an invalid/removed enum member with a valid one so the test compiles and exercises multiple formats.
  • Replaced PixelFormat.Rgb888 with PixelFormat.Bgra8888 in the list of formats used in Surface_CreateAndDestroy_MultipleFormats
  • Ensured the test continues to iterate over multiple pixel formats when creating and destroying native surfaces
tests/SharpSDL3.Tests/NativeSurfaceTests.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The test description suggests validating multiple formats including the one that triggered CS0117; instead of silently swapping Rgb888 for Bgra8888, consider either conditionally skipping the unsupported format or updating the test name/intent to reflect that only 32‑bit BGRA/RGBA/ARGB formats are covered.
  • If the underlying goal is to ensure coverage of a non‑alpha format, this change shifts the test to three alpha-inclusive formats; consider whether a different supported format better preserves the original intent or add a brief comment explaining why Bgra8888 was chosen.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The test description suggests validating multiple formats including the one that triggered CS0117; instead of silently swapping `Rgb888` for `Bgra8888`, consider either conditionally skipping the unsupported format or updating the test name/intent to reflect that only 32‑bit BGRA/RGBA/ARGB formats are covered.
- If the underlying goal is to ensure coverage of a non‑alpha format, this change shifts the test to three alpha-inclusive formats; consider whether a different supported format better preserves the original intent or add a brief comment explaining why `Bgra8888` was chosen.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the surface format coverage in NativeSurfaceTests to fix a build error caused by referencing a non-existent PixelFormat.Rgb888 enum value.

Changes:

  • Replaces PixelFormat.Rgb888 with PixelFormat.Bgra8888 in Surface_CreateAndDestroy_MultipleFormats().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/SharpSDL3.Tests/NativeSurfaceTests.cs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Adonis Deliannis <blizzardo1@blizzeta.net>
Copilot AI review requested due to automatic review settings April 16, 2026 17:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
if (!RequireSdl()) return;
var formats = new[] { PixelFormat.Rgba8888, PixelFormat.Argb8888, PixelFormat.Rgb888 };
var formats = new[] { PixelFormat.Rgba8888, PixelFormat.Argb8888, PixelFormat.Xrgb8888 };

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description/Sourcery summary mentions switching the test to PixelFormat.Bgra8888, but the code now uses PixelFormat.Xrgb8888. Please update the PR description to match the actual change, or switch the test to the intended format. (If you were aiming for the old “Rgb888” 24-bit equivalent, this binding already defines PixelFormat.Rgb24 in SDL3/Enums/PixelFormat.cs.)

Copilot uses AI. Check for mistakes.
@Blizzardo1
Blizzardo1 merged commit 1ec232f into main Apr 16, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants