Update style to (almost) conform to ndn-cxx style using clang-format
diff --git a/tests/unit-tests/sync-core.t.cpp b/tests/unit-tests/sync-core.t.cpp
index bfdaec2..0d55fd1 100644
--- a/tests/unit-tests/sync-core.t.cpp
+++ b/tests/unit-tests/sync-core.t.cpp
@@ -17,13 +17,12 @@
*
* See AUTHORS.md for complete list of ChronoShare authors and contributors.
*/
-
-#include "sync-core.hpp"
#include "logging.hpp"
+#include "sync-core.hpp"
-#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
#include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
using namespace std;
using namespace Ndnx;
@@ -34,25 +33,25 @@
BOOST_AUTO_TEST_SUITE(SyncCoreTests)
-void callback(const SyncStateMsgPtr &msg)
+void
+callback(const SyncStateMsgPtr& msg)
{
BOOST_CHECK(msg->state_size() > 0);
int size = msg->state_size();
int index = 0;
- while (index < size)
- {
+ while (index < size) {
SyncState state = msg->state(index);
BOOST_CHECK(state.has_old_seq());
BOOST_CHECK(state.old_seq() >= 0);
- if (state.seq() != 0)
- {
+ if (state.seq() != 0) {
BOOST_CHECK(state.old_seq() != state.seq());
}
index++;
}
}
-void checkRoots(const HashPtr &root1, const HashPtr &root2)
+void
+checkRoots(const HashPtr& root1, const HashPtr& root2)
{
BOOST_CHECK_EQUAL(*root1, *root2);
}
@@ -64,8 +63,7 @@
string dir = "./SyncCoreTest";
// clean the test dir
path d(dir);
- if (exists(d))
- {
+ if (exists(d)) {
remove_all(d);
}
@@ -81,9 +79,9 @@
SyncLogPtr log1(new SyncLog(dir1, user1.toString()));
SyncLogPtr log2(new SyncLog(dir2, user2.toString()));
- SyncCore *core1 = new SyncCore(log1, user1, loc1, syncPrefix, bind(callback, _1), c1);
+ SyncCore* core1 = new SyncCore(log1, user1, loc1, syncPrefix, bind(callback, _1), c1);
usleep(10000);
- SyncCore *core2 = new SyncCore(log2, user2, loc2, syncPrefix, bind(callback, _1), c2);
+ SyncCore* core2 = new SyncCore(log2, user2, loc2, syncPrefix, bind(callback, _1), c2);
sleep(1);
checkRoots(core1->root(), core2->root());
@@ -94,23 +92,23 @@
usleep(100000);
checkRoots(core1->root(), core2->root());
BOOST_CHECK_EQUAL(core2->seq(user1), 1);
- BOOST_CHECK_EQUAL(log2->LookupLocator (user1), loc1);
+ BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
core1->updateLocalState(5);
usleep(100000);
checkRoots(core1->root(), core2->root());
BOOST_CHECK_EQUAL(core2->seq(user1), 5);
- BOOST_CHECK_EQUAL(log2->LookupLocator (user1), loc1);
+ BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
core2->updateLocalState(10);
usleep(100000);
checkRoots(core1->root(), core2->root());
BOOST_CHECK_EQUAL(core1->seq(user2), 10);
- BOOST_CHECK_EQUAL(log1->LookupLocator (user2), loc2);
+ BOOST_CHECK_EQUAL(log1->LookupLocator(user2), loc2);
// simple simultaneous data generation
// _LOG_TRACE ("\n\n\n\n\n\n----------Simultaneous\n");
- _LOG_TRACE ("Simultaneous");
+ _LOG_TRACE("Simultaneous");
core1->updateLocalState(11);
usleep(100);
@@ -120,14 +118,13 @@
BOOST_CHECK_EQUAL(core1->seq(user2), 15);
BOOST_CHECK_EQUAL(core2->seq(user1), 11);
- BOOST_CHECK_EQUAL(log1->LookupLocator (user1), loc1);
- BOOST_CHECK_EQUAL(log1->LookupLocator (user2), loc2);
- BOOST_CHECK_EQUAL(log2->LookupLocator (user1), loc1);
- BOOST_CHECK_EQUAL(log2->LookupLocator (user2), loc2);
+ BOOST_CHECK_EQUAL(log1->LookupLocator(user1), loc1);
+ BOOST_CHECK_EQUAL(log1->LookupLocator(user2), loc2);
+ BOOST_CHECK_EQUAL(log2->LookupLocator(user1), loc1);
+ BOOST_CHECK_EQUAL(log2->LookupLocator(user2), loc2);
// clean the test dir
- if (exists(d))
- {
+ if (exists(d)) {
remove_all(d);
}
}