mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
f846d4ab91
- 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
47 lines
1.7 KiB
Lua
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
|