test for building other people's buildings

This commit is contained in:
Enno Rehling 2010-01-18 06:11:46 +00:00
parent 0f59c840c1
commit 4717bae622
2 changed files with 21 additions and 2 deletions

View File

@ -40,7 +40,6 @@ function test_fleeing_units_can_be_transported()
u3:add_item("horse", u2.number) u3:add_item("horse", u2.number)
u3:add_order("KAEMPFE FLIEHE") u3:add_order("KAEMPFE FLIEHE")
process_orders() process_orders()
write_reports()
assert_equal(u3.region.id, r1.id, "transporter did not move") assert_equal(u3.region.id, r1.id, "transporter did not move")
assert_equal(u2.region.id, r1.id, "transported unit did not move") assert_equal(u2.region.id, r1.id, "transported unit did not move")
end end
@ -546,3 +545,24 @@ function test_storage()
assert(u) assert(u)
assert(u:get_item("money") == u.number * 100) assert(u:get_item("money") == u.number * 100)
end end
function test_building_other()
local r = region.create(0,0, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")
local f2 = faction.create("noreply@eressea.de", "human", "de")
local b = building.create(r, "castle")
b.size = 10
local u1 = unit.create(f1, r, 3)
u1.building = b
u1:add_item("money", 100)
local u2 = unit.create(f2, r, 3)
u2:set_skill("building", 10)
u2:add_item("money", 100)
u2:add_item("stone", 100)
u2:clear_orders()
u2:add_order("MACHEN BURG " .. itoa36(b.id))
update_owners()
process_orders()
assert_not_equal(10, b.size)
end

View File

@ -372,7 +372,6 @@ function test_canoe_passes_through_land()
assert_equal(u2.region.id, land.id, "canoe did not stop at coast") assert_equal(u2.region.id, land.id, "canoe did not stop at coast")
u1:add_order("NACH O O O") u1:add_order("NACH O O O")
process_orders() process_orders()
write_reports()
assert_equal(u2.region.id, dst.id, "canoe could not leave coast") assert_equal(u2.region.id, dst.id, "canoe could not leave coast")
end end