diff --git a/test/pitytest11/src/AbstractPityUnit.cc b/test/pitytest11/src/AbstractPityUnit.cc index bfcef7d..b737e47 100644 --- a/test/pitytest11/src/AbstractPityUnit.cc +++ b/test/pitytest11/src/AbstractPityUnit.cc @@ -42,8 +42,8 @@ namespace pEp { { _procUnitNr = rhs._procUnitNr; _exec_mode = rhs._exec_mode; - _transport = rhs._transport; - _transport_endpoints = rhs._transport_endpoints; + _transport = rhs._transport; // Will re-initialized in run() + _transport_endpoints = rhs._transport_endpoints; // Will re-initialized in run() _init(); } @@ -75,6 +75,10 @@ namespace pEp { return AbstractPityUnit::_global_root_dir; } + void AbstractPityUnit::setExecMode(AbstractPityUnit::ExecutionMode execMode) + { + _exec_mode = execMode; + } // For: // RootUnit - "" @@ -412,7 +416,7 @@ namespace pEp { std::string AbstractPityUnit::_status_string(const std::string &msg) const { std::string ret; - ret = "[ " + to_string(_exec_mode) + ":" + std::to_string(getpid()) + " ] [ " + + ret = "[ " + to_string(_exec_mode) + ": " + std::to_string(getpid()) + " ] [ " + getPathShort() + " ] [ " + msg + " ]"; return ret; } diff --git a/test/pitytest11/src/AbstractPityUnit.hh b/test/pitytest11/src/AbstractPityUnit.hh index 66199d1..335593c 100644 --- a/test/pitytest11/src/AbstractPityUnit.hh +++ b/test/pitytest11/src/AbstractPityUnit.hh @@ -53,6 +53,7 @@ namespace pEp { // Read-Write static void setGlobalRootDir(const std::string& dir); static std::string getGlobalRootDir(); + void setExecMode(ExecutionMode execMode); // Read-Only std::string getPathShort() const; @@ -113,13 +114,14 @@ namespace pEp { // Fields // ------ static std::string _global_root_dir; - int _procUnitNr; ExecutionMode _exec_mode; + int _procUnitNr; static int _procUnitsCount; // will be increased in every constructor + // transport std::shared_ptr _transport; //only ever read via transport() // TODO move endpoints into PityTransport - Endpoints _transport_endpoints; // only ever access via transportEndpoints() + Endpoints _transport_endpoints; // only ever access via transportEndpoints() // fs-mutex to sync across processes std::shared_ptr _log_mutex = nullptr;