view test/call_suite/rand-sig.lua @ 48:dc0bcee2c847

bugfix: value and control-group arrays need to be max-arg size + 1 (... futher cleanup is needed as index 0 in array is not used at all ;-/ )
author Daniel Adler <dadler@dyncall.org>
date Sat, 19 Dec 2015 23:04:42 +0000
parents 3e629dc19168
children 1cb8a65ea27f
line wrap: on
line source

require"config"

rtypes   = "v"..types

math.randomseed(2342)
local sigs = { }
local id
for i = 1, ncases do
  id = math.random(#rtypes)
  local nargs = math.random(minargs,maxargs)
  local sig   = { rtypes:sub(id,id)}
  for j = 1, nargs do
    id = math.random(#types)
    sig[#sig+1] = types:sub(id,id)
  end
  io.write(table.concat(sig))
  io.write("\n")
end