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

+2 -12
View File
@@ -1,8 +1,5 @@
-- model/x tests: assimp's DirectX test models (text, binary 32-bit, MSZIP-compressed binary) and variants made by
-- tools/fixtures/x.py (binary with 64-bit floats, MSZIP-compressed text), against assimp (meshes per material, faces,
-- corners, materials, animations, bones, world bounds); frames, materials and textures, vertex colours, skins
-- (influences, inverse bind matrices against the bind pose), animation keys (the rotation convention against the
-- bind pose); an inline text file; errors; the fuzz no-throw pass. Fixtures: tools/fixtures/x.py.
-- model/x tests: assimp's DirectX models and generated variants (64-bit floats, MSZIP text) against assimp.
-- Fixtures: tools/fixtures/x.py.
local T = require("@tests/T")
local X = require("@rosetta/model/x")
local MeshOps = require("@rosetta/ops/MeshOps")
@@ -75,7 +72,6 @@ local function boundsMatch(lo: { number }?, hi: { number }?, a: any, eps: number
return true
end
-- ------------------------------------------------------------------------------------------------ assimp
local scenes, byName = {}, {}
local checked = 0
for i, c in Cases do
@@ -105,7 +101,6 @@ for i, c in Cases do
end
t:note("%d files checked against assimp", checked)
-- variants decode like their originals
for _, c in Cases do
if c.of then
local a, b = scenes[c.name], scenes[c.of]
@@ -121,7 +116,6 @@ for _, c in Cases do
end
end
-- ------------------------------------------------------------------------------------------------ details
do
local s = scenes["models/kwxport_test_cubewithvcolors.x"]
local p = s.meshes[1].primitives[1]
@@ -135,7 +129,6 @@ do
t:eq(v.meta.source.floatSize, 64, "64-bit floats")
end
do
-- textures: uri names, TEXCOORD_0
local s = scenes["models/test.x"]
local any = false
for _, m in s.materials do
@@ -225,7 +218,6 @@ do
t:check(total > 0 and same >= total * 0.5, string.format("first rotation keys match the bind pose (%d / %d)", same, total))
end
-- ------------------------------------------------------------------------------------------------ inline file
local CUBE = [[xof 0303txt 0032
// a quad and a triangle, two materials, one animated frame
Material Red { 1.0; 0.0; 0.0; 1.0;; 10.0; 0.5; 0.5; 0.5;; 0.0; 0.0; 0.0;; TextureFilename { "tex\\red.png"; } }
@@ -275,7 +267,6 @@ do
t:eq(tri.meshes[1].primitives[1].indices.count, 6, "inline: quad fan-triangulated")
end
-- ------------------------------------------------------------------------------------------------ errors
do
local _, e1 = decode("xof 0303txt 00")
t:check(e1 and e1.code == Err.TRUNCATED, "short: " .. tostring(e1))
@@ -294,7 +285,6 @@ do
t:eq(X.sniff(Bytes.reader(buffer.fromstring(CUBE))), 1, "sniff")
end
-- ------------------------------------------------------------------------------------------------ fuzz
do
local samples = { CUBE }
for _, c in Cases do