forked from github/server
re-enable report tests.
RF_LIGHTHOUSE also flags for lighthouses with size 0.
This commit is contained in:
parent
a5d44f9638
commit
ac8332c896
|
@ -25,4 +25,4 @@ cd $ROOT
|
|||
inifile
|
||||
s/runtests
|
||||
|
||||
# integraton_tests
|
||||
integraton_tests
|
||||
|
|
|
@ -8,7 +8,7 @@ require 'tests.e2.spells'
|
|||
require 'tests.e2.stealth'
|
||||
require 'tests.orders'
|
||||
require 'tests.common'
|
||||
-- require 'tests.report'
|
||||
require 'tests.report'
|
||||
require 'tests.storage'
|
||||
require 'tests.magicbag'
|
||||
require 'tests.process'
|
||||
|
|
|
@ -23,7 +23,7 @@ local function assert_file(filename)
|
|||
os.remove(filename)
|
||||
end
|
||||
|
||||
function disable_test_process_turn()
|
||||
function test_process_turn()
|
||||
u:add_order("NUMMER PARTEI 777")
|
||||
process_orders()
|
||||
assert_equal(0, init_reports())
|
||||
|
|
|
@ -26,13 +26,13 @@ const attrib_type at_lighthouse = {
|
|||
*/
|
||||
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;
|
||||
int d = (int)log10(lh->size) + 1;
|
||||
int x;
|
||||
|
||||
r->flags |= RF_LIGHTHOUSE;
|
||||
|
||||
if (lh->size > 0) {
|
||||
int d = (int)log10(lh->size) + 1;
|
||||
int x;
|
||||
for (x = -d; x <= d; ++x) {
|
||||
int y;
|
||||
for (y = -d; y <= d; ++y) {
|
||||
|
@ -60,6 +60,7 @@ void update_lighthouse(building * lh)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int lighthouse_range(const building * b, const faction * f)
|
||||
|
|
|
@ -65,7 +65,7 @@ static void test_lighthouse_update(CuTest * tc)
|
|||
r2 = test_create_region(1, 0, t_ocean);
|
||||
r3 = test_create_region(2, 0, t_ocean);
|
||||
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, r2->attribs);
|
||||
CuAssertPtrEquals(tc, NULL, r3->attribs);
|
||||
|
|
Loading…
Reference in New Issue