Skip to content

fix: update ELF parser tests to use existing test files#385

Closed
VolodymyrBg wants to merge 1 commit intonexus-xyz:mainfrom
VolodymyrBg:bgg
Closed

fix: update ELF parser tests to use existing test files#385
VolodymyrBg wants to merge 1 commit intonexus-xyz:mainfrom
VolodymyrBg:bgg

Conversation

@VolodymyrBg
Copy link
Contributor

Is this resolving a feature or a bug?

When I ran tests I bumped into this fail:

test elf::parser::tests::test_parse_elf_file_with_no_precompiles stdout ----
thread 'elf::parser::tests::test_parse_elf_file_with_no_precompiles' panicked at vm\src\elf\parser.rs:556:49:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

---- elf::parser::tests::test_parse_elf_file_with_precompile stdout ----
thread 'elf::parser::tests::test_parse_elf_file_with_precompile' panicked at vm\src\elf\parser.rs:523:49:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }

---- elf::parser::tests::test_parse_elf_file_with_precompiles stdout ----
thread 'elf::parser::tests::test_parse_elf_file_with_precompiles' panicked at vm\src\elf\parser.rs:538:49:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }

Describe your changes.

The tests in vm/src/elf/parser.rs were failing because they were looking
for non-existent test files. This commit updates the tests to use the
actual test files available in the project.

Tests previously failed with errors:
"Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }"

Modified test files:

  • test_parse_elf_file_with_precompile
  • test_parse_elf_file_with_precompiles
  • test_parse_elf_file_with_no_precompiles

Also fixes unused variable warnings by prefixing variables with underscore.

@github-actions
Copy link

github-actions bot commented Apr 3, 2025


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@VolodymyrBg
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@sjudson
Copy link
Contributor

sjudson commented Apr 17, 2025

Thanks for catching this, there is some ongoing internal work that should fix these tests more comprehensively, so I'm going to prioritize that approach (cc: @bhoberman).

@sjudson sjudson closed this Apr 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2025
@VolodymyrBg VolodymyrBg deleted the bgg branch May 17, 2025 14:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants