Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move battle tests off the heap #3413

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

mrgriffin
Copy link
Collaborator

@mrgriffin mrgriffin commented Oct 13, 2023

Pawkkie found a situation where adding just a small amount of data to AiLogicData caused the tests to blow up. #3398 is a similar story where adding data to BattleTestRunnerState caused tests to blow up.

This PR:

  1. Makes a test fail on the spot of Alloc returns NULL.
  2. Makes gBattleTestRunnerState alias sMapLayoutData, a 20kB buffer that goes unused in battle tests.

It seems unlikely that anybody would write battle code which relies on, e.g. MapGrid_GetMetatileAt, but if they do it will no longer work. Of course that would probably be broken in the tests anyway because they don't load a map, but the output will be much more confusing now.

It's possible that in the future we'll want to write tests that check features work gracefully when out of heap, in which case we'll need to revisit my Alloc change so that you can opt-out of the automatic failure.

Reverts #3398 "Fix Broken Move Anims in Tests" which moved the AI logs
to statically-allocated EWRAM_DATA instead of being part of
gBattleTestRunnerState.
@DizzyEggg DizzyEggg merged commit cbdba65 into rh-hideout:upcoming Oct 13, 2023
1 check 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