From 66d4605d825c55c64f13a6547192ebb9c64ca2d8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 13 Mar 2021 19:21:14 +0000 Subject: Simplified TestLink extending LinkStraight --- test/test-network.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/test/test-network.cpp b/test/test-network.cpp index 1228e81..e5a2074 100644 --- a/test/test-network.cpp +++ b/test/test-network.cpp @@ -9,7 +9,6 @@ #include #include // IWYU pragma: keep #include -#include #include #include #include @@ -17,13 +16,8 @@ #include #include -struct TestLink : public Link { - TestLink(NodePtr a, NodePtr b, float ad, float bd, float l) : Link {{std::move(a), ad}, {std::move(b), bd}, l} { } - [[nodiscard]] Location - positionAt(float, unsigned char) const override - { - throw std::runtime_error("not implemented"); - } +struct TestLink : public LinkStraight { + TestLink(NodePtr a, NodePtr b, float l) : Link {{std::move(a), 0}, {std::move(b), pi}, l} { } }; constexpr glm::vec3 p000 {0, 0, 0}, p100 {1, 0, 0}, p200 {2, 0, 0}, p300 {3, 0, 0}; @@ -38,12 +32,12 @@ struct TestNetwork : public NetworkOf { // \ 5 / // 3 | 4 // \-> p101 <-/ - addLink(p000, p100, 0.F, pi, 1.F); - addLink(p100, p200, 0.F, pi, 1.F); - addLink(p200, p300, 0.F, pi, 1.F); - addLink(p000, p101, 0.F, pi, 2.F); - addLink(p200, p101, 0.F, pi, 2.F); - addLink(p100, p101, 0.F, pi, 1.F); + addLink(p000, p100, 1.F); + addLink(p100, p200, 1.F); + addLink(p200, p300, 1.F); + addLink(p000, p101, 2.F); + addLink(p200, p101, 2.F); + addLink(p100, p101, 1.F); } }; -- cgit v1.2.3