Lumiera  0.pre.03
»edit your freedom«
split-splice-test.cpp File Reference

Go to the source code of this file.

Description

unit test SplitSplice_test to verify proper working of the »SplitSplice« algorithm.

This is a generic setup to modify a segmentation (partitioning) of an ordered axis; the axis is represented as a collection of segments, which are assumed to be ordered and seamless, with the start point inclusive and the end point exclusive (thus the start of the next segment is identical with the end point of the current segment).

This test uses the natural number axis between -100 ... +100 and establishes a binding for the generic algorithm with suitably rigged test data, to verify the algorithm properly inserts a new segment under all conceivable circumstances, since there are many possibilities of arrangement for two ordered segments of arbitrary length.

Definition in file split-splice-test.cpp.

#include "lib/test/run.hpp"
#include "lib/test/test-helper.hpp"
#include "lib/format-cout.hpp"
#include "lib/format-util.hpp"
#include "lib/format-string.hpp"
#include "lib/split-splice.hpp"
#include "lib/nocopy.hpp"
#include "lib/util.hpp"
#include <utility>
#include <string>
#include <list>

Classes

struct  Seg
 Test Dummy: a "segment" representing an integer interval. More...
 
struct  SegL
 Test-Segmentation comprised of a sequence of Seg entries. More...
 
class  SplitSplice_test
 

Typedefs

using Iter = typename SegL::iterator
 
using OptInt = std::optional< int >
 

Functions

auto invokeSplitSplice (SegL &segs, OptInt startNew, OptInt afterNew)
 Perform the »SplitSplice« Algorithm to splice a new Segment into the given segmentation of the integer-axis. More...
 
 LAUNCHER (SplitSplice_test, "unit common")
 

Variables

const int SMAX = +100
 
const int SMIN = -100
 

Namespaces

 lib
 Implementation namespace for support and library code.