tests/image: comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:50:18 -05:00
1 parent e306d5c1d7
commit a80299dce0
27 files changed
+32 -199

No files matched your search

+1 -9
View File
@@ -1,8 +1,4 @@
-- image/exr tests: files from the OpenEXR 3.5 bindings (NONE / RLE / ZIPS / ZIP / PIZ; HALF / FLOAT / UINT; offset
-- data window; decreasing lines; Y-only; a layer), a hand-written subsampled file, exrmaketiled tiles (one level,
-- mip-map, rip-map, round up) and exrmultipart parts against the bindings' reads; PXR24 / B44 / DWAA UNSUPPORTED; our
-- files read back by the bindings and exrheader; round trips; errors; the fuzz no-throw pass. Fixtures:
-- tools/fixtures/exr.py.
-- image/exr tests against the OpenEXR 3.5 bindings, exrmaketiled, exrmultipart and exrheader (tools/fixtures/exr.py).
local T = require("@tests/T")
local Exr = require("@rosetta/image/exr")
local Bytes = require("@rosetta/core/Bytes")
@@ -19,7 +15,6 @@ local function dec(data: any, opts: any?): (any, any)
return Exr.decode(Bytes.reader(if type(data) == "string" then buffer.fromstring(data) else data), opts)
end
-- the largest difference between two rgbaf32 buffers (exact for HALF / FLOAT, UINT as their values)
local function worst(a: buffer, b: buffer, n: number): number
local m = 0
for i = 0, n * 4 - 1 do
@@ -54,13 +49,11 @@ for _, c in Fx.cases do
local up = string.find(c.name, "up") ~= nil
t:eq(mm[1].width, if up then math.ceil(c.w / 2) else c.w // 2, c.name .. ": level 1 width")
end
-- the rgba8 display conversion
local d8 = dec(c.data, { layer = c.layer, part = c.part })
t:eq(d8.format, "rgba8", c.name .. ": rgba8 by default")
end
t:note("%d files match the OpenEXR bindings", #Fx.cases)
-- the window, the attributes
do
for _, c in Fx.cases do
if c.name == "window_zip.exr" then
@@ -109,7 +102,6 @@ do
t:check(e and e.code == Err.ARG, "no PIZ encoder")
end
-- sniff, info, errors
do
local c = Fx.cases[1]
t:eq(Exr.sniff(Bytes.reader(buffer.fromstring(c.data))), 1, "sniff")