core: Network: misc code cleanups
Change-Id: Idc37b5f834220e8e980958953785806687435f36
Refs: #3858
diff --git a/tests/core/logger.t.cpp b/tests/core/logger.t.cpp
index 07373e5..11dcfa4 100644
--- a/tests/core/logger.t.cpp
+++ b/tests/core/logger.t.cpp
@@ -27,8 +27,8 @@
#include "tests/test-common.hpp"
-#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
+#include <boost/algorithm/string/split.hpp>
namespace nfd {
namespace tests {
diff --git a/tests/core/network.t.cpp b/tests/core/network.t.cpp
index a7af98f..7f9bcd9 100644
--- a/tests/core/network.t.cpp
+++ b/tests/core/network.t.cpp
@@ -147,15 +147,20 @@
BOOST_AUTO_TEST_CASE(IsValidCidr)
{
BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/24"), true);
+ BOOST_CHECK_EQUAL(Network::isValidCidr("192.1.2.3/32"), true);
+ BOOST_CHECK_EQUAL(Network::isValidCidr("0.0.0.0/0"), true);
BOOST_CHECK_EQUAL(Network::isValidCidr(""), false);
+ BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/24/8"), false);
BOOST_CHECK_EQUAL(Network::isValidCidr("/192.0.0.0/24"), false);
BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/+24"), false);
- BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/*24"), false);
+ BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/-24"), false);
+ BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/ 24"), false);
+ BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/24a"), false);
+ BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/0x42"), false);
BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/24.42"), false);
BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/foo"), false);
- BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/24/23"), false);
BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/33"), false);
- BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/-24"), false);
+ //BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/999999999999999"), false); // #3858
BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0/"), false);
BOOST_CHECK_EQUAL(Network::isValidCidr("192.0.0.0"), false);
BOOST_CHECK_EQUAL(Network::isValidCidr("foo/4"), false);