Fix one of the tests

This commit is contained in:
R.E.J. Wellner 2020-04-28 16:56:11 +02:00
parent caf972ca80
commit b7cc46f4bf

View File

@ -302,7 +302,13 @@ describe("bitser", function()
it("can read and write cdata", function()
-- a simple value
test_serdeser(ffi.new('double', 42.5))
local value = ffi.new('struct some_struct { int a; double b; }', 42, 1.25)
ffi.cdef[[
struct some_struct {
int a;
double b;
};
]]
local value = ffi.new('struct some_struct', 42, 1.25)
local type_of_struct = ffi.typeof(value)
-- with a registered type
bitser.register('struct_type', type_of_struct)