2023-08-04 10:59:08 -06:00
|
|
|
config.target = 'core'
|
2023-08-04 00:54:14 -06:00
|
|
|
|
2020-03-20 08:41:58 -06:00
|
|
|
function test.overlappingGlobals()
|
|
|
|
local globals = {}
|
2023-08-04 02:35:51 -06:00
|
|
|
for name in pairs(df.global) do
|
2020-03-20 08:41:58 -06:00
|
|
|
local gvar = df.global:_field(name)
|
|
|
|
local size, addr = gvar:sizeof()
|
|
|
|
table.insert(globals, {
|
|
|
|
name = name,
|
|
|
|
first = addr,
|
|
|
|
last = addr + size - 1
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
table.sort(globals, function(a, b)
|
|
|
|
return a.first < b.first
|
|
|
|
end)
|
|
|
|
|
|
|
|
for i = 2, #globals do
|
|
|
|
local prev = globals[i - 1]
|
|
|
|
local cur = globals[i]
|
|
|
|
|
2020-03-27 00:01:03 -06:00
|
|
|
expect.lt(prev.last, cur.first, "global variable " .. prev.name .. " overlaps global variable " .. cur.name)
|
2020-03-20 08:41:58 -06:00
|
|
|
end
|
|
|
|
end
|
2020-03-22 22:49:08 -06:00
|
|
|
|
|
|
|
function test.viewscreenDtors()
|
|
|
|
for name, type in pairs(df) do
|
|
|
|
if name:startswith('viewscreen') then
|
|
|
|
print('testing', name)
|
2023-08-04 21:40:24 -06:00
|
|
|
local v = type:new()
|
2020-03-22 22:49:08 -06:00
|
|
|
expect.true_(v:delete(), "destructor returned false: " .. name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|