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 -15
View File
@@ -1,10 +1,5 @@
-- model/vrml tests: assimp's WRL test models (HelloWorld, Wuson, the MotionCaptureROM animation), scenes and glTF
-- samples written by VTK's VRML exporter, and hand-written feature files (PROTO, DEF / USE, per-face colours and
-- separate indices, primitives, ElevationGrid, Extrusion, Switch, LOD, lights, viewpoints, ROUTE animations,
-- PixelTexture, Inline), against VTK's vtkVRMLImporter (polygons, points, world bounds where VTK's transforms are
-- right) and exact expectations; the writer: round trips of every case and of glTF sample models (world triangles,
-- materials, textures, cameras, lights, animation samples), VTK reading our files like the originals; errors; the
-- fuzz no-throw pass. Fixtures: tools/fixtures/vrml.py.
-- model/vrml tests: assimp's WRL models, VTK exports and hand-written files against vtkVRMLImporter and exact values.
-- Fixtures: tools/fixtures/vrml.py.
local T = require("@tests/T")
local F = require("@rosetta")
local Vrml = require("@rosetta/model/vrml")
@@ -31,7 +26,6 @@ t:eq(Vrml.name, "vrml", "name")
t:eq(Vrml.category, "model", "category")
t:check(Vrml.caps.decode and Vrml.caps.encode, "contract")
-- ------------------------------------------------------------------------------------------------ reference files
local scenes, byName = {}, {}
local checked = { vtk = 0, bounds = 0, none = 0 }
for i, c in Cases do
@@ -60,7 +54,6 @@ for i, c in Cases do
end
t:note("%d files: %d against VTK (%d with bounds), %d VTK cannot read", #Cases, checked.vtk, checked.bounds, checked.none)
-- ------------------------------------------------------------------------------------------------ exact expectations
local function prims(scene: any): { any }
local out = {}
for _, pl in Types.Scene.flatten(scene) do
@@ -228,7 +221,6 @@ do
end
end
-- ------------------------------------------------------------------------------------------------ writer
local function compare(a: any, b: any, label: string)
local sa, sb = C.stats(a), C.stats(b)
t:eq(sb.prims, sa.prims, label .. ": placed primitives")
@@ -274,7 +266,6 @@ for i, c in Cases do
end
end
-- glTF samples through VRML: world triangles, materials, textures, cameras, lights, animation samples
local gltfScenes = {}
for i, c in GltfCases do
local g = Gltf.decode(Bytes.reader(buffer.fromstring(c.data)), { files = c.files })
@@ -305,7 +296,6 @@ for i, c in GltfCases do
t:check(t2.data and buffer.tostring(t2.data) == buffer.tostring(tex.data), c.name .. ": texture " .. k .. " bytes")
end
end
-- animations: the translation / rotation / scale channels, sampled at their keys
local want = 0
for _, a in g.animations do
for _, ch in a.channels do
@@ -323,7 +313,6 @@ for i, c in GltfCases do
end
t:note("%d round trips", rt)
-- VTK reads our files like the originals
local xc = 0
for _, x in Xcheck do
local v = x.vtk
@@ -344,7 +333,6 @@ for _, x in Xcheck do
end
t:note("%d of our files read by VTK", xc)
-- ------------------------------------------------------------------------------------------------ api, options, errors
do
local text = Cases[1].data
t:eq(F.detect(text), "vrml", "F.detect")
@@ -390,7 +378,6 @@ do
t:check(q and q.meshes[1].primitives[1].faces.count == 1 and q.nodes[1].name == "quad", "a quad stays one polygon, names kept")
end
-- ------------------------------------------------------------------------------------------------ fuzz
do
local samples = {}
for _, c in Cases do