failing test for newly discovered storage problems

This commit is contained in:
Enno Rehling 2015-11-04 09:48:51 +01:00
parent dedbd67d07
commit c57668e6ee
2 changed files with 4 additions and 2 deletions

View File

@ -25,6 +25,9 @@ function test_store_unit()
store = storage.create(filename, "rb") store = storage.create(filename, "rb")
assert_not_nil(store) assert_not_nil(store)
u = store:read_unit() u = store:read_unit()
assert_not_nil(u)
assert_equal(r, u.region)
assert_equal(f, u.faction)
store:close() store:close()
os.remove(filename) os.remove(filename)
assert_not_nil(u) assert_not_nil(u)

View File

@ -613,8 +613,7 @@ unit *read_unit(struct gamedata *data)
++u->faction->no_units; ++u->faction->no_units;
} }
else { else {
log_error("unit %s has faction == NULL\n", unitname(u)); log_error("unit %s has faction == NULL\n", itoa36(u->no));
assert(u->faction);
return 0; return 0;
} }