Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
split-splice-test.cpp File Reference

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

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 <optional>
#include <utility>
#include <string>
#include <list>

Namespaces

namespace  lib
 Implementation namespace for support and library code.
 
namespace  lib::test
 Unit tests for the Lumiera support library.
 
namespace  lib::test::anonymous_namespace{split-splice-test.cpp}
 

Typedefs

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

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
 

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.
 
 LAUNCHER (SplitSplice_test, "unit common")
 

Variables

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