Skip to content

[FIX] Fixed Unit Test Rust based on the new changes on Rust 1.86.0 #1694

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

steel-bucket
Copy link

@steel-bucket steel-bucket commented Apr 25, 2025

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

While working on the share module, 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_cb in src/rust/src/lib.rs
  • test_process_cc_data in src/rust/src/decoder.rs
  • test_process_current_packet in src/rust/src/decoder.rs

The errors were fixed by checking for null pointers and reverting to a fallback value when true. I have used Box::leak in decoder.rs for 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 ccextractor
  • cd src/rust
  • rustup update
  • rustup run 1.86.0 cargo test

@canihavesomecoffee
Copy link
Member

@steel-bucket Can you rebase to current master so we can get the sample platform tests to run as well? :)

@steel-bucket
Copy link
Author

@canihavesomecoffee I have rebased to master

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 5b327c7...:

Report Name Tests Passed
Broken 12/13
CEA-708 6/14
DVB 7/7
DVD 3/3
DVR-MS 2/2
General 12/27
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 83/86
Teletext 21/21
WTV 13/13
XDS 18/34

All tests passing on the master branch were passed completely.

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:


Check the result page for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants