The two progress-notification strings can be swapped without failing anything #174

Closed
opened 2026-09-02 02:15:10 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-09-02 02:15:10 +00:00 (Migrated from github.com)

Two notification strings that can be swapped without failing anything

ConversionNotifications.build (app/src/main/java/org/libremediaconverter/work/ConversionNotifications.kt:33-38)
chooses between an indeterminate "preparing" text and an "N%" text.

An assertion gap: JaCoCo is green on the branch, because ProgressNotificationTest drives it
through ConversionWorker — but that test reads only the notification id and
Notification.EXTRA_PROGRESS (:92). Nothing reads the content text. Swapping the two strings, or
collapsing them into one, passes the suite.

Nothing in the suite instantiates ConversionNotifications directly.

The work

A direct Robolectric test on the class: build one notification each way, read
Notification.extras.getString(Notification.EXTRA_TEXT), assert the two differ and that the
determinate one carries the percentage.

Acceptance: the mutation that must go red

Swap the two branch results.

Not in scope

areEnabled() in the same file. It has no caller anywhere in app/src/main — a test would assert
that a function nobody calls returns what the platform told it, and would imply the app handles the
disabled-notification case when it does not. See F5 in docs/coverage-read-findings.md, which
records this exact reasoning and asks for a decision, not a test.

## Two notification strings that can be swapped without failing anything `ConversionNotifications.build` (`app/src/main/java/org/libremediaconverter/work/ConversionNotifications.kt:33-38`) chooses between an indeterminate "preparing" text and an "N%" text. An assertion gap: JaCoCo is green on the branch, because `ProgressNotificationTest` drives it through `ConversionWorker` — but that test reads only the notification id and `Notification.EXTRA_PROGRESS` (`:92`). Nothing reads the content text. Swapping the two strings, or collapsing them into one, passes the suite. Nothing in the suite instantiates `ConversionNotifications` directly. ## The work A direct Robolectric test on the class: build one notification each way, read `Notification.extras.getString(Notification.EXTRA_TEXT)`, assert the two differ and that the determinate one carries the percentage. ## Acceptance: the mutation that must go red Swap the two branch results. ## Not in scope `areEnabled()` in the same file. It has no caller anywhere in `app/src/main` — a test would assert that a function nobody calls returns what the platform told it, and would imply the app handles the disabled-notification case when it does not. See F5 in `docs/coverage-read-findings.md`, which records this exact reasoning and asks for a decision, not a test.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMediaConverter#174