Files
love/testing/tests/video.lua
T
ell f846d4ab91 review changes
- spaced out object class tests and added more defined comment groups

- changed reusing vars in case it causes unexpected asserts in future

- fixed some shape:point test having wrong params

- added assertTrue + assertFalse for basic checks

- used assertRange more for some of the physics + audio tests
2023-11-23 12:52:54 +00:00

47 lines
1.7 KiB
Lua

-- love.video
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------------OBJECTS---------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- VideoStream (love.thread.newVideoStream)
love.test.video.VideoStream = function(test)
-- create obj
local video = love.video.newVideoStream('resources/sample.ogv')
test:assertObject(video)
-- check def properties
test:assertEquals('resources/sample.ogv', video:getFilename(), 'check filename')
test:assertFalse(video:isPlaying(), 'check not playing by def')
-- check playing and pausing states
video:play()
test:assertTrue(video:isPlaying(), 'check now playing')
video:seek(0.3)
test:assertRange(video:tell(), 0.3, 0.4, 'check seek/tell')
video:rewind()
test:assertEquals(0, video:tell(), 'check rewind')
video:pause()
test:assertFalse(video:isPlaying(), 'check paused')
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------------METHODS---------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- love.video.newVideoStream
-- @NOTE this is just basic nil checking, objs have their own test method
love.test.video.newVideoStream = function(test)
test:assertObject(love.video.newVideoStream('resources/sample.ogv'))
end