summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/lua/unit/base32.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/lua/unit/base32.lua b/test/lua/unit/base32.lua
index a460b6575..d6e67c06a 100644
--- a/test/lua/unit/base32.lua
+++ b/test/lua/unit/base32.lua
@@ -33,7 +33,7 @@ context("Base32 encodning", function()
end
end)
- test("Base32 fuzz test", function()
+ test("Base32 fuzz test: zbase32", function()
for i = 1,1000 do
local b, l = random_buf(4096)
local how = math.floor(math.random(3) - 1)
@@ -42,6 +42,8 @@ context("Base32 encodning", function()
local nl = ffi.new("size_t [1]")
local nb = ffi.C.rspamd_decode_base32(bs, #bs, nl, how)
+ assert_equal(tonumber(nl[0]), l,
+ string.format("invalid size reported: %d reported vs %d expected", tonumber(nl[0]), l))
local cmp = ffi.C.memcmp(b, nb, l)
ffi.C.g_free(ben)
ffi.C.g_free(nb)