tests/music: comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:50:30 -05:00
1 parent fe7566cbba
commit 98b4ce533e
23 files changed
+49 -119

No files matched your search

+3 -8
View File
@@ -1,6 +1,5 @@
-- music/mod tests: generated ProTracker modules (tools/fixtures/mod.py) parsed, rendered through codecs/audio/Tracker and
-- compared with openmpt123's render (loudness envelope, band spectrum, stereo balance, song length), the MOD writer's
-- round trip, the contract, and the fuzz no-throw pass.
-- music/mod tests: generated ProTracker modules vs openmpt123's render.
-- Fixtures: tools/fixtures/mod.py.
local T = require("@tests/T")
local S = require("@tests/music/_similar")
local Mod = require("@rosetta/music/mod")
@@ -47,8 +46,7 @@ for _, c in Cases do
t:eq(buffer.tostring(out :: buffer), c.data, c.name .. ": round trip bytes")
end
-- MOD -> XM: the converted module plays as long, and sounds alike (XM has no channel panning and uses FT2's NTSC
-- Amiga clock, so only the duration and the band spectrum are compared)
-- MOD -> XM: only duration and band spectrum compared (XM has no channel panning, uses the FT2 NTSC Amiga clock)
local Xm = require("@rosetta/music/xm")
for _, c in Cases do
local m = load(c.data)
@@ -63,7 +61,6 @@ for _, c in Cases do
t:check(r.spectral > 0.9, string.format("%s: xm spectrum %.3f", c.name, r.spectral))
end
-- through the API: load sniffs the MOD, open gives a Decoder, save converts to XM, load(as audio) renders
do
local F = require("@rosetta")
local m, err = F.load(Cases[1].data)
@@ -75,7 +72,6 @@ do
t:eq(F.saveString(m, { format = "mod" }), Cases[1].data, "F.saveString keeps the MOD bytes")
end
-- seek: the position after a seek and the output continuing
do
local m = load(Cases[1].data)
local dec = m:render()
@@ -108,7 +104,6 @@ do
t:check(total == 240000 and math.abs(l.duration - dec.duration) < 0.01, "loop plays past the end")
end
-- the fuzz pass: decode, and a short render of whatever decodes
local samples = {}
for _, c in Cases do
table.insert(samples, c.data)