build: Enabling -Werror in debug mode and fixing discovered issues

Change-Id: I29685dcb9240a3e0c8d7eaf28c8bc2ae720e55a1
diff --git a/tests/mgmt/fib-enumeration-publisher-common.hpp b/tests/mgmt/fib-enumeration-publisher-common.hpp
index 076a036..25bf215 100644
--- a/tests/mgmt/fib-enumeration-publisher-common.hpp
+++ b/tests/mgmt/fib-enumeration-publisher-common.hpp
@@ -155,7 +155,7 @@
 
     m_buffer.appendByteArray(payload.value(), payload.value_size());
 
-    uint64_t segmentNo = data.getName()[-1].toSegment();
+    BOOST_CHECK_NO_THROW(data.getName()[-1].toSegment());
     if (data.getFinalBlockId() != data.getName()[-1])
       {
         return;