Add tons of new loggings
diff --git a/test/test-dispatcher.cc b/test/test-dispatcher.cc
index 6378cb2..e3918f8 100644
--- a/test/test-dispatcher.cc
+++ b/test/test-dispatcher.cc
@@ -20,6 +20,7 @@
*/
#include "ccnx-wrapper.h"
+#include "logging.h"
#include "dispatcher.h"
#include <boost/test/unit_test.hpp>
#include <boost/make_shared.hpp>
@@ -32,6 +33,8 @@
using namespace boost;
namespace fs = boost::filesystem;
+INIT_LOGGER ("Test.Dispatcher");
+
BOOST_AUTO_TEST_SUITE(DispatcherTest)
@@ -50,35 +53,35 @@
BOOST_AUTO_TEST_CASE(TestDispatcher)
{
- fs::path dir1("test-white-house");
- fs::path dir2("test-black-house");
+ INIT_LOGGERS ();
- string user1 = "/obama";
+ fs::path dir1("./TestDispatcher/test-white-house");
+ fs::path dir2("./TestDispatcher/test-black-house");
+
+ string user1 = "/obamaa";
string user2 = "/romney";
string folder = "who-is-president";
CcnxWrapperPtr ccnx1 = make_shared<CcnxWrapper>();
- usleep(1000);
+ usleep(100);
CcnxWrapperPtr ccnx2 = make_shared<CcnxWrapper>();
- usleep(1000);
+ usleep(100);
cleanDir(dir1);
cleanDir(dir2);
- fs::create_directory(dir1);
- fs::create_directory(dir2);
-
Dispatcher d1(user1, folder, dir1, ccnx1, 2, false);
- usleep(1000);
+ usleep(100);
Dispatcher d2(user2, folder, dir2, ccnx2, 2, false);
- sleep(1);
+ usleep(1000000);
+ _LOG_DEBUG ("checking obama vs romney");
checkRoots(d1.SyncRoot(), d2.SyncRoot());
fs::path filename("a_letter_to_romney.txt");
- string words = "I'm the new socialist President. You are not.";
+ string words = "I'm the new socialist President. You are not!";
fs::path abf = dir1 / filename;
@@ -98,8 +101,8 @@
HashPtr fileHash2 = Hash::FromFileContent(ef);
BOOST_CHECK_EQUAL(*fileHash1, *fileHash2);
- cleanDir(dir1);
- cleanDir(dir2);
+ // cleanDir(dir1);
+ // cleanDir(dir2);
}
BOOST_AUTO_TEST_SUITE_END()
diff --git a/test/test-sync-core.cc b/test/test-sync-core.cc
index d18d4d4..f38dab7 100644
--- a/test/test-sync-core.cc
+++ b/test/test-sync-core.cc
@@ -10,7 +10,7 @@
using namespace boost;
using namespace boost::filesystem;
-INIT_LOGGER("Test.Sync.Core");
+INIT_LOGGER("Test.SyncCore");
BOOST_AUTO_TEST_SUITE(SyncCoreTests)
@@ -64,7 +64,8 @@
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);
- usleep(1000000);
+
+ sleep(1);
checkRoots(core1->root(), core2->root());
// _LOG_TRACE ("\n\n\n\n\n\n----------\n");