tests: use BOOST_REQUIRE and Name::at() to prevent out-of-bound accesses

Various other cleanups

Change-Id: Ie099e618b12b7b6cf36c32be96d753221f14a8b6
diff --git a/tests/test-state.cpp b/tests/test-state.cpp
index 6d7239c..3f04c8b 100644
--- a/tests/test-state.cpp
+++ b/tests/test-state.cpp
@@ -19,8 +19,8 @@
 
 #include "PSync/detail/state.hpp"
 
-#include <boost/test/unit_test.hpp>
-#include <ndn-cxx/name.hpp>
+#include "tests/boost-test.hpp"
+
 #include <ndn-cxx/data.hpp>
 
 namespace psync {
@@ -90,4 +90,4 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-} // namespace psync
\ No newline at end of file
+} // namespace psync