Some checks failed
release / linux/x86_64 (pull_request) Failing after 1m54s
release / freebsd/x86_64 (pull_request) Successful in 5m1s
release / linux/aarch64 (pull_request) Failing after 1m54s
release / linux/armv7 (pull_request) Failing after 2m12s
release / linux/i686 (pull_request) Failing after 1m59s
release / android (pull_request) Successful in 2m54s
release / windows/i686 (pull_request) Successful in 2m3s
release / windows/x86_64 (pull_request) Successful in 2m15s
36 lines
935 B
Lua
36 lines
935 B
Lua
-- 08b: model sub-objects (meshes[i], materials[i], shader views) are views:
|
|
-- reading them must not arm anything, and the model owns the release.
|
|
local M = dofile("tests/helpers.lua")
|
|
local R = M.load()
|
|
|
|
if not M.window(64, 64) then
|
|
M.skip("08b_views", "no window")
|
|
return
|
|
end
|
|
|
|
M.reset()
|
|
|
|
local mesh = R.GenMeshCube(1, 1, 1)
|
|
local model = R.LoadModelFromMesh(mesh)
|
|
mesh = nil
|
|
M.eq(model.meshCount, 1, "model has one mesh")
|
|
M.eq(model.materialCount, 1, "model has one material")
|
|
|
|
local b = M.snapshot()
|
|
|
|
local m1 = model.meshes[0]
|
|
local mat1 = model.materials[0]
|
|
local probe = m1.vertexCount + mat1.shader.id
|
|
M.ok(m1.vertexCount > 0, "mesh view is readable (probe=" .. probe .. ")")
|
|
|
|
m1, mat1 = nil, nil
|
|
M.gc(3)
|
|
M.eq(M.delta(b, "armed"), 0, "views never arm")
|
|
|
|
R.UnloadModel(model)
|
|
M.ok(M.delta(b, "released") >= 1, "model released")
|
|
M.eq(M.delta(b, "errors"), 0, "no finalizer errors")
|
|
model = nil
|
|
M.gc(2)
|
|
|
|
print("ok 08b_views")
|