mirror of
https://github.com/minetest/minetest.git
synced 2024-09-19 23:10:46 +03:00
Fix unittest.
This commit is contained in:
parent
db14002ea3
commit
e2f8bb9697
@ -85,8 +85,9 @@ local function hp_diference_test(player, hp_max)
|
||||
assert(die_counter == 1)
|
||||
|
||||
-- Integer overflow is prevented
|
||||
expected_diff = -2147483648 -- S32_MIN
|
||||
player:set_hp(-3000000000)
|
||||
-- so result is S32_MIN, not S32_MIN - 22
|
||||
expected_diff = -2147483648
|
||||
player:set_hp(-2147483648)
|
||||
-- actual final HP value is clamped to >= 0
|
||||
assert(player:get_hp() == 0)
|
||||
assert(hpchange_counter == 3)
|
||||
|
Loading…
Reference in New Issue
Block a user