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 -6
View File
@@ -1,7 +1,4 @@
-- image/ico tests: ImageMagick- and Pillow-written icons (PNG and BMP entries, a 256 PNG entry) and hand-built ones
-- (1 / 4 / 8 / 24 / 32-bit DIBs with AND masks, a cursor with hotspots) against Pillow's decode of every entry; PNG
-- entries through opts.decodeImage (and UNSUPPORTED without it); the main image is the largest entry; our encoder
-- (DIB, PNG through opts.encodeImage, cursors) round-trips; errors; the fuzz no-throw pass. Fixtures: tools/fixtures/ico.py.
-- image/ico tests against Pillow's decode of every entry (tools/fixtures/ico.py).
local T = require("@tests/T")
local Ico = require("@rosetta/image/ico")
local Png = require("@rosetta/image/png")
@@ -47,7 +44,6 @@ for _, c in Fx do
entries += 1
end
t:eq(img.width * img.height, biggest, c.name .. ": the main image is the largest entry")
-- round trip through our encoder (DIB entries, and PNG for 256 through the hook)
local enc, eerr = Ico.encode(img, hooks)
t:check(enc, c.name .. ": encode: " .. tostring(eerr))
local back = dec(enc, hooks)
@@ -90,7 +86,6 @@ do
t:eq(buffer.readu16(cenc, 2), 2, "cursor written as CUR")
local cb = dec(cenc)
t:check(cb.meta.hotspot.x == 3 and cb.frames[2].image.meta.hotspot.y == 6, "hotspots round-trip")
-- PNG entries on request
local small = Types.Image.new(16, 16)
buffer.fill(small.pixels, 0, 200, 16 * 16 * 4)
local pe = Ico.encode(small, { png = true, encodeImage = hooks.encodeImage }) :: buffer