From 9dd2e3d2325da7b9e1c6c41f3dfb86341b00c899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 30 Oct 2015 14:04:04 +0100 Subject: tests: check LOS is ok when dst is blocked --- core/test/ch/asynk/rustanddust/LineOfSightTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/test/ch/asynk/rustanddust/LineOfSightTest.java b/core/test/ch/asynk/rustanddust/LineOfSightTest.java index 2722c45..fce9605 100644 --- a/core/test/ch/asynk/rustanddust/LineOfSightTest.java +++ b/core/test/ch/asynk/rustanddust/LineOfSightTest.java @@ -1450,6 +1450,14 @@ public class LineOfSightTest checkNode(s, 3, to.col, to.row); block(blockB.col, blockB.row, false); + // block to + block(to.col, to.row, true); + s = lineOfSight(from.col, from.row, to.col, to.row); + assertTrue(s.size() == 4); + checkNode(s, 0, from.col, from.row); + checkNode(s, 3, to.col, to.row); + block(to.col, to.row, false); + // block A and B block(blockA.col, blockA.row, true); block(blockB.col, blockB.row, true); @@ -1482,6 +1490,14 @@ public class LineOfSightTest checkNode(s, 3, from.col, from.row); block(blockB.col, blockB.row, false); + // block from + block(from.col, from.row, true); + s = lineOfSight(from.col, from.row, to.col, to.row); + assertTrue(s.size() == 4); + checkNode(s, 0, from.col, from.row); + checkNode(s, 3, to.col, to.row); + block(from.col, from.row, false); + // block A and B block(blockA.col, blockA.row, true); block(blockB.col, blockB.row, true); -- cgit v1.1-2-g2b99