re-enable report tests.

RF_LIGHTHOUSE also flags for lighthouses with size 0.
This commit is contained in:
Enno Rehling 2016-09-18 10:24:08 +02:00
parent a5d44f9638
commit ac8332c896
5 changed files with 31 additions and 30 deletions

View File

@ -25,4 +25,4 @@ cd $ROOT
inifile inifile
s/runtests s/runtests
# integraton_tests integraton_tests

View File

@ -8,7 +8,7 @@ require 'tests.e2.spells'
require 'tests.e2.stealth' require 'tests.e2.stealth'
require 'tests.orders' require 'tests.orders'
require 'tests.common' require 'tests.common'
-- require 'tests.report' require 'tests.report'
require 'tests.storage' require 'tests.storage'
require 'tests.magicbag' require 'tests.magicbag'
require 'tests.process' require 'tests.process'

View File

@ -23,7 +23,7 @@ local function assert_file(filename)
os.remove(filename) os.remove(filename)
end end
function disable_test_process_turn() function test_process_turn()
u:add_order("NUMMER PARTEI 777") u:add_order("NUMMER PARTEI 777")
process_orders() process_orders()
assert_equal(0, init_reports()) assert_equal(0, init_reports())

View File

@ -26,13 +26,13 @@ const attrib_type at_lighthouse = {
*/ */
void update_lighthouse(building * lh) void update_lighthouse(building * lh)
{ {
if (lh->size>0 && is_building_type(lh->type, "lighthouse")) { if (is_building_type(lh->type, "lighthouse")) {
region *r = lh->region; region *r = lh->region;
int d = (int)log10(lh->size) + 1;
int x;
r->flags |= RF_LIGHTHOUSE; r->flags |= RF_LIGHTHOUSE;
if (lh->size > 0) {
int d = (int)log10(lh->size) + 1;
int x;
for (x = -d; x <= d; ++x) { for (x = -d; x <= d; ++x) {
int y; int y;
for (y = -d; y <= d; ++y) { for (y = -d; y <= d; ++y) {
@ -61,6 +61,7 @@ void update_lighthouse(building * lh)
} }
} }
} }
}
int lighthouse_range(const building * b, const faction * f) int lighthouse_range(const building * b, const faction * f)
{ {

View File

@ -65,7 +65,7 @@ static void test_lighthouse_update(CuTest * tc)
r2 = test_create_region(1, 0, t_ocean); r2 = test_create_region(1, 0, t_ocean);
r3 = test_create_region(2, 0, t_ocean); r3 = test_create_region(2, 0, t_ocean);
b = test_create_building(r1, test_create_buildingtype("lighthouse")); b = test_create_building(r1, test_create_buildingtype("lighthouse"));
CuAssertIntEquals(tc, 0, r1->flags&RF_LIGHTHOUSE); CuAssertIntEquals(tc, RF_LIGHTHOUSE, r1->flags&RF_LIGHTHOUSE);
CuAssertPtrEquals(tc, NULL, r1->attribs); CuAssertPtrEquals(tc, NULL, r1->attribs);
CuAssertPtrEquals(tc, NULL, r2->attribs); CuAssertPtrEquals(tc, NULL, r2->attribs);
CuAssertPtrEquals(tc, NULL, r3->attribs); CuAssertPtrEquals(tc, NULL, r3->attribs);