src: Check validity of FaceURIs while loading conf

refs: #2070

Change-Id: I2278ab0a6367910495208a48c801f3af83bd43ec
diff --git a/tests/test-conf-file-processor.cpp b/tests/test-conf-file-processor.cpp
index 25d1433..ab24215 100644
--- a/tests/test-conf-file-processor.cpp
+++ b/tests/test-conf-file-processor.cpp
@@ -333,6 +333,27 @@
   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_SUITE_END()
 
 } //namespace test
-} //namespace nlsr
\ No newline at end of file
+} //namespace nlsr