81 return std::find_if (widgets_.begin()
83 , [&](
DummyWidget const& widget) { return widget == someWidget; });
91 return widgets_.empty();
105 auto ids = allWidgetIDs();
106 for ( ; refSeq and ids; ++refSeq, ++ids)
107 if (refSeq->i != *ids)
break;
118 widgets_.push_back (elm);
124 widgets_.remove_if ([&](
auto const& widget) {
return widget == elm; });
131 auto pos = findEntry (existingHook);
132 REQUIRE (pos != widgets_.end(),
"the given iterator must yield previously hooked-up elements");
134 this->remove (widget);
174 CHECK (canvas.empty());
176 HookedWidget widget{canvas};
177 CHECK (canvas.testContains (widget.i));
178 CHECK (not canvas.empty());
180 CHECK (canvas.empty());
190 CHECK (canvas.empty());
192 HookedWidget widget{canvas};
193 CHECK (canvas.testContains (widget.i));
194 CHECK (not canvas.empty());
198 HookedWidget otherWidget{canvas};
199 someID = otherWidget.i;
200 CHECK (canvas.testContains (someID));
201 CHECK (canvas.testContains (widget.i));
203 CHECK (not canvas.testContains (someID));
204 CHECK (canvas.testContains (widget.i));
205 CHECK (not canvas.empty());
223 using OrderIdx = vector<HookedWidget*>;
230 for (
uint i=0; i<20; ++i)
231 orderIdx.push_back (& widgets.emplace<HookedWidget>(canvas));
234 auto orderSequence = [&] {
return lib::ptrDeref(eachElm(orderIdx)); };
236 CHECK (canvas.testContainsSequence (eachElm(widgets)));
237 CHECK (canvas.testContainsSequence (orderSequence()));
240 shuffle (orderIdx.begin(),orderIdx.end(), std::random_device());
241 CHECK (not canvas.testContainsSequence (orderSequence()));
244 canvas.reOrder (orderSequence());
245 CHECK (canvas.testContainsSequence (orderSequence()));
A fixed collection of non-copyable polymorphic objects.
Interface to represent _"some presentation layout entity",_ with the ability to attach widgets (manag...
A widget attached onto a display canvas or similar central presentation context.
void verify_standardUsage()
void verify_multiplicity()
void hook(DummyWidget &elm) override
auto findEntry(DummyWidget const &someWidget)
std::list< DummyWidget > widgets_
bool testContainsSequence(IT refSeq)
verify our internal sequence matches the given one
void rehook(DummyWidget &existingHook) noexcept override
bool testContains(int someWidgetID)
void remove(DummyWidget &elm) override
auto allWidgetIDs() const
Preconfigured adapters for some STL container standard usage situations.
Building tree expanding and backtracking evaluations within hierarchical scopes.
_SeqT< CON >::Range eachElm(CON &coll)
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
auto ptrDeref(IT iter)
Convenience shortcut to dereference pointers yielded from the wrapped iterator.
ViewHooked< DummyWidget > HookedWidget
Lumiera GTK UI implementation root.
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
bool contains(MAP &map, typename MAP::key_type const &key)
shortcut for containment test on a map
bool isnil(lib::time::Duration const &dur)
bool linearSearch(IT iter, typename IT::value_type const &val)
use (and exhaust) a »Lumiera Forward Iterator« for linear search
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Managing a collection of non-copyable polymorphic objects in compact storage.
A collection of frequently used helper functions to support unit testing.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Allow widgets to connect to a common shared presentation context.