From 7167ad6d96aea0964fa91e2d11bd3d78ca799c2e Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 14 Jul 2023 02:58:00 +0200 Subject: [PATCH] Block-Flow: define expected behaviour for Epoch association ...how new Activities are placed into Epochs, incl. overflow --- tests/vault/gear/block-flow-test.cpp | 66 +++++++++++++++++++++++++++- wiki/thinkPad.ichthyo.mm | 39 ++++++++-------- 2 files changed, 85 insertions(+), 20 deletions(-) diff --git a/tests/vault/gear/block-flow-test.cpp b/tests/vault/gear/block-flow-test.cpp index cf5c6c7cc..1cad97d90 100644 --- a/tests/vault/gear/block-flow-test.cpp +++ b/tests/vault/gear/block-flow-test.cpp @@ -205,17 +205,79 @@ namespace test { /** @test TODO place Activity record into storage - * @todo WIP 7/23 ⟶ 🔁define ⟶ implement + * @todo WIP 7/23 ⟶ ✔define ⟶ 🔁implement */ void placeActivity() { + BlockFlow bFlow; + + Time t1 = Time{ 0,10}; + Time t2 = Time{500,10}; + Time t3 = Time{ 0,11}; + + auto& a1 = bFlow.until(t1).create(); + CHECK (watch(bFlow).allEpochs() == "10:200"_expect); + CHECK (watch(bFlow).find(a1) == "10:200"_expect); + + auto& a3 = bFlow.until(t3).create(); + CHECK (watch(bFlow).allEpochs() == "10:200|10:400|10:600|10:800|11:00"_expect); + CHECK (watch(bFlow).find(a3) == "11:000"_expect); + + auto& a2 = bFlow.until(t2).create(); + CHECK (watch(bFlow).allEpochs() == "10:200|10:400|10:600|10:800|11:00"_expect); + CHECK (watch(bFlow).find(a2) == "11:600"_expect); + + Time t0 = Time{0,5}; + + auto& a0 = bFlow.until(t0).create(); + CHECK (watch(bFlow).allEpochs() == "10:200|10:400|10:600|10:800|11:00"_expect); + CHECK (watch(bFlow).find(a2) == "10:200"_expect); + + BlockFlow::AllocatorHandle allocHandle = bFlow.until(Time{300,10}); + for (uint i=1; i - - - + + + + + + + + + + + - - - - + + - - + + - - - - - + + @@ -79993,7 +79996,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + @@ -80010,13 +80013,13 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - + - +