Test: PityTest - PityUnit add copy assign operator

LIB-11
heck 2 years ago
parent 0baa54c330
commit a2c5b542f2

@ -25,7 +25,7 @@ namespace pEp {
// * returns 0
using TestFunction = std::function<int(PityUnit<TestContext>&, TestContext*)>;
// Constructors are private
// Constructors
PityUnit() = delete;
explicit PityUnit<TestContext>(
const std::string& name,
@ -41,6 +41,11 @@ namespace pEp {
ExecutionMode exec_mode = ExecutionMode::FUNCTION);
PityUnit<TestContext>(const PityUnit<TestContext> &rhs);
// copy-assign
PityUnit<TestContext>& operator=(const PityUnit<TestContext>& rhs);
// clone
PityUnit<TestContext> *clone() override;
// Read-Only

@ -54,6 +54,14 @@ namespace pEp {
_test_func = rhs._test_func;
}
template<class TestContext>
PityUnit<TestContext> &PityUnit<TestContext>::operator=(const PityUnit<TestContext> &rhs)
{
_perspective = rhs._perspective;
_test_func = rhs._test_func;
return *this;
}
template<class TestContext>
PityUnit<TestContext> *PityUnit<TestContext>::clone()
{

Loading…
Cancel
Save