diff test/callback_suite/make-signatures.lua @ 516:1a813b706de4

callback_suite: fixed 'ordered' mode config (was missing first line)
author Tassilo Philipp
date Sun, 10 Apr 2022 22:03:16 +0200
parents 45ac093ca822
children f8856e29b512
line wrap: on
line diff
--- a/test/callback_suite/make-signatures.lua	Sun Apr 10 21:05:33 2022 +0200
+++ b/test/callback_suite/make-signatures.lua	Sun Apr 10 22:03:16 2022 +0200
@@ -12,10 +12,9 @@
 function orderedSignature(x)
   local signature = ""
   local typeindex
-  local nargtypes = string.len(types)
-  while true do
-    if x < nargtypes then break end
-    typeindex = 1 + math.mod(x, nargtypes)
+  local nargtypes = #types
+  while x >= nargtypes do
+    typeindex = 1 + (x % nargtypes)
     signature = signature .. string.sub(types, typeindex, typeindex)
     x = math.floor( x / nargtypes )
   end
@@ -27,7 +26,7 @@
 
 function orderedSignatures()
   local i 
-  for i = 1, ncases do
+  for i = 0, ncases-1 do
     io.write( orderedSignature(offset+i*step) .. "\n" )
   end
 end