Repository navigation
Add iff_close() so IFF tables can be re-parsed in tests - #8077
Open
Goober5000 wants to merge 1 commit into
Open
Goober5000 wants to merge 1 commit into
Goober5000 wants to merge 1 commit into
Conversation
Nothing reset the IFF module's state, so a second iff_init() in the same process failed on duplicate IFF names. IffAccessibilityTest (scp-fs2open#7856) calls iff_init(), which broke any later test that also needed IFFs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nothing ever reset the IFF module's state, so calling
iff_init()a second time in the same process failed withIFF Friendly already exists. All IFF names must be unique.The game only calls
iff_init()once, so this never came up until #7856 addedIffAccessibilityTest, which calls it. Any later test in the same unittests run that also needs IFFs now fails in setup. This is what's breaking CI on #7909: all fourShipSharedModelTestcases fail inSetUp().Changes
iff_close(). It clearsIff_info,Iff_info_names,Iff_colors, and the per-IFF attack/observed-color tables that are indexed in parallel withIff_info. It also resets the traitor name and index and$Accessibility Supported:.iff_init_color()to file scope, so it can be cleared along withIff_colors. If it isn't cleared, cached color indices would point at the wrong colors after a reset.IffAccessibilityTestnow callsiff_close()inTearDown().Once this is merged, #7909's test can drop its own one-time init guard and just call
iff_init()/iff_close()around each test.🤖 Generated with Claude Code