tests/codecs (a-m): comments: specs only
This commit is contained in:
1 parent
a80299dce0
commit
5f7f6005f6
24 files changed
+46
-181
No files matched your search
@@ -1,6 +1,5 @@
|
||||
-- codecs/compress/Lzw tests: GIF (LSB) and TIFF (MSB, early change) code streams from Pillow / libtiff decode to their data;
|
||||
-- our encoder round-trips random and structured data at every GIF minimum code size and through table resets; the
|
||||
-- output limit, truncated and corrupt streams; the fuzz no-throw pass. Fixtures: tools/fixtures/lzw.py.
|
||||
-- codecs/compress/Lzw tests: GIF (LSB) and TIFF (MSB, early change) streams from Pillow / libtiff, the encoder.
|
||||
-- Fixtures: tools/fixtures/lzw.py.
|
||||
local T = require("@tests/T")
|
||||
local Lzw = require("@rosetta/codecs/compress/Lzw")
|
||||
local Fx = require("@tests/gen/lzw")
|
||||
@@ -13,7 +12,6 @@ local function dec(codes: buffer, n: number, variant: string, min: number?): (st
|
||||
return buffer.tostring(out), got, err
|
||||
end
|
||||
|
||||
-- reference streams
|
||||
for _, c in Fx.gif do
|
||||
local s, n, err = dec(buffer.fromstring(c.codes), #c.data, "gif", c.min)
|
||||
t:check(err == nil, "gif " .. c.name .. ": " .. tostring(err))
|
||||
@@ -28,7 +26,6 @@ for _, c in Fx.tiff do
|
||||
end
|
||||
t:note("%d GIF and %d TIFF reference streams decode", #Fx.gif, #Fx.tiff)
|
||||
|
||||
-- round trips
|
||||
local rand = T.rng(3)
|
||||
local function data(n: number, kind: number, max: number): buffer
|
||||
local b = buffer.create(n)
|
||||
@@ -77,7 +74,6 @@ do
|
||||
t:check(buffer.readstring(out, 10, 100) == buffer.readstring(big, 100, 100), "sub-range data")
|
||||
end
|
||||
|
||||
-- limits, truncation, corruption
|
||||
do
|
||||
local d = data(1000, 2, 16)
|
||||
local codes = Lzw.encode(d, 0, 1000, "gif", 4)
|
||||
@@ -94,7 +90,6 @@ do
|
||||
t:check(err4 == "corrupt", "bad min code size")
|
||||
end
|
||||
|
||||
-- fuzz
|
||||
do
|
||||
local samples = {}
|
||||
for i, c in Fx.gif do
|
||||
|
||||
Reference in new issue
Block a user