gcc fix, disable test properly

TBD:plane.watchers
This commit is contained in:
Enno Rehling 2016-02-18 08:11:39 +01:00
parent 9f62e74a37
commit 57085ea47b
3 changed files with 5 additions and 4 deletions

View File

@ -1309,6 +1309,7 @@ void writefaction(struct gamedata *data, const faction * f)
ally *sf; ally *sf;
ursprung *ur; ursprung *ur;
assert(f->_alive);
write_faction_reference(f, data->store); write_faction_reference(f, data->store);
WRITE_INT(data->store, f->subscription); WRITE_INT(data->store, f->subscription);
#if RELEASE_VERSION >= SPELL_LEVEL_VERSION #if RELEASE_VERSION >= SPELL_LEVEL_VERSION

View File

@ -6,6 +6,7 @@
#include "group.h" #include "group.h"
#include "ally.h" #include "ally.h"
#include "faction.h" #include "faction.h"
#include "plane.h"
#include "region.h" #include "region.h"
#include "version.h" #include "version.h"
#include <triggers/changefaction.h> #include <triggers/changefaction.h>
@ -113,12 +114,10 @@ static void test_readwrite_dead_faction_regionowner(CuTest *tc) {
faction *f; faction *f;
region *r; region *r;
unit * u; unit * u;
int fno;
test_cleanup(); test_cleanup();
config_set("rules.region_owners", "1"); config_set("rules.region_owners", "1");
f = test_create_faction(0); f = test_create_faction(0);
fno = f->no;
u = test_create_unit(f, r = test_create_region(0, 0, 0)); u = test_create_unit(f, r = test_create_region(0, 0, 0));
region_set_owner(r, f, turn); region_set_owner(r, f, turn);
destroyfaction(&factions); destroyfaction(&factions);
@ -204,6 +203,6 @@ CuSuite *get_save_suite(void)
SUITE_ADD_TEST(suite, test_readwrite_dead_faction_createunit); SUITE_ADD_TEST(suite, test_readwrite_dead_faction_createunit);
SUITE_ADD_TEST(suite, test_readwrite_dead_faction_changefaction); SUITE_ADD_TEST(suite, test_readwrite_dead_faction_changefaction);
SUITE_ADD_TEST(suite, test_readwrite_dead_faction_regionowner); SUITE_ADD_TEST(suite, test_readwrite_dead_faction_regionowner);
// SUITE_ADD_TEST(suite, test_readwrite_dead_faction_group); DISABLE_TEST(suite, test_readwrite_dead_faction_group);
return suite; return suite;
} }

View File

@ -5,6 +5,7 @@
#include "prefix.h" #include "prefix.h"
#include <kernel/config.h> #include <kernel/config.h>
#include <kernel/plane.h>
#include <kernel/region.h> #include <kernel/region.h>
#include <kernel/terrain.h> #include <kernel/terrain.h>
#include <kernel/item.h> #include <kernel/item.h>
@ -47,7 +48,7 @@ struct region *test_create_region(int x, int y, const terrain_type *terrain)
{ {
region *r = findregion(x, y); region *r = findregion(x, y);
if (!r) { if (!r) {
r = new_region(x, y, NULL, 0); r = new_region(x, y, findplane(x, y), 0);
} }
if (!terrain) { if (!terrain) {
terrain_type *t = get_or_create_terrain("plain"); terrain_type *t = get_or_create_terrain("plain");