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

Test every ArchiveClass & DiscClass #194

Open
14 of 26 tasks
snake-biscuits opened this issue Aug 28, 2024 · 5 comments
Open
14 of 26 tasks

Test every ArchiveClass & DiscClass #194

snake-biscuits opened this issue Aug 28, 2024 · 5 comments
Assignees
Labels
archives related to archives module MegaTest test every .bsp you can find 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 Aug 28, 2024

As stated in #191 we should be testing all ArchiveClasses as they're being actively worked on

ArchiveClasses

  • bluepoint.Bpk
  • cdrom.Iso
  • gearbox.Nightfire007
  • id_software.Pak
  • id_software.Pk3
  • infinity_ward.FastFile
  • infinity_ward.Iwd
  • ion_storm.Dat
  • ion_storm.Pak
  • nexon.Hfs
  • nexon.PakFile #198
  • nexon.Pkg
  • pi_studios.Bpk
  • pkware.Zip
  • respawn.RPak
  • respawn.Vpk
  • ritual.Sin
  • sega.GDRom
  • troika.Vpk #206
  • utoplanet.Apk
  • valve.Vpk

DiscClass

  • alcohol.Mds
  • golden_hawk.Cue
  • mame.Chd
  • padus.Cdi
  • sega.Gdi

Related

@snake-biscuits snake-biscuits added need test We need to write a test for regression testing MegaTest test every .bsp you can find archives related to archives module labels Aug 28, 2024
@snake-biscuits snake-biscuits self-assigned this Aug 28, 2024
@snake-biscuits
Copy link
Owner Author

snake-biscuits commented Aug 28, 2024

atm we're only testing __init__s (specifically .from_file())
some of these tests include .namelist() & .read() checks

.namelist() can't work without some __init__
.read() can't work without .namelist()
loading a file 3 times to test 2 methods is a bit much
but it'd still be best to break these tests up

loading the maps before tests is less than ideal

@snake-biscuits
Copy link
Owner Author

excluding nexon.PakFile because it only appears in CS:O2 .bsps

We need some specific SpecialLumpClass tests for this
But afaik no public source tool for making these PakFiles exists

organnerx has some people making tools, idk how public they are

Which means the only real-world examples of the format we're going to find are inside maps
Tho we can test .from_bytes() like we do for pkware.Zip

For testing the real-world cases:

@snake-biscuits
Copy link
Owner Author

nexon.PakFile.as_bytes() is really important to test, since it's required for NexonBsp.save_as()

@snake-biscuits
Copy link
Owner Author

ArchiveClasses don't have to have .as_bytes() methods
Except for pkware.Zip & nexon.PakFile, since they both get used as SpecialLumpClasses

But we should keep links etc. for external tools used with each format in docs/
Something to add to the DB

@snake-biscuits
Copy link
Owner Author

Testing nexon.PakFile via CS:O2 .bsps is failing in a really wierd way

>>> import bsp_tool
>>> bsp = bsp_tool.load_bsp("E:/Mod/CSO2/maps/gb_varena.bsp")  # map with least files in pakfile (8)
>>> bsp.headers["PAKFILE"]
<LumpHeader (offset: 587596, length: 134135, version: 0, compressed: 0, fourCC: 0)>
>>> len(bsp.PAKFILE.as_bytes())
134146  # 11 bytes over???

Really need to be testing this w/ a handmade deflate for .from_bytes()
And as a SpecialLumpClass, though that requires either local test maps:

Or a specific test that targets MegaTest maps:

@snake-biscuits snake-biscuits mentioned this issue Aug 30, 2024
2 tasks
@snake-biscuits snake-biscuits changed the title Test every ArchiveClass Test every ArchiveClass & DiscClass Dec 5, 2024
@snake-biscuits snake-biscuits added the slow burn lots of work & will take a long time label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archives related to archives module MegaTest test every .bsp you can find need test We need to write a test for regression testing slow burn lots of work & will take a long time
Projects
Status: Todo: Code
Development

No branches or pull requests

1 participant