Browse Source

Tests: PityTest - PitySwarm update constructor semantics

master
heck 4 years ago
parent
commit
5f3e151816
  1. 7
      src/PitySwarm.cc

7
src/PitySwarm.cc

@ -43,7 +43,7 @@ namespace pEp {
int PitySwarm::_init_process(PityUnit<PityPerspective>& unit, PityPerspective* ctx) int PitySwarm::_init_process(PityUnit<PityPerspective>& unit, PityPerspective* ctx)
{ {
std::cout << "Node init, setting $HOME" << std::endl; std::cout << "Node _init, setting $HOME" << std::endl;
std::string home = unit.processDir(); std::string home = unit.processDir();
setenv("HOME", home.c_str(), true); setenv("HOME", home.c_str(), true);
return 0; return 0;
@ -61,7 +61,6 @@ namespace pEp {
// Construct Tree // Construct Tree
_rootUnit = std::make_shared<PityUnit<PityPerspective>>( _rootUnit = std::make_shared<PityUnit<PityPerspective>>(
nullptr,
_model.getName(), _model.getName(),
nullptr, nullptr,
nullptr); nullptr);
@ -69,7 +68,7 @@ namespace pEp {
for (auto n : _model.nodes()) { for (auto n : _model.nodes()) {
auto tmp = std::make_shared<PityUnit<PityPerspective>>( auto tmp = std::make_shared<PityUnit<PityPerspective>>(
_rootUnit.get(), *_rootUnit.get(),
n->getName(), n->getName(),
std::bind(&PitySwarm::_init_process,this, std::placeholders::_1, std::placeholders::_2), std::bind(&PitySwarm::_init_process,this, std::placeholders::_1, std::placeholders::_2),
_perspectives.at(n->getNr()).get(), _perspectives.at(n->getNr()).get(),
@ -85,7 +84,7 @@ namespace pEp {
PityUnit<PityPerspective>::TestFunction test_func) PityUnit<PityPerspective>::TestFunction test_func)
{ {
std::shared_ptr<PityUnit<PityPerspective>> tmp = std::make_shared<PityUnit<PityPerspective>>( std::shared_ptr<PityUnit<PityPerspective>> tmp = std::make_shared<PityUnit<PityPerspective>>(
_nodeUnits.at(nodeNr).get(), *_nodeUnits.at(nodeNr).get(),
name, name,
test_func); test_func);
_testUnits.push_back(tmp); _testUnits.push_back(tmp);

Loading…
Cancel
Save