mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-20 13:03:58 +00:00
[PR #1694] [FIX] Fixed Unit Test Rust based on the new changes on Rust 1.86.0 #2411
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1694
State: closed
Merged: Yes
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
While working on the
sharemodule, I came across the problem that on the main branch, the Unit Test Rust(test_rust.yml) was failing. Reverting commits didn't help, later I found out that the problem was due to Rust being upgraded to 1.86.0.The New Changes to check for Null pointer De-referencing
This triggered a panic on 3 tests
test_do_cbinsrc/rust/src/lib.rstest_process_cc_datainsrc/rust/src/decoder.rstest_process_current_packetinsrc/rust/src/decoder.rsThe errors were fixed by checking for null pointers and reverting to a fallback value when true. I have used Box::leak in
decoder.rsfor now, it may be changed to a safer alternative later.How to replicate the errors for the main branch
git clone https://github.com/CCExtractor/ccextractor && cd ccextractorcd src/rustrustup updaterustup run 1.86.0 cargo test