diff --git a/se/eressea.vpj b/se/eressea.vpj index 8f9b39b6c..78271d8af 100644 --- a/se/eressea.vpj +++ b/se/eressea.vpj @@ -246,6 +246,7 @@ + @@ -403,6 +404,7 @@ + diff --git a/se/tests.vpj b/se/tests.vpj index 9f4e1362e..f40c0151c 100644 --- a/se/tests.vpj +++ b/se/tests.vpj @@ -246,6 +246,7 @@ + diff --git a/src/kernel/jsonconf.c b/src/kernel/jsonconf.c index a73936afd..7ed042666 100644 --- a/src/kernel/jsonconf.c +++ b/src/kernel/jsonconf.c @@ -106,8 +106,9 @@ static void json_maintenance_i(cJSON *json, maintenance *mt) { mt->flags = json_flags(child, flags); } else { - log_error_n("maintenance contains unknown attribute %s", child->string); + log_error_n("maintenance contains unknown array %s", child->string); } + break; default: log_error_n("maintenance contains unknown attribute %s", child->string); } diff --git a/tests/init.lua b/tests/init.lua index 2d10882db..f286cbcf7 100644 --- a/tests/init.lua +++ b/tests/init.lua @@ -8,3 +8,4 @@ require "tests.castles" require "tests.spells" require "tests.movement" require "tests.ships" +require "tests.pool" diff --git a/tests/pool.lua b/tests/pool.lua new file mode 100644 index 000000000..01f62420f --- /dev/null +++ b/tests/pool.lua @@ -0,0 +1,38 @@ +require "lunit" + +module("tests.eressea.pool", package.seeall, lunit.testcase ) + +function setup() + eressea.free_game() + eressea.config.reset(); + eressea.settings.set("rules.economy.food", "0") + eressea.settings.set("nmr.removenewbie", "0") + eressea.settings.set("nmr.timeout", "0") + conf = [[{ + "races": { + "human" : {} + }, + "terrains" : { + "plain": { "flags" : [ "land" ] } + }, + "keywords" : { + "de" : { + "give" : "GIB" + } + } + }]] + + assert(eressea.config.parse(conf)==0) +end + +function test_give_nopool() + local r = region.create(1, 1, "plain") + local f = faction.create("test@example.com", "human", "de") + local u1 = unit.create(f, r, 1) + local u2 = unit.create(f, r, 1) + u1:add_item("money", 100) + u1:add_order("GIB " .. itoa36(u2.id) .. " 100 SILBER") + process_orders() + assert_equal(0, u1:get_item("money")) + assert_equal(100, u2:get_item("money")) +end