mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-12 14:01:15 -04:00
Add Lua test for passing a NaN value
This commit is contained in:
parent
093b562f58
commit
178f216317
@ -344,6 +344,13 @@ testing.registerGlobalTest('load while teleporting - teleport', function()
|
|||||||
landracer:teleport(player.cell, player.position)
|
landracer:teleport(player.cell, player.position)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
testing.registerGlobalTest('nan', function()
|
||||||
|
local nan = 0.0 / 0.0
|
||||||
|
local ok, err = pcall(function() world.setGameTimeScale(nan) end)
|
||||||
|
testing.expectEqual(ok, false)
|
||||||
|
testing.expectEqual(err, 'Value must be a finite number')
|
||||||
|
end)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
engineHandlers = {
|
engineHandlers = {
|
||||||
onUpdate = testing.updateGlobal,
|
onUpdate = testing.updateGlobal,
|
||||||
|
@ -72,6 +72,7 @@ registerGlobalTest('memory limit')
|
|||||||
registerGlobalTest('vfs')
|
registerGlobalTest('vfs')
|
||||||
registerGlobalTest('commit crime')
|
registerGlobalTest('commit crime')
|
||||||
registerGlobalTest('record model property')
|
registerGlobalTest('record model property')
|
||||||
|
registerGlobalTest('nan', 'world.setGameTimeScale should not accept nan')
|
||||||
|
|
||||||
registerGlobalTest('player yaw rotation', 'rotating player with controls.yawChange should change rotation')
|
registerGlobalTest('player yaw rotation', 'rotating player with controls.yawChange should change rotation')
|
||||||
registerGlobalTest('player pitch rotation', 'rotating player with controls.pitchChange should change rotation')
|
registerGlobalTest('player pitch rotation', 'rotating player with controls.pitchChange should change rotation')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user