From b5b62f101fa8bb7bc2a4cbe353074e06c5df027e Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 14 Feb 2016 01:47:21 +0100 Subject: [PATCH] WIP: draft a message broadcasting function not really sure about its usefullness, but it seems low hanging fruit for me right now (while I am still aware of all details how the UI-Bus works). This might possibly be helpful to broadcast "reset" messages.... --- tests/gui/bus-term-test.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/gui/bus-term-test.cpp b/tests/gui/bus-term-test.cpp index 874389ba7..6409cfe10 100644 --- a/tests/gui/bus-term-test.cpp +++ b/tests/gui/bus-term-test.cpp @@ -374,6 +374,28 @@ namespace test { .beforeEvent("TestNexus","delivered mark to bID-charly")); + // broadcast message + uiBus.markAll (GenNode{"Message", "Foxtrot"}); + CHECK (not mockA.isError()); + CHECK (not mockB.isError()); + CHECK ( mockC.isError()); + CHECK ( mockA.isTouched()); + CHECK ( mockB.isTouched()); + CHECK ( mockC.isTouched()); + CHECK ("Foxtrot" == mockA.getMessage()); + CHECK ("Foxtrot" == mockB.getMessage()); + CHECK ("Foxtrot" == mockC.getMessage()); + CHECK ( "" == mockA.getError()); + CHECK ( "" == mockB.getError()); + CHECK ( "Echo" == mockC.getError()); + + CHECK (nexusLog.verifyEvent("mark", "Echo").id("Error") + .beforeCall("markAll").on("TestNexus").arg("Foxtrot") + .beforeEvent("broadcast", "Foxtrot") + .beforeCall("mark").on("TestNexus").arg("bravo", "GenNode-ID(\"Message\")-DataCap|«string»|Foxtrot") + .beforeCall("doMsg").on("bravo").arg("Foxtrot") + .beforeEvent("TestNexus", "broadcasted mark to 3 terminals")); + ////////////////////////////////////////////////////////////////////////////////////////////////////TODO WIP cout << "____Nexus-Log_________________\n" << util::join(nexusLog, "\n")