Add 5 test files for game module targeting dev#450
Closed
github-actions[bot] wants to merge 1 commit intodevfrom
Closed
Add 5 test files for game module targeting dev#450github-actions[bot] wants to merge 1 commit intodevfrom
github-actions[bot] wants to merge 1 commit intodevfrom
Conversation
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.
Summary
Added 5 new test files with comprehensive unit tests for the
gamemodule targetingdev:Tests Added
src/game/input_mapper_tests.zig(32 tests)InputBinding.getName()for all key types and mouse buttonsInputBinding.eql()bidirectional key/key_alt equalityActionBinding.init()andinitWithAlt()DEFAULT_BINDINGSverification for all GameAction valuesInputMapper.setBinding(),setAlternateBinding(),resetToDefaults(),resetActionToDefault()InputMapper.interface()vtable creationsrc/game/settings/data_tests.zig(18 tests)Settings.getShadowResolution()for all quality levels and invalid valuesSettings.getResolutionIndex()andsetResolutionByIndex()for all resolutionsSHADOW_QUALITIESarray validationRESOLUTIONSarray ordering and common resolutionsShadowDebugChannelenum valuesresolveShadowDebugChannel()priority ordering (seam_diagnostics > caster_coverage > cascade_index > shadow_factor > off)src/game/settings/presets_tests.zig(5 tests)getPresetName()for valid and out-of-bounds indicesgetIndex()returns len (Custom) for non-matching settingsapply()ignores out-of-bounds indicesapply()correctly sets all fields from presetsrc/game/settings/apply_tests.zig(3 tests)applyToRenderSettings()calls all 8 relevant setter methodssrc/game/settings/persistence_tests.zig(9 tests)setTexturePack()early return when setting same valuesetTexturePack()changes value when differentsetTexturePack()multiple changes with proper memory managementsetEnvironmentMap()same/different value handlingdeinit()handles both static "default" and allocated stringstexture_packandenvironment_mapare independentVerification
nix develop --command zig fmt src/passesnix develop --command zig build testpasses (all 696 tests)Triggered by scheduled workflow
opencode session | github run