diff --git a/test/pitytest11/src/PityTransport.cc b/test/pitytest11/src/PityTransport.cc index e323169..5bf5b75 100644 --- a/test/pitytest11/src/PityTransport.cc +++ b/test/pitytest11/src/PityTransport.cc @@ -4,13 +4,13 @@ #include #include #include -#include +#include namespace pEp { namespace PityTest11 { bool PityTransport::debug_log_enabled = false; - PityTransport::PityTransport(const std::string& inboxDir, Endpoints& endpoints) : + PityTransport::PityTransport(std::string inboxDir, Endpoints& endpoints) : _inboxDir{ inboxDir }, _endpoints{ endpoints } { } diff --git a/test/pitytest11/src/PityTransport.hh b/test/pitytest11/src/PityTransport.hh index 130b298..b0f4cd4 100644 --- a/test/pitytest11/src/PityTransport.hh +++ b/test/pitytest11/src/PityTransport.hh @@ -12,13 +12,13 @@ namespace pEp { namespace PityTest11 { // Address - Dir - using Endpoints = std::unordered_map; + using Endpoints = std::unordered_map; class PityTransport { public: // Constructors PityTransport() = delete; - PityTransport(const std::string& inboxDir, Endpoints& endpoints); + explicit PityTransport(std::string inboxDir, Endpoints& endpoints); // Getters //Transport @@ -29,7 +29,7 @@ namespace pEp { //internal logging static bool debug_log_enabled; - Adapter::pEpLog::pEpLogger logger_debug{ "PityModel", debug_log_enabled }; + Adapter::pEpLog::pEpLogger logger_debug{ "PityTransport", debug_log_enabled }; private: std::string _inboxDir; diff --git a/test/pitytest11/src/PityUnit.hh b/test/pitytest11/src/PityUnit.hh index 5703428..9fe6ced 100644 --- a/test/pitytest11/src/PityUnit.hh +++ b/test/pitytest11/src/PityUnit.hh @@ -6,12 +6,12 @@ #include "../../../src/pEpLog.hh" #include "../../../src/std_utils.hh" +#include "fs_mutex.hh" +#include "PityTransport.hh" #include #include #include -#include "fs_mutex.hh" -#include "PityTransport.hh" -//#include "PityModel.hh" +#include // Yes, the mem mgmt is purely static on purpose (so far) diff --git a/test/pitytest11/src/PityUnit.hxx b/test/pitytest11/src/PityUnit.hxx index 5451fee..2e24ee1 100644 --- a/test/pitytest11/src/PityUnit.hxx +++ b/test/pitytest11/src/PityUnit.hxx @@ -14,7 +14,7 @@ #include #include #include -#include +#include //using namespace pEp::Adapter::pEpLog; @@ -475,7 +475,7 @@ namespace pEp { void PityUnit::createTransport() { registerAsTransportEndpoint(); - _transport = std::shared_ptr(transportDir(), transportEndpoints()); + _transport = std::make_shared(transportDir(), transportEndpoints()); } // Inherited (if null see parent recursively) diff --git a/test/pitytest11/test/test_redesign.cc b/test/pitytest11/test/test_redesign.cc index bb22a99..050e2aa 100644 --- a/test/pitytest11/test/test_redesign.cc +++ b/test/pitytest11/test/test_redesign.cc @@ -22,12 +22,12 @@ void test_node1(PityUnit& unit,PityModel* model, PityPerspective* psp unit.transport()->sendMsg(peer.first,msg); Utils::sleep_millis(throttle); } -// -// while (model->hasMsg()) { -// unit.log("MSG RX:" + model->receiveMsg()); -// Utils::sleep_millis(throttle); -// } -// } + + while (unit.transport()->hasMsg()) { + unit.log("MSG RX:" + unit.transport()->receiveMsg()); + Utils::sleep_millis(throttle); + } + } } int main(int argc, char* argv[]) @@ -35,6 +35,7 @@ int main(int argc, char* argv[]) // debug log per class PityModel::debug_log_enabled = false; PityNode::debug_log_enabled = false; + PityTransport::debug_log_enabled = false; PityUnit<>::debug_log_enabled = false; // Create model with 3 nodes