Save states taken before an M3U swap name the playlist itself, so the
playlist path stays known media even when its entries are opened as
separate images. Inserting checks that the selected index has an image:
index == count selects no disc, and an added slot stays empty until it
is replaced.
The disk suite in tests/run_tests.sh boots a two-entry M3U on its second
entry, swaps, loads the earlier state, then removes and re-adds entries.
tests/run_tests.sh builds small MIPS programs with clang that run in
place of the BIOS, and a headless libretro frontend that boots the core
with them:
- mdec: decodes macroblock streams through DMA in both channel orders,
24- and 15-bit, with and without AC coefficients, and through CPU reads,
and compares the output with tests/mdec_decode.expected.
- polyline: draws poly-lines longer than the core buffers, flat and
shaded, opaque and blended, and compares VRAM with
tests/gpu_polyline.expected.
- regfuzz: pokes the GPU, DMA, CD-ROM, SPU, MDEC, timer and SIO registers
with pseudo-random values, with a small disc inserted.
- statefuzz: loads corrupted save states into a fuzzed system.
The workflow runs them on a release build with every CPU mode, under
ASan and UBSan, and under TSan with the GPU and CD-ROM threads.