From c57668e6ee97fc2f0afd40a71dca3d622baf9bfb Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 4 Nov 2015 09:48:51 +0100 Subject: [PATCH] failing test for newly discovered storage problems --- scripts/tests/storage.lua | 3 +++ src/kernel/save.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/tests/storage.lua b/scripts/tests/storage.lua index 065cca57c..0aa0b45f7 100644 --- a/scripts/tests/storage.lua +++ b/scripts/tests/storage.lua @@ -25,6 +25,9 @@ function test_store_unit() store = storage.create(filename, "rb") assert_not_nil(store) u = store:read_unit() + assert_not_nil(u) + assert_equal(r, u.region) + assert_equal(f, u.faction) store:close() os.remove(filename) assert_not_nil(u) diff --git a/src/kernel/save.c b/src/kernel/save.c index 505120e32..3111c09e5 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -613,8 +613,7 @@ unit *read_unit(struct gamedata *data) ++u->faction->no_units; } else { - log_error("unit %s has faction == NULL\n", unitname(u)); - assert(u->faction); + log_error("unit %s has faction == NULL\n", itoa36(u->no)); return 0; }