mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
more tests
- added custom error handler so that love is closed if a crash occurs rather than hang on the graphic screen (for runner crashes mainly)
- updated missing functions left todo in todo.md and removed list from readme.md to make it easier to keep track of
- added love.audio.getPlaybackDevice(), love.audio.getPlaybackDevices(), love.audio.setPlaybackDevice()
- added love.data.ByteData:setString()
- added love.filesystem.getFullCommonPath(), love.filesystem.mountFullPath(), love.filesystem.unmountFullPath(), love.filesystem.moundCommonPath(), plus optional b/t/bt params to love.filesystem.load()
- added love.keyboard.isModifierActive()
- added love.sound.SoundData:copy() and love.sound.SoundData:slice()
- added love.graphics.Texture:isCanvas() and love.graphics.Texture:isComputeWritable()
- added love.image.ImageData:isLinear(), love.image.ImageData:setLinear(), and love.image.ImageData:encode("*.exr")
- added love.image.CompressedImageData:isLinear() and love.image.CompressedImageData:setLinear()
- added love.system.getPreferredLocales()
- added love.window.focus() and removed love.window.close() (now deprecated)
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
-- love.window.focus
|
||||
love.test.window.focus = function(test)
|
||||
-- cant test as doesnt return anything
|
||||
test:assertEquals('function', type(love.window.focus), 'check method exists')
|
||||
end
|
||||
|
||||
|
||||
-- love.window.fromPixels
|
||||
love.test.window.fromPixels = function(test)
|
||||
-- check dpi/pixel ratio as expected
|
||||
@@ -352,18 +359,3 @@ love.test.window.updateMode = function(test)
|
||||
resizable = true
|
||||
})
|
||||
end
|
||||
|
||||
-- love.window.close
|
||||
-- calling love.window.close() last as it will stop the main test image drawing
|
||||
love.test.window.z_close = function(test)
|
||||
-- closing window should cause graphics to not be active
|
||||
love.window.close()
|
||||
local active = love.graphics.isActive()
|
||||
test:assertFalse(active, 'check window not active')
|
||||
-- should also mark the window as not open and not visible
|
||||
test:assertFalse(love.window.isOpen(), 'check window closed')
|
||||
test:assertFalse(love.window.isVisible(), 'check window not visible')
|
||||
love.window.updateMode(360, 240) -- reset
|
||||
active = love.graphics.isActive()
|
||||
test:assertTrue(active, 'check window active again')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user