lumiera_/tests
Ichthyostega b6bdcc068d Library: investigate how a »zip iterator« can be built
Basically I am sick of writing for-loops in those cases
where the actual iteration is based on one or several data sources,
and I just need some damn index counter. Nothing against for-loops
in general — they have their valid uses — sometimes a for-loop is KISS

But in these typical cases, an iterator-based solution would be a
one-liner, when also exploiting the structured bindings of C++17

''I must admit that I want this for a loooooong time —''
...but always got intimidated again when thinking through the fine points.
Basically it „should be dead simple“ — as they say

Well — — it ''is'' simple, after getting the nasty aspects of tuple binding
and reference data types out of the way. Yesterday, while writing those
`TestFrame` test cases (which are again an example where you want to iterate
over two word sequences simultaneously and just compare them), I noticed that
last year I learned about the `std::apply`-to-fold-expression trick, and
that this solution pattern could be adapted to construct a tuple directly,
thereby circumventing most of the problems related to ''perfect forwarding''

So now we have a new util function `mapEach` (defined in `tuple-helper.hpp`)
and I have learned how to make this application completely generic.

As a second step, I implemented a proof-of-concept in `IterZip_test`,
which indeed was not really challenging, because the `IterExplorer`
is so very sophisticated by now and handles most cases with transparent
type-driven adaptors. A lot of work went into `IterExplorer` over the years,
and this pays off now.

The solution works as follows:
 * apply the `lib::explore()` constructor function to the varargs
 * package the resulting `IterExplorer` instantiations into a tuple
 * build a »state core« implementation which just lifts out the three
   iterator primitives onto this ''product type'' (i.e. the tuple)
 * wrap it in yet another `IterExplorer`
 * add a transformer function on top to extract a value-tuple for each ''yield'

As expected, works out-of-the-box, with all conceivable variants and wild
mixes of iterators, const, pointers, references, you name it....

PS: I changed the rendering of unsigned types in diagnostic output
    to use the short notation, e.g. `uint` instead of `unsigned int`.
    This dramatically improves the legibility of verification strings.
2024-11-22 22:07:39 +01:00
..
basics Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00
core Invocation: build test-data manipulation function 2024-11-21 00:50:39 +01:00
include MERGE Doxygen clean-up done during the last months 2017-04-01 23:59:00 +02:00
library Library: investigate how a »zip iterator« can be built 2024-11-22 22:07:39 +01:00
operation Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00
plugin Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00
stage Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00
tool Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00
vault Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00
00helloworld.tests link tests with stringent application scope dependencies (closes #938) 2014-10-17 21:15:59 +02:00
00support.tests Library: option to provide an explicit random seed for tests 2024-11-12 15:49:15 +01:00
00test.tests Fix: test should not be locale dependant 2010-11-06 23:02:27 +01:00
10errorhandling.tests re-arrange tests according to layer structure 2013-01-07 05:43:01 +01:00
10exception.tests Library: discontinue setting error flag from Exceptions (see #1341) 2023-10-01 20:11:45 +02:00
11concurrency.tests LibraryApplication: tie DispatcherLoop to thread lifecycle 2023-10-12 20:23:59 +02:00
11list.tests reorganise test suite compartments 2014-10-17 20:02:25 +02:00
11locking.tests Library/Application: complete technology switch (closes #1279) 2023-10-16 01:44:04 +02:00
11luid.tests reorganise test suite compartments 2014-10-17 20:02:25 +02:00
11safeclib.tests reorganise test suite compartments 2014-10-17 20:02:25 +02:00
11time.tests test-suite: fix lots of missing return value checks 2016-01-28 22:30:24 +01:00
11vault-memory.tests Block-Flow: completed implementation of low-level cyclic extent storage 2023-07-12 21:55:50 +02:00
12metaprogramming.tests Library: investigate how a »zip iterator« can be built 2024-11-22 22:07:39 +01:00
15library.tests Library: shorten display of unsigned types 2024-11-22 22:02:45 +01:00
16calculation.tests Library: now using controlled seed and replaced rand (closes #1378) 2024-11-17 19:45:41 +01:00
20config_lowlevel.tests clean-up: sourcefile layout and spell checking 2014-10-23 23:04:35 +02:00
20threads.tests TDD? TDB! Test-Driven-Brainstorming 2007-08-21 17:33:19 +02:00
22config_highlevel.tests re-arrange tests according to layer structure 2013-01-07 05:43:01 +01:00
25fundamental.tests Library: prepare switch of Thread-wrapper to C++17 2023-09-21 23:23:55 +02:00
30backend-file.tests TDD? TDB! Test-Driven-Brainstorming 2007-08-21 17:33:19 +02:00
30interfaces.tests WIP: testsuite for interfaces 2008-10-27 05:08:53 +01:00
31plugin.tests integrate priority queue: lumiera namespace prefix; unit test pass 2013-09-13 05:44:58 +02:00
32scheduler.tests Library: Testsuite maintenance 2024-11-16 00:38:57 +01:00
40core.tests Global-Layer-Renaming: adapt lots of documentation 2018-11-15 21:13:52 +01:00
41asset.tests Assets: investigating the unclear distinction between asset::Struct and asset::Meta (#1156) 2018-09-14 21:06:12 +02:00
42query.tests Global-Layer-Renaming: adapt lots of documentation 2018-11-15 21:13:52 +01:00
43session.tests Dispatcher-Pipeline: prepare test for the new NodeGraphAttachment 2023-06-07 04:03:00 +02:00
44controller.tests Dispatcher-Pipeline: prepare test for the new NodeGraphAttachment 2023-06-07 04:03:00 +02:00
45builder.tests Dispatcher-Pipeline: prepare test for the new NodeGraphAttachment 2023-06-07 04:03:00 +02:00
46fixture.tests Dispatcher-Pipeline: create hook for self-validation 2023-06-12 01:18:59 +02:00
46node.tests Invocation: forge a path for integration 2024-04-23 01:13:40 +02:00
47engine.tests Invocation: start with some rename-refactorings 2024-05-11 16:39:58 +02:00
48playout.tests Dispatcher-Pipeline: prepare test for the new NodeGraphAttachment 2023-06-07 04:03:00 +02:00
49core-integration.tests Dispatcher-Pipeline: prepare test for the new NodeGraphAttachment 2023-06-07 04:03:00 +02:00
51-gui-model.tests Segmentation: structure analysis for splitSplice operation 2023-05-02 04:29:34 +02:00
52-gui-control.tests Global-Layer-Renaming: fix remaining textual usages and IDs in the code 2018-12-10 00:09:56 +01:00
80-regression.tests test-suite: fix lots of missing return value checks 2016-01-28 22:30:24 +01:00
DIR_INFO update some DIR_INFO entries 2011-04-05 00:44:30 +02:00
SConscript Global-Layer-Renaming: fix remaining textual usages and IDs in the code 2018-12-10 00:09:56 +01:00
test.conf Testsuite: increase virtual memory limit 2023-10-04 22:42:37 +02:00
test.sh Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00
testrunner.cpp Copyright: clarify and simplify the file headers 2024-11-17 23:42:55 +01:00