tests/model: comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:50:23 -05:00
1 parent 5f7f6005f6
commit fe7566cbba
37 files changed
+72 -440

No files matched your search

+1 -7
View File
@@ -1,6 +1,4 @@
-- model/md2 tests: MD2 files written by tools/fixtures/md2.py decode to assimp's frame-0 triangle soup (positions,
-- texture coordinates) and to the writer's exact positions for every frame (base + morph target deltas), frame
-- groups as animations, skins as texture URIs, opts.frame / morph = false, errors, the fuzz pass.
-- model/md2 tests: generated MD2 files against assimp's frame-0 soup and the writer's exact frames.
local T = require("@tests/T")
local F = require("@rosetta")
local Md2 = require("@rosetta/model/md2")
@@ -19,12 +17,10 @@ for _, c in Fx do
t:eq(F.detect(c.data), "md2", c.name .. ": F.detect")
local prim = s.meshes[1].primitives[1]
t:eq(prim.indices.count, c.tris * 3, c.name .. ": triangles")
-- assimp, frame 0
local ok, at = Soup.close(Soup.positions(prim), c.assimp.pos, 1e-5)
t:check(ok, c.name .. ": positions against assimp (" .. tostring(at) .. ")")
local uok, uat = Soup.close(Soup.uvs(prim, 0, true), c.assimp.uv, 1e-6)
t:check(uok, c.name .. ": texture coordinates against assimp (" .. tostring(uat) .. ")")
-- every frame, exact
t:eq(Crc32.of(Soup.positions(prim)), c.crcs[1], c.name .. ": frame 1 exact")
for k = 1, c.frames do
local f = Soup.positions(prim, k)
@@ -41,7 +37,6 @@ for _, c in Fx do
end)(), 1e-5)
t:check(fok, c.name .. ": morph target " .. k .. " = frame " .. k)
end
-- animations from the frame names
local groups = {}
for _, a in s.animations do
table.insert(groups, a.name)
@@ -52,7 +47,6 @@ for _, c in Fx do
t:eq(table.concat(groups, ","), "stand,run,attack,pain", c.name .. ": animation groups")
t:eq(s.animations[2].channels[1].input.count, 4, c.name .. ": run has 4 keys")
end
-- skins
t:eq(#s.textures, #c.skins, c.name .. ": skins")
if #c.skins > 0 then
t:eq(s.textures[1].uri, c.skins[1], c.name .. ": skin uri")