Browse Source

Tests: PityTest - PityUnit change constructor semantics (parent)

LIB-11
heck 11 months ago
parent
commit
0946f32ef7
2 changed files with 27 additions and 10 deletions
  1. +7
    -1
      test/pitytest11/src/PityUnit.hh
  2. +20
    -9
      test/pitytest11/src/PityUnit.hxx

+ 7
- 1
test/pitytest11/src/PityUnit.hh View File

@ -28,7 +28,13 @@ namespace pEp {
// Constructors are private
PityUnit() = delete;
explicit PityUnit<TestContext>(
AbstractPityUnit* const parent,
const std::string& name,
TestFunction test_func = nullptr,
TestContext* perspective = nullptr,
ExecutionMode exec_mode = ExecutionMode::FUNCTION);
explicit PityUnit<TestContext>(
AbstractPityUnit& parent,
const std::string& name,
TestFunction test_func = nullptr,
TestContext* perspective = nullptr,


+ 20
- 9
test/pitytest11/src/PityUnit.hxx View File

@ -20,14 +20,25 @@
namespace pEp {
namespace PityTest11 {
// CONSTRUCTOR
template<class TestContext>
PityUnit<TestContext>::PityUnit(
AbstractPityUnit *const parent,
const std::string &name,
TestFunction test_func,
TestContext *perspective,
ExecutionMode exec_mode) :
template<class TestContext>
PityUnit<TestContext>::PityUnit(
const std::string &name,
TestFunction test_func,
TestContext *perspective,
ExecutionMode exec_mode) :
AbstractPityUnit(name, exec_mode),
_perspective{ perspective }, _test_func{ test_func }
{
}
template<class TestContext>
PityUnit<TestContext>::PityUnit(
AbstractPityUnit &parent,
const std::string &name,
TestFunction test_func,
TestContext *perspective,
ExecutionMode exec_mode) :
AbstractPityUnit(parent, name, exec_mode),
_perspective{ perspective }, _test_func{ test_func }
{
@ -59,7 +70,7 @@ namespace pEp {
if (_perspective != nullptr) {
ret = _perspective;
} else {
if (!_isRootUnit()) {
if (!isRoot()) {
ret = (dynamic_cast<PityUnit<TestContext> *>(getParent()))->getPerspective();
}
}


Loading…
Cancel
Save