reduce side-effects in snowglobe tests.

should no longer be intermittent.
This commit is contained in:
Enno Rehling 2017-02-05 20:48:44 +01:00
parent 492aba543b
commit de10a8ad65
3 changed files with 5 additions and 11 deletions

2
clibs

@ -1 +1 @@
Subproject commit 27c8b3202b52766465743c3324fc0b52c5ba4b11
Subproject commit f91ef37f08c5244bf616f1836c0aa9caaf36805c

2
cmake

@ -1 +1 @@
Subproject commit d88983c7ff4bc3a4884a7c3f74e8190bac5eab23
Subproject commit f1fb3943ace59994d90d71a891b80033dc2700a2

View File

@ -46,23 +46,17 @@ function test_snowglobe()
local r2 = region.create(1, 0, "ocean")
local f = faction.create("snowglobe2@eressea.de", "human", "de")
local u = unit.create(f, r1, 1)
local have = 6
local fail = 0
u:add_item("snowglobe", have)
local xform = { ocean = "glacier", glacier = "glacier", firewall = "volcano", volcano = "mountain", desert = "plain", plain = "plain" }
u:clear_orders()
u:add_order("BENUTZEN 1 Schneekugel Ost")
local xform = { ocean = "glacier", glacier = "glacier", firewall = "volcano", desert = "plain", volcano = "mountain", plain = "plain" }
for k, v in pairs(xform) do
r2.terrain = k
process_orders()
use_snowglobe(u, 1, "Ost", nil)
assert_equal(v, r2.terrain)
if k~=v then
have=have - 1
else
if k==v then
fail = fail + 1
assert_equal(fail, f:count_msg_type('target_region_invalid'))
end
assert_equal(have, u:get_item("snowglobe"))
end
end