Browse Source

Tests: PitySwarm - addTestUnit() returns the unit

master
heck 4 years ago
parent
commit
237ab988dd
  1. 5
      src/PitySwarm.cc
  2. 2
      src/PitySwarm.hh

5
src/PitySwarm.cc

@ -68,16 +68,17 @@ namespace pEp {
} }
} }
void PitySwarm::addTestUnit( PityUnit<PityPerspective>* PitySwarm::addTestUnit(
int nodeNr, int nodeNr,
const std::string& name, const std::string& name,
PityUnit<PityPerspective>::TestFunction test_func) PityUnit<PityPerspective>::TestFunction test_func)
{ {
auto 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);
return tmp.get();
} }
void PitySwarm::run() void PitySwarm::run()

2
src/PitySwarm.hh

@ -19,7 +19,7 @@ namespace pEp {
// Constructors // Constructors
PitySwarm(PityModel& model); PitySwarm(PityModel& model);
void addTestUnit( PityUnit<PityPerspective>* addTestUnit(
int nodeNr, int nodeNr,
const std::string& name, const std::string& name,
PityUnit<PityPerspective>::TestFunction test_func); PityUnit<PityPerspective>::TestFunction test_func);

Loading…
Cancel
Save