Accommodate n-Dimensional HR coordinates
refs: #3751
Change-Id: Ib705b671daba56f58e09876a48d8b31649bd7ab1
diff --git a/tests/tlv/test-coordinate-lsa.cpp b/tests/tlv/test-coordinate-lsa.cpp
index f7789c4..fa05d95 100644
--- a/tests/tlv/test-coordinate-lsa.cpp
+++ b/tests/tlv/test-coordinate-lsa.cpp
@@ -24,7 +24,7 @@
#include "../boost-test.hpp"
namespace nlsr {
-namespace tlv {
+namespace tlv {
namespace test {
BOOST_AUTO_TEST_SUITE(TlvTestCoordinateLsa)
@@ -53,7 +53,9 @@
coordinateLsa.setLsaInfo(lsaInfo);
coordinateLsa.setHyperbolicRadius(1.65);
- coordinateLsa.setHyperbolicAngle(1.78);
+ std::vector<double> angles;
+ angles.push_back(1.78);
+ coordinateLsa.setHyperbolicAngle(angles);
const ndn::Block& wire = coordinateLsa.wireEncode();
@@ -73,7 +75,8 @@
BOOST_REQUIRE_EQUAL(coordinateLsa.getLsaInfo().getExpirationPeriod(),
ndn::time::milliseconds(10000));
BOOST_REQUIRE_EQUAL(coordinateLsa.getHyperbolicRadius(), 1.65);
- BOOST_REQUIRE_EQUAL(coordinateLsa.getHyperbolicAngle(), 1.78);
+ std::vector<double> angles = {1.78};
+ BOOST_REQUIRE(coordinateLsa.getHyperbolicAngle() == angles);
}
BOOST_AUTO_TEST_CASE(CoordinateLsaOutputStream)
@@ -87,7 +90,8 @@
coordinateLsa.setLsaInfo(lsaInfo);
coordinateLsa.setHyperbolicRadius(1.65);
- coordinateLsa.setHyperbolicAngle(1.78);
+ std::vector<double> angles = {1.78};
+ coordinateLsa.setHyperbolicAngle(angles);
std::ostringstream os;
os << coordinateLsa;
@@ -97,9 +101,23 @@
"SequenceNumber: 128, "
"ExpirationPeriod: 10000 milliseconds), "
"HyperbolicRadius: 1.65, "
- "HyperbolicAngle: 1.78)");
+ "HyperbolicAngles: 1.78)");
+
+ angles.push_back(3.21);
+ coordinateLsa.setHyperbolicAngle(angles);
+
+ std::ostringstream os2;
+ os2 << coordinateLsa;
+
+ BOOST_CHECK_EQUAL(os2.str(), "CoordinateLsa("
+ "LsaInfo(OriginRouter: /test, "
+ "SequenceNumber: 128, "
+ "ExpirationPeriod: 10000 milliseconds), "
+ "HyperbolicRadius: 1.65, "
+ "HyperbolicAngles: 1.78, 3.21)");
}
+
BOOST_AUTO_TEST_SUITE_END()
} // namespace test