Fix #10193: harden SoftNI regression tests (review follow-up) - #13244
Merged
Conversation
Contributor
Author
|
/copilot-review |
Contributor
There was a problem hiding this comment.
🟢 Ready to approve
The change is a small, test-only hardening that prevents an out-of-range crash and aligns exactly with the stated follow-up goal.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR hardens the SoftNI regression tests added for issue #10193 by ensuring the tests fail with a clear assertion message (instead of throwing IndexOutOfRangeException) if the exported output is truncated or *TIMING* is the last line.
Changes:
- Add a bounds assertion (
timingIndex + 1 < lines.Count) before indexing the timing line inSoftNiSubtest. - Add the same bounds assertion in the
SoftNiColonSubtest.
File summaries
| File | Description |
|---|---|
| tests/libse/SubtitleFormats/SoftNiSubTest.cs | Adds explicit bounds assertions before indexing the line following *TIMING*, improving test failure clarity and robustness. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Contributor
Author
|
CI note: the
|
This was referenced Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to merged PR #13241 (issue #10193, SoftNI sub export frame rate). Copilot review on #13241 noted that the regression tests index
lines[timingIndex + 1]right after asserting the TIMING header exists, without checking that a following line actually exists — if the output is truncated or TIMING is the last line, the test would throw IndexOutOfRangeException instead of failing with a clear assertion message. The comment applies at two sites (line 31 and line 51 of tests/libse/SubtitleFormats/SoftNiSubTest.cs).Fix
Added a bounds assertion before indexing in both SoftNI tests:
Assert.True(timingIndex + 1 < lines.Count, "Missing timing line after *TIMING* section");Test-only change; no production code touched.
Verification
dotnet build tests/libse/LibSETests.csproj— EXIT:0, 0 errorsdotnet test tests/libse/LibSETests.csproj --filter FullyQualifiedName~SoftNiSubTest— Passed: 4, Failed: 0Notes