summaryrefslogtreecommitdiff
path: root/test/plugins/ffi/parser.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/plugins/ffi/parser.lua')
-rw-r--r--test/plugins/ffi/parser.lua30
1 files changed, 28 insertions, 2 deletions
diff --git a/test/plugins/ffi/parser.lua b/test/plugins/ffi/parser.lua
index 983b64c3..6d7f2cea 100644
--- a/test/plugins/ffi/parser.lua
+++ b/test/plugins/ffi/parser.lua
@@ -5,20 +5,46 @@ rawset(_G, 'TEST', true)
local ctypes = require 'plugins.ffi.c-parser.ctypes'
ctypes.TESTMODE = true
+--TODO expand all singlenode
function TEST(wanted, full)
return function (script)
local rrr = cdriver.process_context(script .. "$EOF$")
assert(rrr)
if full then
for i, v in ipairs(rrr) do
- assert(utility.equal(v, wanted[i]))
+ assert(utility.equal(v, wanted[i]), utility.dump(v))
end
else
- assert(utility.equal(rrr[1], wanted))
+ assert(utility.equal(rrr[1], wanted), utility.dump(rrr[1]))
end
end
end
+TEST {
+ name = "struct@A",
+ type = {
+ fields = {
+ {
+ isarray = true,
+ name = "a",
+ type = { "int", },
+ },
+ {
+ isarray = true,
+ name = "b",
+ type = { "int", },
+ },
+ },
+ name = "A",
+ type = "struct",
+ },
+}
+ [[
+ struct A {
+ int a[5];
+ int b[];
+ };
+]]
TEST {
name = 'union@a',