From 83769d40eac4547dbac74ff0830dd31e1ca62203 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 24 Sep 2009 19:18:45 +0000 Subject: [PATCH] custom build steps for lua scripts test for planes/normalization. --- src/eressea.vcproj | 36 ++++++++++++++++++++++++++++++++++++ src/eressea/editor.vcproj | 8 -------- src/scripts/tests.lua | 19 +++++++++++++++++++ 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/src/eressea.vcproj b/src/eressea.vcproj index 043e134a7..9ca64273e 100644 --- a/src/eressea.vcproj +++ b/src/eressea.vcproj @@ -254,18 +254,54 @@ + + + + + + + + + + + + diff --git a/src/eressea/editor.vcproj b/src/eressea/editor.vcproj index e00453916..265aa2cac 100644 --- a/src/eressea/editor.vcproj +++ b/src/eressea/editor.vcproj @@ -233,14 +233,6 @@ > - - - - diff --git a/src/scripts/tests.lua b/src/scripts/tests.lua index 0a3090d45..b97972169 100644 --- a/src/scripts/tests.lua +++ b/src/scripts/tests.lua @@ -1,3 +1,20 @@ +local function test_plane() + free_game() + local pl = plane.create(0, -3, -3, 7, 7) + local nx, ny = plane.normalize(pl, 4, 4) + assert(nx==-3 and ny==-3) + local f = faction.create("noreply@eressea.de", "human", "de") + f.id = atoi36("tpla") + local r, x, y + for x = -3, 3 do for y = -3, 3 do + r = region.create(x, y, "plain") + if (x==y) then + local u = unit.create(f, r, 1) + end + end end + write_reports() +end + local function test_rename() free_game() local r = region.create(0, 0, "plain") @@ -760,11 +777,13 @@ tests = { ["morale"] = test_morale, ["owners"] = test_owners, ["canoe"] = test_canoe, + ["plane"] = test_plane, ["guard"] = test_guard, ["market"] = test_market } mytests = { ["guard"] = test_guard, + ["plane"] = test_plane, ["owners"] = test_owners } fail = 0