Skip to content

fix(tests): un-nest AudioMetaUtilsTest — the whole class never ran - #2821

Closed
PonceGL wants to merge 1 commit into
PixelPlayerHQ:masterfrom
PonceGL:chore/p7-fix-audiometautilstest
Closed

PonceGL wants to merge 1 commit into
PixelPlayerHQ:masterfrom
PonceGL:chore/p7-fix-audiometautilstest

Conversation

@PonceGL

@PonceGL PonceGL commented Sep 10, 2026

Copy link
Copy Markdown

What

app/src/test/.../utils/AudioMetaUtilsTest.kt is corrupted by what looks like
a bad paste or merge: mimeTypeToFormat_mapsUniversalFormats is defined three
times — once at class level, and twice more as local functions nested inside
mimeTypeToFormat_mapsM4aVariants and mimeTypeToFormat_mapsSamsungFormats.
One of the small independent fixes listed in #2813.

Braces are balanced (Kotlin allows local functions), so it compiles. But a
local function carrying @Test compiles to a synthetic
exterior$interior method, and JUnit4's runner rejects the whole class for
it: InvalidTestClassError: ... should not be static / should be public.

The real cost: the class never runs at all. mimeTypeToFormat() — used on
every library scan — has had zero test coverage since this landed, silently.

Change

Un-nests the three functions back to class level, three @Test methods, no
class-level duplication. Not a single assertion changed — I checked all 16
by hand against the current mimeTypeToFormat() implementation: they were
already correct, they just never ran. First real execution, all green.

Testing

The fix is the test result: 3 tests that previously errored on
class-load now pass. :app:testDebugUnitTest — 390 tests, only the 4
other pre-existing baseline failures remain, none new.

A bad paste/merge left mimeTypeToFormat_mapsUniversalFormats defined
three times, two of them as local functions nested inside the other
two @test methods. Braces were balanced so it compiled, but a local
function annotated @test compiles to a synthetic exterior$interior
method that JUnit4's runner rejects, taking the whole class down with
InvalidTestClassError.

Un-nests the three functions back to class level. No assertion changed:
verified all 16 by hand against the current mimeTypeToFormat() — they
were already correct, just never executed. mimeTypeToFormat() had zero
coverage; now it has 3 passing tests, exercised for the first time.

check-baseline.sh / BASELINE-TESTS.md updated to drop this from the
known-failures list (local docs, gitignored — not part of this diff).
@PonceGL

PonceGL commented Sep 10, 2026

Copy link
Copy Markdown
Author

Closing for now — reorganizing how this work is staged. It'll go through our fork first and we'll propose it upstream again, possibly bundled differently, once the larger feature it's part of is further along. Not a rejection, just a process change on our side.

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.

1 participant