Commit graph

78 commits

Author SHA1 Message Date
1059458e11 MockElm: add the ability to store/query received errors and messages
this is just a draft and in expectation of what we'll likely
add to the real model::Element and model::Controller entities
2016-02-14 00:16:10 +01:00
0be12aaa79 PresentationStateManager unit test PASS
basic state capturing, storage and replay now works as intended
More elaborate state management will be implemented later,
when we know more about perspectives and work sites!
2016-02-13 23:53:09 +01:00
4da75dd4d3 bus protocol change: special handling for reset state marks
- suppres sending redundant stat mark messages from MockElm
- emit a "reset" state mark when an actual reset happens
- let the PresentationStateManager discard recorded special state
  when receiving a "reset" mark for a given element
2016-02-13 23:48:34 +01:00
d57af50ad6 state manager storage implemented and covered by unit test
sigh.
If you want to feel slick and cool,
never dare to write any unit test....
2016-02-13 22:55:59 +01:00
f80982b52b gen-node: fix insidious data conssitency problem
I assumed that, since GenNode is composed of copyable and
assignable types, the standard implementation will do.
But I overlooked the run time type check on the opaque
payload type within lib::Variant. When a type mismatch
is detected, the default implementation has already
assigned and thus altered the IDs.

So we need to roll our own implementation, and to add
insult to injury, we can't use the copy-and-swap idiom either.
2016-02-13 22:55:59 +01:00
121cd41408 ouch: GCC-4.9 doesn't yet support the C++14 transparent comparators
This is actually a STL library feature, and was added precisely
for the reason encountered here: if we want logarithmic search,
we'll have to construct a new GenNode object, just to have something
for the set to invoke the comparison operator.

C++14 introduced the convention that the Comparator of the set
may define a marker type `is_transparent` alongside with a generic
comparison operator. But, as is obvious from the source code of
our GNU Standard library implementation, our std::set has no such
overload to make use of that feature

http://en.cppreference.com/w/cpp/container/set/find
http://stackoverflow.com/questions/20317413/what-are-transparent-comparators

The only good thing is that, just 10 minutes ago, I felt like
a complete moron because I'm writing a unit test for such a simple
storage class. ;-)
2016-02-13 22:55:59 +01:00
94576af4df finialise simple state manager implementation
...and rearrange storage interface to suit
2016-02-13 22:55:59 +01:00
071f49027f change presentation state manager API
...based on elementIDs rather, to avoid any
tangling and trickery with reconstructing IDs
2016-02-13 22:55:58 +01:00
c54dfd6a94 factor out generic map based state manager implementation 2016-02-13 22:55:58 +01:00
15c1343fae class name rochade
it occured to me that my "mock implementation" actually
is entirely generic, so it could as well be "the" implementation
2016-02-13 22:55:58 +01:00
49a42b4d50 add outline of corresponding storage implementation 2016-02-13 22:55:58 +01:00
ef04ebfb17 add skeleton of a mock implementation within test::Nexus 2016-02-13 22:55:58 +01:00
f58b2af228 stub new parts 2016-02-13 22:55:58 +01:00
1e5c1059d3 WIP: draft basics of state manager interface 2016-02-13 22:55:58 +01:00
26d0f50e47 state mark handling within the base element: unit test PASS
...and I made the decision *not* to consider any kind of
generic properties for now. YAGNI.

