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

Change-Id: I29685dcb9240a3e0c8d7eaf28c8bc2ae720e55a1
diff --git a/tests/mgmt/face-status-publisher-common.hpp b/tests/mgmt/face-status-publisher-common.hpp
index e6ff706..9df73b1 100644
--- a/tests/mgmt/face-status-publisher-common.hpp
+++ b/tests/mgmt/face-status-publisher-common.hpp
@@ -171,7 +171,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;