diff --git a/tests/gui/abstract-tangible-test.cpp b/tests/gui/abstract-tangible-test.cpp index 3d7ce7385..cb4f44944 100644 --- a/tests/gui/abstract-tangible-test.cpp +++ b/tests/gui/abstract-tangible-test.cpp @@ -49,6 +49,7 @@ #include "lib/test/test-helper.hpp" #include "lib/test/event-log.hpp" #include "test/mock-elm.hpp" +#include "test/test-nexus.hpp" #include "lib/idi/entry-id.hpp" #include "lib/error.hpp" //#include "gui/model/session-facade.hpp" @@ -195,10 +196,22 @@ namespace test { CHECK (log.verifyEvent("destroy","dummy") .beforeCall("doMsg").on("foo")); + EventLog nexusLog = gui::test::Nexus::getLog(); + CHECK (nexusLog.verifyEvent("destroy","dummy") + .beforeEvent("dummy successfully zombificated")); + mock.slotExpand(); - cout << "____Event-Log________________\n" + CHECK (nexusLog.verifyEvent("dummy successfully zombificated") + .beforeCall("note").on("ZombieNexus").arg("defunct-dummy", "expand")); + + + cout << "____Event-Log_________________\n" << util::join(mock.getLog(), "\n") << "\n───╼━━━━━━━━━╾────────────────"<identify(), "doMark"); + log_.call (this->identify(), "doMark", mark); cout << this->identify() << " <-- state-mark = "<< string(mark) <("mock-UI")) { } + + // standard copy operations + + + EventLog& + getLog() + { + return log_; + } }; + + /** singleton instance of the [TestNexus] + * used for rigging unit tests */ + lib::Depend testNexus; + /** @@ -114,48 +131,64 @@ namespace test{ : public BusTerm { + EventLog& + log() + { + return testNexus().getLog(); + } + + + /* ==== defunct re-implementation of the BusTerm interface ==== */ virtual void act (GenNode const& command) { - UNIMPLEMENTED("zombie act"); + log().call(this, "act", command); + log().error ("sent command invocation to ZombieNexus"); + cerr << "Command " << string(command) << " -> ZombieNexus" < ZombieNexus" < ZombieNexus" < ZombieNexus" < ZombieNexus" < testNexus; lib::Depend zombieNexus; } // internal details - //NA::~NA() { } - - - /** * @return reference to a node of the test UI bus, @@ -200,6 +228,13 @@ namespace test{ return testNexus(); } + lib::test::EventLog const& + Nexus::getLog() + { + return testNexus().getLog(); + } + + /** * @return a defunct BusTerm with up-link to [ZombieNexus] @@ -210,10 +245,11 @@ namespace test{ { string lateName = doomed.getID().getSym(); doomed.~BusTerm(); -// log_.destroy (lateName); + testNexus().getLog().destroy (lateName); static_assert (sizeof(BusTerm) >= sizeof(ZombieNexus), "Zombie overflow"); new(&doomed) ZombieNexus{lateName, zombieNexus()}; + testNexus().getLog().event(lateName + " successfully zombificated."); } }} // namespace gui::test diff --git a/tests/gui/test/test-nexus.hpp b/tests/gui/test/test-nexus.hpp index 9640ffdc1..28554bdfc 100644 --- a/tests/gui/test/test-nexus.hpp +++ b/tests/gui/test/test-nexus.hpp @@ -45,6 +45,7 @@ #include "lib/error.hpp" //#include "lib/idi/entry-id.hpp" #include "gui/ctrl/bus-term.hpp" +#include "lib/test/event-log.hpp" //#include "lib/util.hpp" //#include "gui/model/tangible.hpp" //#include "lib/diff/record.hpp" @@ -81,6 +82,8 @@ namespace test{ /** kill the given [BusTerm] and implant a dead terminal in place */ static void zombificate(ctrl::BusTerm&); + + static lib::test::EventLog const& getLog(); };