debug logging did not help. nothing unusual here, just weirdly intermittent.

This commit is contained in:
Enno Rehling 2018-10-12 20:46:48 +02:00
parent 88f0504f48
commit 772386ffc7
1 changed files with 3 additions and 7 deletions

View File

@ -34,22 +34,18 @@ function test_build_watch()
local u = unit.create(f, r, 1)
u.number = 20
u:add_item("log", 20)
u:add_item("log", 30)
u.id = 42
u:set_skill("building", 1)
u:add_order("MACHE Wache")
process_orders()
assert_not_nil(u.building)
if 5 ~= u.building.size then
-- debug logging to find intermittent errors
for k,v in ipairs(f.messages) do
print(v)
end
end
-- stage two needs skill 2, this unit can only build a first stage:
assert_equal(5, u.building.size)
u:set_skill("building", 2)
u:clear_orders()
u:add_order("MACHE Wache " .. itoa36(u.building.id))
process_orders()
assert_not_nil(u.building)