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

SpecialLumpClass testing #114

Open
2 of 35 tasks
snake-biscuits opened this issue Jul 2, 2023 · 4 comments
Open
2 of 35 tasks

SpecialLumpClass testing #114

snake-biscuits opened this issue Jul 2, 2023 · 4 comments
Assignees
Labels
documentation This issue involves a lack of documentation enhancement New feature or request need test We need to write a test for regression testing slow burn lots of work & will take a long time
Milestone

Comments

@snake-biscuits
Copy link
Owner

snake-biscuits commented Jul 2, 2023

Forgot to write tests when all the SpecialLumpClasses got refactored in #68
#112 shows how big a mistake that was

.from_bytes() -> .as_bytes() -> .from_bytes shouldn't mutate
Some data loss is OK (comments in Entities etc.), but we should strive towards byte-for-byte

__init__ should also create a valid object

Some test maps & in-game checks will be needed in places (will it load? crash?)
Plenty of SpecialLumpClasses can be tested w/ tailored samples w/o a test map

SpecialLumpClasses w/ enough tests

  • id_software.quake.MipTextureLump
  • id_software.quake2.Visibility
  • id_software.quake3.Visibility
  • respawn.titanfall.EntityPartitions
  • shared.Entities
  • shared.PakFile
  • shared.TextureDataStringData
  • valve_physics.CollideLump
  • valve_physics.Displacement
  • strata.strata.PhysicsDisplacement

GameLumpClasses w/ enough tests

  • valve.source.GameLump_SPRPv4
    • nexon.vindictus69.GameLump_SPRPv6
      • nexon.vinductus.GameLump_SPRPv6
        • nexon.vindictus.GameLump_SPRPv7
    • valve.source.GameLump_SPRPv5
      • valve.source.GameLump_SPRPv6
        • valve.source.GameLump_SPRPv7
          • valve.left4dead.GameLump_SPRPv8
            • valve.left4dead2.GameLump_SPRPv9
              • valve.sdk_2013_x360.GameLump_SPRPv9_x360
            • valve.sdk_2013_x360.GameLump_SPRPv8_x360
          • valve.orange_box.GameLump_SPRPv10
            • valve.sdk_2013.GameLump_SPRPv10
              • valve.sdk_2013.GameLump_SPRPv11
                • respawn.titanfall.GameLump_SPRPv12
                  • respawn.titanfall_x360.GameLump_SPRPv12
                  • respawn.titanfall2.GameLump_SPRPv13
                • strata.strata.GameLump_SPRPv12
                  • strata.strata.GameLump_SPRPv13
                • utoplanet.merubasu.GameLump_SPRPv11
                • valve.sdk_2013_x360.GameLump_SPRPv11_x360
              • valve.sdk_2013_x360.GameLump_SPRPv10_x360
        • valve.orange_box_x360.GameLump_SPRPv6_x360
      • valve.orange_box_x360.GameLump_SPRPv5_x360
    • valve.orange_box_x360.GameLump_SPRPv4_x360
@snake-biscuits snake-biscuits added enhancement New feature or request documentation This issue involves a lack of documentation slow burn lots of work & will take a long time need test We need to write a test for regression testing labels Jul 2, 2023
@snake-biscuits snake-biscuits added this to the Refactors and Bug Fixes milestone Jul 2, 2023
@snake-biscuits snake-biscuits self-assigned this Jul 2, 2023
@snake-biscuits
Copy link
Owner Author

Currently working on id_software.quake2.Visibility as part of #112
valve_physics.Displacement / strata.strata.PhysicsDisplacement
shared.Entities needs to test all known edge cases for regression
shared.PakFile needs to confirm ZIP_DEFLATE compression etc. (strict standard)
valve_physics.CollideLump is broken, write xfail tests for now
quake.MipTextureLump needs bounds & size estimate checking (use a test map)
The rest are string-based, should be fairly simple to test

@snake-biscuits
Copy link
Owner Author

Each test should live in a class inside it's branch script's test file:

# tests/branches/id_software/test_quake.py

class TestMipTextureLump:
    ...

@snake-biscuits snake-biscuits pinned this issue Jul 17, 2023
@snake-biscuits
Copy link
Owner Author

snake-biscuits commented Jul 18, 2023

include GameLumpClasses

counts GameLumpClasses as SpecialLumpClasses, we should as well
valve.source.GameLump_sprp.as_bytes() fails to process model_names correctly:

Since we'll want samples for automated testing, this ties into:

Also related:

NOTE: shouldn't introduce any new GameLumpClasses (only StaticPropClasses), but we should be aware of it

@snake-biscuits snake-biscuits modified the milestones: v1.0.0, v0.5.0 Feb 7, 2024
@snake-biscuits
Copy link
Owner Author

Only 4 GameLump_SPRP classes define .from_bytes classmethods:

  • nexon.vindictus69.GameLump_SPRPv6
  • respawn.titanfall.GameLump_SPRPv12
  • respawn.titanfall2.GameLump_SPRPv13
  • valve.source.GameLump_SPRPv4

So we only really need to test those 4, the rest just set some common variables:

  • endianness
  • StaticPropClass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This issue involves a lack of documentation enhancement New feature or request need test We need to write a test for regression testing slow burn lots of work & will take a long time
Projects
Status: Todo: Test
Development

No branches or pull requests

1 participant