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

Broken test(s) due to version checking #270

Open
ThanatosGit opened this issue Jan 23, 2025 · 0 comments
Open

Broken test(s) due to version checking #270

ThanatosGit opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ThanatosGit
Copy link
Contributor

I don't really understand the changes done here: #232

It doesn't look like something is wrong on my side. The tests are broken. test_pkg is skipped for dread and sr because it doesn't return any files for dread_data.all_files_ending_with(".pkg") (or the sr equivalent). (Didn't looked at any other tests)

In the sr_resource_names.json some files have no version and some have a version: [] What is the reason for that?
https://github.com/randovania/mercury-engine-data-structures/blob/main/src/mercury_engine_data_structures/sr_resource_names.json

This part

for a in data.values():
vers = a.get("versions")
if vers is not None:
a["versions"] = sum([MSR_VERSIONS[v].bitmask for v in vers])
else:
a["versions"] = ALL_VERSIONS_BITMASK
is setting versions = -1 if there is no versions entry in the json but to versions = 0 if there is an empty array. As all .pkg have an empty array, they end up with versions = 0.
return {k: v["crc"] for k, v in all_name_to_asset_id_and_version().items() if v["versions"] & bitmask != 0}

if v["versions"] & bitmask != 0 => 0 & -1 != 0 is false for all pkgs (or in general for all files with an empty versions array in the .json)

@ThanatosGit ThanatosGit added the bug Something isn't working label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants