src: Check validity of FaceURIs while loading conf

refs: #2070

Change-Id: I2278ab0a6367910495208a48c801f3af83bd43ec
This commit is contained in:
alvy authored and Vince Lehman committed 2014-12-02 11:11:21 -06:00
1 parent bfa2760c57
commit 2fe12879bd
2 files changed
+32 -2

No files matched your search

+22 -1
View File
@@ -333,6 +333,27 @@ BOOST_AUTO_TEST_CASE(Log4cxxTestCase)
verifyOutputLog4cxx(EXPECTED, sizeof(EXPECTED) / sizeof(std::string));
}
BOOST_AUTO_TEST_CASE(MalformedUri)
{
const std::string MALFORMED_URI =
"neighbors\n"
"{\n"
" hello-retries 3\n"
" hello-timeout 1\n"
" hello-interval 60\n\n"
" adj-lsa-build-interval 3\n"
" first-hello-interval 6\n"
" neighbor\n"
" {\n"
" name /ndn/memphis.edu/cs/castor\n"
" face-uri udp4:malformed-uri\n"
" link-cost 20\n"
" }\n"
"}\n\n";
BOOST_CHECK_EQUAL(processConfigurationString(MALFORMED_URI), false);
}
BOOST_AUTO_TEST_CASE(Hyperbolic)
{
processConfigurationString(CONFIG_HYPERBOLIC);
@@ -393,4 +414,4 @@ BOOST_AUTO_TEST_CASE(OutOfRangeValue)
BOOST_AUTO_TEST_SUITE_END()
} //namespace test
} //namespace nlsr
} //namespace nlsr