From 2dcf29c335a5380da92866bcd610bb5285793b00 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Wed, 24 Jul 2019 07:53:28 +0200 Subject: [PATCH] Add test for inside function --- ut/psp.t.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ut/psp.t.cc b/ut/psp.t.cc index 5674806..13bfde7 100644 --- a/ut/psp.t.cc +++ b/ut/psp.t.cc @@ -24,6 +24,16 @@ WVTEST_MAIN("parallel parking slot planner") WVPASS(psp.forward()); WVPASSEQ_DOUBLE(psp.ps().heading(), psp.gc().h(), 0.00001); WVPASS(psp.parked()); + std::vector> slot; + slot.push_back(std::make_tuple(psp.ps().x1(), psp.ps().y1())); + slot.push_back(std::make_tuple(psp.ps().x2(), psp.ps().y2())); + slot.push_back(std::make_tuple(psp.ps().x3(), psp.ps().y3())); + slot.push_back(std::make_tuple(psp.ps().x4(), psp.ps().y4())); + WVPASS(inside(psp.gc().x(), psp.gc().y(), slot)); + WVPASS(inside(psp.gc().lfx(), psp.gc().lfy(), slot)); + WVPASS(inside(psp.gc().lrx(), psp.gc().lry(), slot)); + WVPASS(inside(psp.gc().rrx(), psp.gc().rry(), slot)); + WVPASS(inside(psp.gc().rfx(), psp.gc().rfy(), slot)); // entry point found by reverse WVPASS(!psp.left()); -- 2.39.2