From 87ed5be3d05af0344e5e27568adff9eb72ee0b0d Mon Sep 17 00:00:00 2001 From: heck Date: Sat, 3 Jul 2021 20:00:49 +0200 Subject: [PATCH] Test: PityTest - Units return int --- test/pitytest11/src/PityUnit.hh | 5 ++++- test/pitytest11/src/PityUnit.hxx | 13 +++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/test/pitytest11/src/PityUnit.hh b/test/pitytest11/src/PityUnit.hh index d5f3488..7faffe3 100644 --- a/test/pitytest11/src/PityUnit.hh +++ b/test/pitytest11/src/PityUnit.hh @@ -22,7 +22,10 @@ namespace pEp { template class PityUnit { public: - using TestFunction = const std::function&, TestContext*)>; + // Test success if TestFunction: + // * does not throw + // * returns 0 + using TestFunction = const std::function&, TestContext*)>; enum class ExecutionMode { FUNCTION, diff --git a/test/pitytest11/src/PityUnit.hxx b/test/pitytest11/src/PityUnit.hxx index 2e6af92..6f9d271 100644 --- a/test/pitytest11/src/PityUnit.hxx +++ b/test/pitytest11/src/PityUnit.hxx @@ -142,12 +142,6 @@ namespace pEp { } } - // template - // void PityUnit::setExecutionMode(ExecutionMode mode) - // { - // _exec_mode = mode; - // } - // static template void PityUnit::setGlobalRootDir(const std::string &dir) @@ -166,9 +160,11 @@ namespace pEp { void PityUnit::run() { pEpLogClass("called"); - _log_mutex = std::make_shared("fds"); + _log_mutex = std::make_shared("log.mutex"); _log_mutex->release(); + setenv("HOME", processDir().c_str(), true); + if (_isRootUnit()) { _init(); } @@ -320,7 +316,6 @@ namespace pEp { logH3("INIT DONE"); } - template void PityUnit::_run() { @@ -442,7 +437,6 @@ namespace pEp { } } - // Inherited (if null see parent recursively) template TestContext *PityUnit::getPerspective() const @@ -508,7 +502,6 @@ namespace pEp { return ret; } - template Utils::Color PityUnit::_colForProcUnitNr(int procUnitNr) const {