basic BusTerm lifecycle unit test PASS

This commit is contained in:
Fischlurch 2016-01-03 05:32:05 +01:00
parent 286a051088
commit 96ba1fc2d0
3 changed files with 14 additions and 14 deletions

View file

@ -26,22 +26,16 @@
#include "test/mock-elm.hpp"
#include "lib/idi/entry-id.hpp"
#include "lib/diff/gen-node.hpp"
//#include "gui/model/diagnostics.hpp"
//#include "lib/util.hpp"
//#include <boost/lexical_cast.hpp>
#include <iostream>
//#include <string>
//#include <map>
using lib::idi::EntryID;
using lib::idi::BareEntryID;
using gui::test::MockElm;
using lib::diff::GenNode;
//using boost::lexical_cast;
//using util::contains;
//using std::string;
using std::cout;
using std::endl;
@ -75,7 +69,7 @@ namespace test {
* - cast messages and error states downstream
* - generic operating of interface states
* - detaching on element destruction
*
*
* @see AbstractTangible_test
* @see gui::model::Tangible
* @see gui::ctrl::BusTerm
@ -145,14 +139,14 @@ namespace test {
CHECK (elmLog.verifyCall("doFlash").on("zeitgeist"));
// kill the zeitgeist and verify disconnection
// kill the zeitgeist and verify disconnectedness
mock.kill();
CHECK (elmLog.verifyEvent("destroy","zeitgeist"));
CHECK (nexusLog.verifyCall("routeDetach").on("TestNexus").arg(elmID)
.beforeEvent("TestNexus", "removed route to bID-zeitgeist"));
gui::test::Nexus::testUI().mark (elmID, GenNode("Flash", 88));
CHECK (nexusLog.verify("remove route to bID-zeitgeist")
CHECK (nexusLog.verify("removed route to bID-zeitgeist")
.beforeCall("mark").on("TestNexus").arg(elmID, "Flash")
.beforeEvent("warn","discarding mark to unknown bID-zeitgeist"));
CHECK (elmLog.ensureNot("Flash")

View file

@ -236,7 +236,7 @@ namespace test{
log_.destroy (getID().getSym());
Nexus::zombificate (this->uiBus_);
log_.event ("successfully connected to zombie bus");
log_.event (string(getID()) + " successfully connected to zombie bus");
}

View file

@ -28,9 +28,17 @@
** features through the [front-end](\ref gui::test::TestNexus), while the
** actual implementation instances are placed [as singletons](depend.hpp)
**
** @todo initial draft and WIP-WIP-WIP as of 11/2015
** This test setup will mostly treat messages similar to the [real UI-Bus hub](nexus.hpp),
** with additional [logging](\ref event-log.hpp). Since the TestNexus runs as singleton,
** there is a single shared "nexus-log", which can be [accessed](test::Nexus::getLog) or
** even [cleared](test::Nexus::startNewLog) through the [static front-end](test::Nexus).
** But there is no connection to any [core services](\ref core-service.hpp), so neither
** commands nor state marks will be processed in any way. In case the unit tests need to
** integrate with or verify these handling operations, we provide the ability to install
** custom handler functions.
**
** @see abstract-tangible-test.cpp
** @see BusTerm_test
**
*/
@ -48,9 +56,7 @@
#include <iostream>
#include <string>
//#include <map>
//using std::map;
using std::cerr;
using std::endl;
using std::string;
@ -230,7 +236,7 @@ namespace test{
};
}
};
/** singleton instance of the [TestNexus]
* used for rigging unit tests */
lib::Depend<TestNexus> testNexus;