From: Jiri Vlasak Date: Fri, 2 Aug 2019 11:22:39 +0000 (+0200) Subject: Add reverse border ut X-Git-Tag: v0.3.0~1^2~2 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hubacji1/bcar.git/commitdiff_plain/38b67edbafb0c4a68263e564baf88998d0b1e524 Add reverse border ut --- diff --git a/ut/pslot.t.cc b/ut/pslot.t.cc index eac542d..99a5dc0 100644 --- a/ut/pslot.t.cc +++ b/ut/pslot.t.cc @@ -9,7 +9,27 @@ WVTEST_MAIN("pslot basic geometry") ps.set_slot(0.5, 1.5, M_PI/4, sqrt(2), sqrt(8)); // slot info + WVPASSEQ_DOUBLE(ps.x1(), 1, 0.00001); + WVPASSEQ_DOUBLE(ps.y1(), 1, 0.00001); + WVPASSEQ_DOUBLE(ps.x2(), 3, 0.00001); + WVPASSEQ_DOUBLE(ps.y2(), 3, 0.00001); + WVPASSEQ_DOUBLE(ps.x3(), 2, 0.00001); + WVPASSEQ_DOUBLE(ps.y3(), 4, 0.00001); + WVPASSEQ_DOUBLE(ps.x4(), 0, 0.00001); + WVPASSEQ_DOUBLE(ps.y4(), 2, 0.00001); WVPASS(ps.right()); WVPASS(!ps.parallel()); WVPASSEQ_DOUBLE(ps.heading(), M_PI * 3 / 4, 0.00001); + ps.reverse_border(); + WVPASSEQ_DOUBLE(ps.x1(), 0, 0.00001); + WVPASSEQ_DOUBLE(ps.y1(), 2, 0.00001); + WVPASSEQ_DOUBLE(ps.x2(), 2, 0.00001); + WVPASSEQ_DOUBLE(ps.y2(), 4, 0.00001); + WVPASSEQ_DOUBLE(ps.x3(), 3, 0.00001); + WVPASSEQ_DOUBLE(ps.y3(), 3, 0.00001); + WVPASSEQ_DOUBLE(ps.x4(), 1, 0.00001); + WVPASSEQ_DOUBLE(ps.y4(), 1, 0.00001); + WVPASS(!ps.right()); + WVPASS(!ps.parallel()); + WVPASSEQ_DOUBLE(ps.heading(), -M_PI / 4, 0.00001); }