Skip to content

Add Unit Tests for Track and Closed Caption Property Edge Cases - #1186

Merged
ptr727 merged 2 commits into
developfrom
feature/coverage-props-tests
Nov 3, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/coverage-props-tests

Conversation

@ptr727

@ptr727 ptr727 commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Adds unit tests for track property paths that the real-tool corpus runs don't reach.

  • TrackPropsCreateTests, one case each for the MkvMerge, FfProbe, and MediaInfo Create overloads:
    • The codec fallbacks for a non-Matroska container.
    • Rejecting a track with a missing codec as Unsupported.
    • Every track flag.
    • Setting the ISO language from an IETF-only tag.
    • Defaulting missing MediaInfo ids to zero.
    • MediaInfo sub-track StreamOrder, which is either sanitized or rejected.
  • SubtitlePropsClosedCaptionsTests covers the MediaInfo closed caption sub-track paths:
    • A/53 captions flag the matching video track, and are dropped without one.
    • An unparsable caption id is dropped.
    • SCTE 128 captions and unknown muxing modes are kept as subtitle tracks, and only the unknown one warns.
    • A VobSub track without a muxing mode is marked for removal.

This is phase 6 of the coverage plan on the coverage track (#1171), group B. Against Codecov's missed lines at the phase 5 measurement, these tests cover 125 of 150 in TrackProps.cs and 69 of 71 in SubtitleProps.cs.

Some uncovered code is unreachable or unused, so it is filed as #1185 rather than tested:

  • SetLanguage's empty-lookup branches can't run, since the language lookup returns und for an unknown tag.
  • SetLanguage never returns false.
  • TrackProps.GetFlags() and MediaProps.RemoveCoverArt() have no caller.

Verification: the .NET Format chain is clean, and the unit suite passes (520 tests). The local strict review ran twice: the first pass raised 6 findings, all fixed, and the second raised none.

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 2, 2026 16:51
Cover the track property paths the corpus runs do not reach: codec
fallbacks for non-Matroska containers, missing-codec rejection, every
track flag, ISO language set from an IETF tag, MediaInfo sub-track
stream order, closed caption sub-tracks, VobSub without a muxing mode,
and cover art removal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 3, 2026 00:57
@ptr727

ptr727 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 15abe1d51733c8bd227820e53169c7393ea01fe8, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0ffc14d8-e02f-402c-8d1f-d5711413b34a
Commits

Reviewing files that changed from the base of the PR and between a382e3e and 15abe1d.

Files selected for processing: 2
  • PlexCleanerTests/SubtitlePropsClosedCaptionsTests.cs
  • PlexCleanerTests/TrackPropsCreateTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Cover track creation and closed-caption property edge cases

🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Add parser-specific track tests for codec fallbacks, flags, language, identifiers, and unsupported
 tracks.
• Cover MediaInfo caption handling, including video flags, dropped captions, warnings, and VobSub
 removal.
Diagram

graph TD
  TT["Track tests"] --> MK["MkvMerge input"] --> TP["TrackProps creation"]
  TT --> FF["FfProbe input"] --> TP
  TT --> MI["MediaInfo input"] --> TP
  CC["Caption tests"] --> MI --> SP["SubtitleProps captions"] --> VP["VideoProps flag"]
  SP --> TP
Loading
High-Level Assessment

Focused unit tests are appropriate for parser and caption branches that corpus runs do not reach. Expanding the media corpus would add fixture and tool dependencies without improving isolation; no production-code change is needed.

Files changed (2) +323 / -0

Tests (2) +323 / -0
SubtitlePropsClosedCaptionsTests.csTest MediaInfo closed-caption and VobSub outcomes +111/-0

Test MediaInfo closed-caption and VobSub outcomes

• Adds tests for matching and missing video tracks, unparsable caption IDs, and separate or unknown caption muxing modes, including warning counts. Also checks that VobSub is marked for removal only when its muxing mode is missing.

PlexCleanerTests/SubtitlePropsClosedCaptionsTests.cs

TrackPropsCreateTests.csTest track creation across three parser formats +212/-0

Test track creation across three parser formats

• Covers non-Matroska codec fallbacks and Matroska missing-codec rejection for MkvMerge, FfProbe, and MediaInfo inputs. Checks track flags, ISO language derived from an IETF tag, default MediaInfo IDs, and sanitized or rejected sub-track stream orders.

PlexCleanerTests/TrackPropsCreateTests.cs

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is limited to focused unit tests covering previously untested TrackProps and MediaInfo closed-caption edge cases without modifying production behavior.

No open issues 🎉

What changed in this PR

Adds focused unit tests for previously uncovered TrackProps creation and MediaInfo closed-caption edge cases without changing production behavior.

Changes:

  • Tests codec fallbacks, unsupported tracks, flags, language handling, missing IDs, and stream-order parsing across MkvMerge, FFprobe, and MediaInfo.
  • Tests embedded, separate, unknown, unparsable, and VobSub caption paths, including warning and removal behavior.
  • Covers phase 6 of the planned test-coverage work.
File Description
PlexCleanerTests/​TrackPropsCreateTests.cs Tests track-creation edge cases across MkvMerge, FFprobe, and MediaInfo.
PlexCleanerTests/​SubtitlePropsClosedCaptionsTests.cs Tests MediaInfo closed-caption handling and VobSub removal behavior.

Review effort: Lite

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.

2 participants