mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
09d0ace4b6
- finished audio module - finished data module - finished filesystem module - finished font module (note: glphy test fails, but seems to be a 12.0 issue) - finished image module - finished maths module - finished sound module - finished thread module - finished video module - fixed pcall error not showing in results for invalid test code
43 lines
1.7 KiB
Lua
43 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:assertEquals(false, video:isPlaying(), 'check not playing by def')
|
|
-- check playing and pausing
|
|
video:play()
|
|
test:assertEquals(true, video:isPlaying(), 'check now playing')
|
|
video:seek(0.3)
|
|
test:assertEquals(0.3, video:tell(), 'check seek/tell')
|
|
video:rewind()
|
|
test:assertEquals(0, video:tell(), 'check rewind')
|
|
video:pause()
|
|
test:assertEquals(false, 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
|