Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/lapi/debug_torture_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ local function TestOneInput(buf)
local n_hook_mask = fdp:consume_integer(0, #hook_mask)
local mask = {}
for _ = 0, n_hook_mask do
table.insert(mask, fdp:oneof(hook_mask))
local m = fdp:oneof(hook_mask)
table.insert(mask, m)
end

-- Turn on the hook.
Expand Down
6 changes: 5 additions & 1 deletion tests/lapi/os_time_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ local function TestOneInput(buf)
local err_handler = test_lib.err_handler(ignored_msgs)
local ok, res = xpcall(os.time, err_handler, time)
if not ok then return end
assert(type(res) == "number" or type(res) == "table")
io.stderr:write(type(res) .. "\n")
assert(type(res) == "number" or
type(res) == "table" or
-- Undocumented.
res == nil)
end

local args = {
Expand Down
9 changes: 8 additions & 1 deletion tests/lapi/string_pack_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ if not test_lib.lua_current_version_ge_than(5, 3) then
os.exit(0)
end

local ignored_msgs = {
"invalid format option",
}

local function TestOneInput(buf, _size)
local fdp = luzer.FuzzedDataProvider(buf)
os.setlocale(test_lib.random_locale(fdp), "all")
Expand All @@ -26,7 +30,10 @@ local function TestOneInput(buf, _size)
end
local n = fdp:consume_integer(1, test_lib.MAX_INT)
local values = fdp:consume_strings(test_lib.MAX_STR_LEN, n)
string.pack(fmt_str, table.unpack(values))
local err_handler = test_lib.err_handler(ignored_msgs)
local ok, _ = xpcall(string.pack, err_handler, fmt_str,
table.unpack(values))
if not ok then return end
end

local args = {
Expand Down
8 changes: 7 additions & 1 deletion tests/lapi/utf8_offset_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ if test_lib.lua_current_version_lt_than(5, 3) then
os.exit()
end

local ignored_msgs = {
"initial position is a continuation byte",
}

local function TestOneInput(buf)
local fdp = luzer.FuzzedDataProvider(buf)
local max_len = fdp:consume_integer(0, MAX_INT)
local s = fdp:consume_string(max_len)
local n = fdp:consume_integer(MIN_INT, MAX_INT)
local i = fdp:consume_integer(1, MAX_INT)
os.setlocale(test_lib.random_locale(fdp), "all")
utf8.offset(s, n, i)
local err_handler = test_lib.err_handler(ignored_msgs)
local ok, _ = xpcall(utf8.offset, err_handler, s, n, i)
if not ok then return end
end

local args = {
Expand Down