Three pure helpers in MediaProbe had no test: shortName, isImageFormat and intOr. All
three were private; they are internal now, as #57 did it, with the reason for each function's
shape written into its KDoc rather than left to the reader.
18 tests across three classes — two plain JVM, one Robolectric. MediaFormat.MIMETYPE_* are Java
compile-time String constants, so shortName and isImageFormat need no Android runtime at all;
only intOr does, because it needs a real MediaFormat instance rather than its constants.
The acceptance mutation, and why it is not the one the ticket named
The ticket's literal example stays green, and that is a finding about the code. Deleting MIMETYPE_VIDEO_HEVC -> "hevc" leaves the whole suite passing — measured, not argued — because video/hevc falls through to substringAfter('/') and produces hevc anyway. Four arms are like
this:
arm
MIME
mapped
what the fallback gives
arm-deletion detectable?
HEVC
video/hevc
hevc
hevc
no
OPUS
audio/opus
opus
opus
no
FLAC
audio/flac
flac
flac
no
VORBIS
audio/vorbis
vorbis
vorbis
no
AVC
video/avc
h264
avc
yes
AAC
audio/mp4a-latm
aac
mp4a-latm
yes
VP8 / VP9
video/x-vnd.on2.vp*
vp8 / vp9
x-vnd.on2.vp*
yes
AV1
video/av01
av1
av01
yes
MPEG4
video/mp4v-es
mpeg4
mp4v-es
yes
RAW
audio/raw
pcm
raw
yes
No test can catch the deletion of the top four, by construction. They are not removed here —
they document intent, and their assertions still bite an arm whose mapping changes rather than
one that disappears. The acceptance mutation was run on MIMETYPE_VIDEO_AVC -> "h264" instead.
Mutations run
Delete MediaFormat.MIMETYPE_VIDEO_AVC -> "h264":
MediaProbeMimeNamesTest > an AVC track is reported as h264, which is what everything downstream calls it FAILED
org.junit.ComparisonFailure at MediaProbeMimeNamesTest.kt:107
org.junit.ComparisonFailure: shortName("video/avc") expected:<[h264]> but was:<[avc]>
Change it.endsWith("_pipe") to it.contains("pipe"):
MediaProbeImageFormatTest > a format that merely contains pipe is not an image FAILED
java.lang.AssertionError at MediaProbeImageFormatTest.kt:86
java.lang.AssertionError: isImageFormat("yuv4mpegpipe")
Two more, so the third helper and the fallback are not taken on trust either:
Drop the runCatching in intOr -> MediaProbeTrackFieldsTest > a frame rate the format carries as a Float gives the fallback rather than throwing FAILED / java.lang.ClassCastException at MediaProbeTrackFieldsTest.kt:69
Change else -> mime.substringAfter('/') to else -> mime -> MediaProbeMimeNamesTest > a MIME with no arm of its own falls back to its subtype FAILED / org.junit.ComparisonFailure
And the one that proves the point above: delete MIMETYPE_VIDEO_HEVC -> "hevc" -> 29 tests, 0
failures.
Where the assertions come from
Format names were read back from ffprobe -show_entries format=format_name rather than recalled:
a .png reports png_pipe, a .jpg reports jpeg_pipe, a .y4m reports yuv4mpegpipe, and image2 appears only when that demuxer is named explicitly. yuv4mpegpipe is why the _pipe half
of the rule has to stay a suffix test — it contains pipe and is raw video. The MIME constants
were read out of android.jar with javap -constants.
image2pipe is noted in the test KDoc and deliberately asserted neither way: it gets a false
answer, but probeWithFFprobe forces no format, and FFprobe only selects that demuxer when it is
named with -f. The name cannot reach this app, so pinning today's answer would be a test about
FFmpeg's command line.
Named exemptions
readMediaInformation, probeWithExtractor, probe, probeWithFFprobe and probeForConcat are
untouched. They are FFprobe- and MediaExtractor-bound and are exercised by RemuxTest, ConcatEngineTest and RealMediaBenchmark in androidTest, which the JVM coverage report does
not see. Not mocked, deliberately — MediaProbeFormatTest and MediaProbeNativeLoadTest already
cover the parsing and the native-failure edge at the seams that exist.
Also not covered: the four vacuous arms above, at the level of arm deletion, for the reason given.
Gate green locally: assembleDebug, testDebugUnitTest, compileDebugAndroidTestKotlin, ktlintCheck, detekt, lintDebug.
Closes #84.
Three pure helpers in `MediaProbe` had no test: `shortName`, `isImageFormat` and `intOr`. All
three were `private`; they are `internal` now, as #57 did it, with the reason for each function's
shape written into its KDoc rather than left to the reader.
18 tests across three classes — two plain JVM, one Robolectric. `MediaFormat.MIMETYPE_*` are Java
compile-time String constants, so `shortName` and `isImageFormat` need no Android runtime at all;
only `intOr` does, because it needs a real `MediaFormat` instance rather than its constants.
## The acceptance mutation, and why it is not the one the ticket named
**The ticket's literal example stays green, and that is a finding about the code.** Deleting
`MIMETYPE_VIDEO_HEVC -> "hevc"` leaves the whole suite passing — measured, not argued — because
`video/hevc` falls through to `substringAfter('/')` and produces `hevc` anyway. Four arms are like
this:
| arm | MIME | mapped | what the fallback gives | arm-deletion detectable? |
|---|---|---|---|---|
| HEVC | `video/hevc` | `hevc` | `hevc` | **no** |
| OPUS | `audio/opus` | `opus` | `opus` | **no** |
| FLAC | `audio/flac` | `flac` | `flac` | **no** |
| VORBIS | `audio/vorbis` | `vorbis` | `vorbis` | **no** |
| AVC | `video/avc` | `h264` | `avc` | yes |
| AAC | `audio/mp4a-latm` | `aac` | `mp4a-latm` | yes |
| VP8 / VP9 | `video/x-vnd.on2.vp*` | `vp8` / `vp9` | `x-vnd.on2.vp*` | yes |
| AV1 | `video/av01` | `av1` | `av01` | yes |
| MPEG4 | `video/mp4v-es` | `mpeg4` | `mp4v-es` | yes |
| RAW | `audio/raw` | `pcm` | `raw` | yes |
No test can catch the deletion of the top four, by construction. They are **not** removed here —
they document intent, and their assertions still bite an arm whose *mapping* changes rather than
one that disappears. The acceptance mutation was run on `MIMETYPE_VIDEO_AVC -> "h264"` instead.
## Mutations run
**Delete `MediaFormat.MIMETYPE_VIDEO_AVC -> "h264"`:**
```
MediaProbeMimeNamesTest > an AVC track is reported as h264, which is what everything downstream calls it FAILED
org.junit.ComparisonFailure at MediaProbeMimeNamesTest.kt:107
org.junit.ComparisonFailure: shortName("video/avc") expected:<[h264]> but was:<[avc]>
```
**Change `it.endsWith("_pipe")` to `it.contains("pipe")`:**
```
MediaProbeImageFormatTest > a format that merely contains pipe is not an image FAILED
java.lang.AssertionError at MediaProbeImageFormatTest.kt:86
java.lang.AssertionError: isImageFormat("yuv4mpegpipe")
```
Two more, so the third helper and the fallback are not taken on trust either:
- Drop the `runCatching` in `intOr` -> `MediaProbeTrackFieldsTest > a frame rate the format carries
as a Float gives the fallback rather than throwing FAILED / java.lang.ClassCastException at
MediaProbeTrackFieldsTest.kt:69`
- Change `else -> mime.substringAfter('/')` to `else -> mime` -> `MediaProbeMimeNamesTest > a MIME
with no arm of its own falls back to its subtype FAILED / org.junit.ComparisonFailure`
And the one that proves the point above: **delete `MIMETYPE_VIDEO_HEVC -> "hevc"` -> 29 tests, 0
failures.**
## Where the assertions come from
Format names were read back from `ffprobe -show_entries format=format_name` rather than recalled:
a `.png` reports `png_pipe`, a `.jpg` reports `jpeg_pipe`, a `.y4m` reports `yuv4mpegpipe`, and
`image2` appears only when that demuxer is named explicitly. `yuv4mpegpipe` is why the `_pipe` half
of the rule has to stay a suffix test — it contains `pipe` and is raw video. The MIME constants
were read out of `android.jar` with `javap -constants`.
`image2pipe` is noted in the test KDoc and deliberately asserted neither way: it gets a false
answer, but `probeWithFFprobe` forces no format, and FFprobe only selects that demuxer when it is
named with `-f`. The name cannot reach this app, so pinning today's answer would be a test about
FFmpeg's command line.
## Named exemptions
`readMediaInformation`, `probeWithExtractor`, `probe`, `probeWithFFprobe` and `probeForConcat` are
untouched. They are FFprobe- and `MediaExtractor`-bound and are exercised by `RemuxTest`,
`ConcatEngineTest` and `RealMediaBenchmark` in `androidTest`, which the JVM coverage report does
not see. Not mocked, deliberately — `MediaProbeFormatTest` and `MediaProbeNativeLoadTest` already
cover the parsing and the native-failure edge at the seams that exist.
Also not covered: the four vacuous arms above, at the level of arm deletion, for the reason given.
Gate green locally: `assembleDebug`, `testDebugUnitTest`, `compileDebugAndroidTestKotlin`,
`ktlintCheck`, `detekt`, `lintDebug`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #84.
Three pure helpers in
MediaProbehad no test:shortName,isImageFormatandintOr. Allthree were
private; they areinternalnow, as #57 did it, with the reason for each function'sshape written into its KDoc rather than left to the reader.
18 tests across three classes — two plain JVM, one Robolectric.
MediaFormat.MIMETYPE_*are Javacompile-time String constants, so
shortNameandisImageFormatneed no Android runtime at all;only
intOrdoes, because it needs a realMediaFormatinstance rather than its constants.The acceptance mutation, and why it is not the one the ticket named
The ticket's literal example stays green, and that is a finding about the code. Deleting
MIMETYPE_VIDEO_HEVC -> "hevc"leaves the whole suite passing — measured, not argued — becausevideo/hevcfalls through tosubstringAfter('/')and produceshevcanyway. Four arms are likethis:
video/hevchevchevcaudio/opusopusopusaudio/flacflacflacaudio/vorbisvorbisvorbisvideo/avch264avcaudio/mp4a-latmaacmp4a-latmvideo/x-vnd.on2.vp*vp8/vp9x-vnd.on2.vp*video/av01av1av01video/mp4v-esmpeg4mp4v-esaudio/rawpcmrawNo test can catch the deletion of the top four, by construction. They are not removed here —
they document intent, and their assertions still bite an arm whose mapping changes rather than
one that disappears. The acceptance mutation was run on
MIMETYPE_VIDEO_AVC -> "h264"instead.Mutations run
Delete
MediaFormat.MIMETYPE_VIDEO_AVC -> "h264":Change
it.endsWith("_pipe")toit.contains("pipe"):Two more, so the third helper and the fallback are not taken on trust either:
runCatchinginintOr->MediaProbeTrackFieldsTest > a frame rate the format carries as a Float gives the fallback rather than throwing FAILED / java.lang.ClassCastException at MediaProbeTrackFieldsTest.kt:69else -> mime.substringAfter('/')toelse -> mime->MediaProbeMimeNamesTest > a MIME with no arm of its own falls back to its subtype FAILED / org.junit.ComparisonFailureAnd the one that proves the point above: delete
MIMETYPE_VIDEO_HEVC -> "hevc"-> 29 tests, 0failures.
Where the assertions come from
Format names were read back from
ffprobe -show_entries format=format_namerather than recalled:a
.pngreportspng_pipe, a.jpgreportsjpeg_pipe, a.y4mreportsyuv4mpegpipe, andimage2appears only when that demuxer is named explicitly.yuv4mpegpipeis why the_pipehalfof the rule has to stay a suffix test — it contains
pipeand is raw video. The MIME constantswere read out of
android.jarwithjavap -constants.image2pipeis noted in the test KDoc and deliberately asserted neither way: it gets a falseanswer, but
probeWithFFprobeforces no format, and FFprobe only selects that demuxer when it isnamed with
-f. The name cannot reach this app, so pinning today's answer would be a test aboutFFmpeg's command line.
Named exemptions
readMediaInformation,probeWithExtractor,probe,probeWithFFprobeandprobeForConcatareuntouched. They are FFprobe- and
MediaExtractor-bound and are exercised byRemuxTest,ConcatEngineTestandRealMediaBenchmarkinandroidTest, which the JVM coverage report doesnot see. Not mocked, deliberately —
MediaProbeFormatTestandMediaProbeNativeLoadTestalreadycover the parsing and the native-failure edge at the seams that exist.
Also not covered: the four vacuous arms above, at the level of arm deletion, for the reason given.
Gate green locally:
assembleDebug,testDebugUnitTest,compileDebugAndroidTestKotlin,ktlintCheck,detekt,lintDebug.🤖 Generated with Claude Code