summaryrefslogtreecommitdiff
path: root/test/test-network.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-05-12 00:23:42 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2025-05-12 00:23:42 +0100
commitb3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd (patch)
tree2f136cb121ef5aa5a78267ccbfa220ca87b56aac /test/test-network.cpp
parentSplit definition creation from link creation (diff)
downloadilt-b3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd.tar.bz2
ilt-b3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd.tar.xz
ilt-b3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd.zip
Split link generation definitions according to terrain
Copies the same imperfect logic from old link addition functions.
Diffstat (limited to 'test/test-network.cpp')
-rw-r--r--test/test-network.cpp54
1 files changed, 30 insertions, 24 deletions
diff --git a/test/test-network.cpp b/test/test-network.cpp
index e6b92f3..05e995e 100644
--- a/test/test-network.cpp
+++ b/test/test-network.cpp
@@ -269,10 +269,11 @@ BOOST_DATA_TEST_CASE(GenCurveDefs,
BOOST_AUTO_TEST_CASE(NetworkCreateStraight)
{
- const auto link = create(CreationDefinition {
- .fromEnd = {.position = {0, 0, 0}, .direction = {}},
- .toEnd = {.position = {0, 1000, 0}, .direction = {}},
- });
+ const auto link = create(nullptr,
+ CreationDefinition {
+ .fromEnd = {.position = {0, 0, 0}, .direction = {}},
+ .toEnd = {.position = {0, 1000, 0}, .direction = {}},
+ });
BOOST_REQUIRE_EQUAL(link.size(), 1);
BOOST_CHECK(links.empty());
BOOST_CHECK(nodes.empty());
@@ -290,10 +291,11 @@ BOOST_AUTO_TEST_CASE(NetworkCreateStraight)
BOOST_AUTO_TEST_CASE(NetworkCreateExtendingCurve)
{
- const auto link = create(CreationDefinition {
- .fromEnd = {.position = {0, 0, 0}, .direction = half_pi},
- .toEnd = {.position = {0, 1000, 0}, .direction = {}},
- });
+ const auto link = create(nullptr,
+ CreationDefinition {
+ .fromEnd = {.position = {0, 0, 0}, .direction = half_pi},
+ .toEnd = {.position = {0, 1000, 0}, .direction = {}},
+ });
BOOST_REQUIRE_EQUAL(link.size(), 1);
BOOST_CHECK(links.empty());
BOOST_CHECK(nodes.empty());
@@ -315,10 +317,11 @@ BOOST_AUTO_TEST_CASE(NetworkCreateExtendingCurve)
BOOST_AUTO_TEST_CASE(NetworkCreateExtendeeCurve)
{
- const auto link = create(CreationDefinition {
- .fromEnd = {.position = {0, 0, 0}, .direction = {}},
- .toEnd = {.position = {0, 1000, 0}, .direction = half_pi},
- });
+ const auto link = create(nullptr,
+ CreationDefinition {
+ .fromEnd = {.position = {0, 0, 0}, .direction = {}},
+ .toEnd = {.position = {0, 1000, 0}, .direction = half_pi},
+ });
BOOST_REQUIRE_EQUAL(link.size(), 1);
BOOST_CHECK(links.empty());
BOOST_CHECK(nodes.empty());
@@ -343,10 +346,11 @@ BOOST_AUTO_TEST_CASE(NetworkCreateExtendeeCurve)
BOOST_AUTO_TEST_CASE(NetworkCreateBiarcPair)
{
- const auto link = create(CreationDefinition {
- .fromEnd = {.position = {0, 0, 0}, .direction = pi},
- .toEnd = {.position = {1000, 1000, 0}, .direction = 0},
- });
+ const auto link = create(nullptr,
+ CreationDefinition {
+ .fromEnd = {.position = {0, 0, 0}, .direction = pi},
+ .toEnd = {.position = {1000, 1000, 0}, .direction = 0},
+ });
BOOST_REQUIRE_EQUAL(link.size(), 2);
BOOST_CHECK(links.empty());
BOOST_CHECK(nodes.empty());
@@ -382,10 +386,11 @@ BOOST_AUTO_TEST_CASE(NetworkCreateBiarcPair)
BOOST_AUTO_TEST_CASE(NetworkCreateBiarcPairEqTan)
{
// This could be achieved with a single curve, but not there yet
- const auto link = create(CreationDefinition {
- .fromEnd = {.position = {0, 0, 0}, .direction = 0},
- .toEnd = {.position = {1000, 0, 0}, .direction = 0},
- });
+ const auto link = create(nullptr,
+ CreationDefinition {
+ .fromEnd = {.position = {0, 0, 0}, .direction = 0},
+ .toEnd = {.position = {1000, 0, 0}, .direction = 0},
+ });
BOOST_REQUIRE_EQUAL(link.size(), 2);
BOOST_CHECK(links.empty());
BOOST_CHECK(nodes.empty());
@@ -402,10 +407,11 @@ BOOST_AUTO_TEST_CASE(NetworkCreateBiarcPairEqTan)
BOOST_AUTO_TEST_CASE(NetworkCreateBiarcPairEqTanPerp)
{
// This creates an equal pair of semi-circle arcs
- const auto link = create(CreationDefinition {
- .fromEnd = {.position = {0, 0, 0}, .direction = 0},
- .toEnd = {.position = {1000, 0, 0}, .direction = pi},
- });
+ const auto link = create(nullptr,
+ CreationDefinition {
+ .fromEnd = {.position = {0, 0, 0}, .direction = 0},
+ .toEnd = {.position = {1000, 0, 0}, .direction = pi},
+ });
BOOST_REQUIRE_EQUAL(link.size(), 2);
BOOST_CHECK(links.empty());
BOOST_CHECK(nodes.empty());