Skip to content

Fix overlay lookup in LoadBobFile test - #31

Merged
Flamefire merged 2 commits into
Return-To-The-Roots:masterfrom
MichalLabuda:fix-loadbobfile-test
Oct 31, 2026
Merged

Flamefire merged 2 commits into
Return-To-The-Roots:masterfrom
MichalLabuda:fix-loadbobfile-test

Conversation

@MichalLabuda

Copy link
Copy Markdown
Contributor

BobFiles/LoadBobFile fails 2 assertions (testBob.cpp:60/63) since 22754f4: the expected value
wraps the sprite id as OverlayIdx{spriteId} and skips the getOverlayData() lookup that
getOverlay() does, so it compares against an empty archive slot.

This uses getOverlayArchiveIndex(getOverlayData(spriteId).idx), the same lookup getOverlay()
uses, which is what the test checked before via getOverlayIdx(spriteId).

CI doesn't catch it because the test needs the original S2 files (hasS2Data).

Tested with the S2 data on MSVC and gcc (74/74 test cases pass) and without it.

@MichalLabuda

Copy link
Copy Markdown
Contributor Author

I used Claude Opus 5.5 to analyze why the AppVeyor check failed, and below is the result of its analysis. Conclusion is that it's not related to the changes introduced by this PR.

Analysis Report
Both AppVeyor jobs (Debug and Release) fail while compiling libutil's own tests, before any libsiedler2 test is built:

libutil\libs\common\include\s25util\span.hpp(221,97): error C2938: 'std::enable_if_t<false,int>' : Failed to specialize alias template (compiling source file libutil\tests\main.cpp)

(same error at lines 229 and 249)

  • AppVeyor uses the Visual Studio 2019 image and clones libutil's current master (unpinned) in appveyor.yml.
  • libutil got "Modernize span.hpp" (7ac86ae) on 2026-08-11, which replaced typename std::enable_if<...::value>::type with std::enable_if_t<...> and _v variable templates. VS 2019 apparently can't handle that in the three explicit constructors whose condition combines E != dynamic_extent with such a variable template.
  • Since then, every AppVeyor build fails this way: the last build of PR 30 (build 384) and libsiedler2's master itself (build 385 on 22754f4, build 386 on 9f10c26). The last green build was 383 on 2026-08-10.
  • The GitHub Actions windows-2022 / VS 2022 job compiles the same libutil master fine (last green on master: 9f10c26). The Actions run for this PR still needs workflow approval.

Possible fixes, outside this PR: move AppVeyor to the VS 2022 image (or drop it, as GitHub Actions already covers MSVC), and/or pin libutil there. Alternatively, keep span.hpp VS 2019-compatible in libutil if VS 2019 should stay supported.

@coveralls

coveralls commented Oct 22, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.224% (+0.02%) from 83.204% — MichalLabuda:fix-loadbobfile-test into Return-To-The-Roots:master

@Flamefire

Copy link
Copy Markdown
Member

I fixed the compat issue of span.hpp and enhanced a bit of the testing machinery.
The PR looks good, I expect the tests to succeed again

@Flamefire
Flamefire merged commit 035b330 into Return-To-The-Roots:master Oct 31, 2026
16 of 17 checks passed
@MichalLabuda
MichalLabuda deleted the fix-loadbobfile-test branch October 31, 2026 11:19
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.

3 participants