UI coding is notorious spaghetti code.
No point in fighting that, it is just the way it is,
because somewhere you're bound to get concrete, hands-on.
2016-02-13 22:55:58 +01:00
e4a57e27d2 complete the sending of state mark notifications
...everything working out of the box thus far,
which is remarkable, since I didn't write a single
line of implementation code beyond what's available
as basic bus functionality. So this one just
fell into place
2016-02-13 22:55:58 +01:00
35a0e8e5b4 draft first part of the test regarding state-marks 2016-02-13 22:55:58 +01:00
622364a904 message dispatching unit test PASS
...just had to fix the definition of the verifyMark test helper
function to better suit its purpose
2016-02-13 22:55:57 +01:00
e9a649ff63 draft test for mesage dispatch to UI-Elements
seems to work already, just there is some mismatch
in the test verification code
2016-02-13 22:55:57 +01:00
0964e56c49 better use a named magic constant
right now, what we actually need here is just some integer,
so the GenNode payload is typed to int (or just to anything
different than a Record, because the Record signals that
we intend to bind, not to invoke the command)
2016-02-13 22:55:57 +01:00
fea6628b3c WIP some notes what could be addressed next 2016-02-13 22:55:57 +01:00
44785859ea convenience shortcut to simplify command invocation via Bus 2016-02-13 22:55:57 +01:00
41c8c948e3 explicit size check to generate a meaningful error message
the values.child() call would also do a bounds check,
but only to rise a error::Invalid "index out of bounds".
So now we generate a clear message to indicate that
actually a runtime-checked type mismatch caused this problem
2016-02-13 22:55:57 +01:00
a7cd8996aa immutable-arguments(#989): proof-of concept
seems to work as assumed; we'll just have to construct
a new holder tuple in place when binding arguments.
Doesn't look too bad for me
2016-02-06 19:42:41 +01:00
dfc28ca2a0 UI-Bus command handling protocol unit test PASS
still TODO: the ability to use immutable types
within the command framework. In theory, this
shouldn't be had to implement, since we're creating
a new opaque value holder within the command registry
anyway, so it should be sufficient to refrain from
re-assigning a new value tuple. This is relevant,
since e.g. our time framework is built on immutable
value types.
2016-02-06 01:28:39 +01:00
deb7a6758c add diagnostic output to the command implementation record
...allows better diagnostic in tests, when handling a command
through the new mock handling pattern within Test-Nexus
2016-02-05 23:55:07 +01:00
743a30c1ed command binding via UI-Bus implemented and covered in mock setup 2016-02-05 17:07:42 +01:00
3f22150ab3 back to topic: get all the arguments of command binding logged
...when the Test-Nexus processes a command binding message.
In the real system of course we do not want to log every bind message.

The challenge here is the fact that command binding as such
is opaque, and the types of the data within the bind message
are opaque as well. Finally I settled on the compromise
to log them as strings, but only the DataCap part;
most value types applicable within GenNode
have a string representation to match.
2016-02-05 15:55:22 +01:00
3fef76e1d7 command-binding(#990): add new GenNode based argument binding
based on the new generic tuple builder, we're now able to
add a new binding function into the command implementation
machinery, alongside the existing one. As it stands, the
latter will be used rather by unit tests, while the new
access path is what will be actually taken within
the application, when receiving argument binding
messages dispatched via the UI-Bus.
2016-01-29 00:59:34 +01:00
16597fcd99 extend command API to also accept a lib::diff::Rec<GenNode> for arguments
WIP: have to decide how the arguments can be unpacked
and how to generate proper runtime type mismatch errors.
2016-01-22 20:29:45 +01:00
1dc9642ec4 draft implementation of diagnostic command handler 2016-01-22 19:44:17 +01:00
eaa12499f3 back to UI command invocation: basically implement a placeholder command
based on the previous experiments, this adds a fake operation
and a definition frame to hook this operation as pseudo Proc-Layer command

WIP: the invocation itself is not yet implemented.
     We need to build a custom invocation pattern for that,
     in order to be able to capture the instance-ID of the command
     on invocation

NOTE: also, because of #989, we can not bind a time value for this test
2016-01-22 12:19:25 +01:00
627b11dcb7 stub the new functions 2016-01-15 04:57:49 +01:00
b2e0c8fa63 WIP: draft a test to verify the bus side of UI command invocation
basically this comes down to provide some convenience fixture
within the test::Nexus, which automatically generates and wires
mock commands.

Not sure if this is even possible to the extent envisioned here
2016-01-15 04:30:43 +01:00
0b21eeae2f extend unit test verification on UI command invocation 2016-01-15 02:29:33 +01:00
5a5beebd15 marcro to indicate current test function on STDOUT
since our test.sh runner can be used to verify the
expected output printed by tests, working with these
output transcripts of larger tests can be hard at times.

These separators help to find who produced which output
and they prevent a regexp match to grep beyond the feed
of a single function (which can be a common problem
when using the self-diagnostic output of the facility
currently in test, which obviously will be similar
on any data printed.
2016-01-15 01:44:35 +01:00
de71baccc3 use a inline command handler to actually invoke. Unit test PASS
Wow!
This innocuous little commit integrates several subsystems for the first time

And all worked right away!
2016-01-12 02:59:16 +01:00
a5ca8ed3b1 ...and back to #975 : draft command invocation on UI elements
First part is to define the steps (the protocol) at the
model element level, which gets a command prepared and invoked.

Test fails still, because there is no actual argument binding
invoked in the TestNexus
2016-01-12 02:14:06 +01:00
2c20d407fc mass clean-up: adapt usage of std::cout pretty much everywhere
- remove unnecessary includes
- expunge all remaining usages of boost::format
- able to leave out the expliti string(elm) in output
- drop various operator<<, since we're now picking up
  custom string conversions automatically
- delete diagnostics headers, which are now largely superfluous
- use newer helper functions occasionally

I didn't blindly change any usage of <iostream> though;
sometimes, just using the output streams right away
seems adequate.
2016-01-07 20:12:46 +01:00
96ba1fc2d0 basic BusTerm lifecycle unit test PASS 2016-01-03 05:32:05 +01:00
c9ea9de54d cover basic up-link and down-link communication in BusTerm_test 2016-01-03 03:37:52 +01:00
540151b56b provide a mock handler for commands and state marks
in the real system, this will be the task of the CoreService,
while here, in test mode, we allow to install handling closures
from the unit-test-code
2016-01-03 03:23:39 +01:00
2e4d74747e implement logging overrides in the Test-Nexus implementation
the actual functionality is forwareded to the base class,
which is the regular Nexus Hub
2016-01-02 19:16:37 +01:00
3230660d86 implement, cover and use the log clearing function 2016-01-02 02:00:07 +01:00
d27d9f79c2 define first test case to cover the UI-Bus side of basic element interactions
this test is intended as counterpart to
AbstractTangible_test::verify_mockManipulation()

It creates a mock element and verifies bidirectional
connnectivity to the UI-Bus
2016-01-02 01:23:09 +01:00
603f9e2b7d DOC: fix some Doxygen link syntax
I worked under the erroneous assumption, that Doxygen
will use its internal entity-IDs as the link-IDs when
generating mardown-links. Yes, this seemed logical and
this would be the way I'd implement it....

But seemingly, Doxygen is not so consistent when it
comes to questions of syntax. The same holds true for
markdown, which lacking a coherent definition anyway.

Another problem is that Doxygen's auto-link generation
frequently fails, for reasons not yet clear to me.
Sometimes it seems to be necessary to give it a nudge
by including the \ref command. While I'm not willing
to go into focussed invstigation of Doxygen syntax
right now, at least I've done a search-and-replace
to remove the malformed links I've written the
last days
2015-12-27 03:16:49 +01:00
dddcbe9994 DOC: supply basics of UI-Bus and generic UI-element protocol
the initial draft of this concept is in place now, and
the first round of unit tests pass. I've got some understanding
of the purpose of the interactions and involved elements
and I'm confident this design is evolving in a sane way.

Note: extensive documentation is in the TiddlyWiki,
here I've just pasted and reworded some paragraphs from there
and integrated them into the Doxygen docs
2015-12-27 01:58:15 +01:00
a91d6a3bae implement and cover the zombie network 2015-12-26 22:56:43 +01:00
d7191959cf fix a zombie segementation fault
hey, it's still X-mas...
2015-12-26 21:53:46 +01:00
8cd31443b1 invent a suicidal zombie terminal
yeah, it's X-mas time,
letz build a diagnostic network of deceased widgets...
2015-12-26 20:41:24 +01:00