tests/codecs (m-z): comments: specs only
This commit is contained in:
1 parent
98b4ce533e
commit
a6732d45f2
23 files changed
+46
-177
No files matched your search
@@ -1,6 +1,4 @@
|
||||
-- codecs/image/Vp8L tests: the VP8L bitstreams of the WebP fixtures (cwebp -z 0..9, -exact, near-lossless) decoded through
|
||||
-- the codec API against dwebp, the encoder at every effort on generated images (gradients, noise, palettes of 1..300
|
||||
-- colours, odd sizes, alpha), headerless alpha streams, error codes, and the fuzz no-throw pass on raw bitstreams.
|
||||
-- codecs/image/Vp8L tests: the WebP fixtures' VP8L (cwebp -z 0..9, -exact, near-lossless) against dwebp, the encoder.
|
||||
-- Fixtures: tools/fixtures/webp.py.
|
||||
local T = require("@tests/T")
|
||||
local Vp8L = require("@rosetta/codecs/image/Vp8L")
|
||||
@@ -10,7 +8,6 @@ local Cases = require("@tests/gen/webp_cases")
|
||||
|
||||
local t = T.suite("vp8l")
|
||||
|
||||
-- the VP8L chunk of a simple-format file
|
||||
local function chunk(data: string): (buffer?, number, number)
|
||||
if string.sub(data, 13, 16) ~= "VP8L" then
|
||||
return nil, 0, 0
|
||||
@@ -40,7 +37,6 @@ for _, c in Cases do
|
||||
end
|
||||
t:note("%d VP8L bitstreams match dwebp", n)
|
||||
|
||||
-- the encoder: round trips at every effort
|
||||
local rand = T.rng(5)
|
||||
local function gen(w: number, h: number, kind: string): buffer
|
||||
local px = buffer.create(w * h * 4)
|
||||
@@ -92,7 +88,6 @@ for _, kind in { "grad", "alpha", "noise", "pal1", "pal4", "pal40", "pal300" } d
|
||||
end
|
||||
t:note("%d encoder round trips", count)
|
||||
|
||||
-- errors
|
||||
do
|
||||
local _, e1 = Vp8L.decode(buffer.fromstring("\x2e\0\0\0\0"))
|
||||
t:check(e1 and e1.code == Err.CORRUPT, "bad signature: " .. tostring(e1))
|
||||
@@ -109,7 +104,6 @@ do
|
||||
t:check(e6 and e6.code == Err.ARG, "encode: short pixel buffer")
|
||||
end
|
||||
|
||||
-- fuzz on raw bitstreams
|
||||
t:fuzz("decode", function(b: buffer)
|
||||
return Vp8L.decode(b, 0, buffer.len(b), 2 ^ 20)
|
||||
end, streams, { mutations = 10, keepHeader = 5 })
|
||||
|
||||
Reference in new issue
Block a user