@@ -28,7 +28,7 @@ TEST_CASE("timekeeper_synchronous")
2828{
2929 SECTION (" defaults" )
3030 {
31- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
31+ auto tk = std::make_shared<TimekeeperSynchronous>();
3232 CHECK (tk->getValidity () == gInvalidValidityInterval );
3333 CHECK (tk->getSampleTimespan () == gInvalidValidityInterval );
3434 CHECK (tk->getTimerangeIdRange () == gInvalidTimeframeIdRange );
@@ -41,8 +41,8 @@ TEST_CASE("timekeeper_synchronous")
4141
4242 SECTION (" one_data_point_no_timer" )
4343 {
44- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
45- tk->updateByTimeFrameID (5 );
44+ auto tk = std::make_shared<TimekeeperSynchronous>();
45+ tk->updateByTimeFrameID (5 , 32 );
4646
4747 CHECK (tk->getValidity () == gInvalidValidityInterval );
4848 CHECK (tk->getSampleTimespan () == gInvalidValidityInterval );
@@ -56,7 +56,7 @@ TEST_CASE("timekeeper_synchronous")
5656
5757 SECTION (" no_data_one_timer" )
5858 {
59- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
59+ auto tk = std::make_shared<TimekeeperSynchronous>();
6060 tk->updateByCurrentTimestamp (1653000000000 );
6161
6262 CHECK (tk->getValidity () == ValidityInterval{ 1653000000000 , 1653000000000 });
@@ -71,9 +71,9 @@ TEST_CASE("timekeeper_synchronous")
7171
7272 SECTION (" one_data_point_sor_timer" )
7373 {
74- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
74+ auto tk = std::make_shared<TimekeeperSynchronous>();
7575 tk->setActivityDuration (ValidityInterval{ 1653000000000 , 1653000000000 });
76- tk->updateByTimeFrameID (5 );
76+ tk->updateByTimeFrameID (5 , 32 );
7777
7878 CHECK (tk->getValidity () == gInvalidValidityInterval );
7979 // we need at least one update with timestamp for a valid validity
@@ -85,9 +85,9 @@ TEST_CASE("timekeeper_synchronous")
8585
8686 SECTION (" one_data_point_one_timer" )
8787 {
88- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
88+ auto tk = std::make_shared<TimekeeperSynchronous>();
8989 tk->updateByCurrentTimestamp (1653000000000 );
90- tk->updateByTimeFrameID (5 );
90+ tk->updateByTimeFrameID (5 , 32 );
9191
9292 CHECK (tk->getValidity () == ValidityInterval{ 1653000000000 , 1653000000000 });
9393 CHECK (tk->getSampleTimespan () == ValidityInterval{ 1653000000011 , 1653000000013 });
@@ -101,7 +101,7 @@ TEST_CASE("timekeeper_synchronous")
101101
102102 SECTION (" no_data_many_timers" )
103103 {
104- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
104+ auto tk = std::make_shared<TimekeeperSynchronous>();
105105 tk->updateByCurrentTimestamp (1655000000000 );
106106 tk->updateByCurrentTimestamp (1656000000000 );
107107 tk->updateByCurrentTimestamp (1654000000000 ); // a timer from the past is rather unexpected, but it should not break anything
@@ -119,12 +119,12 @@ TEST_CASE("timekeeper_synchronous")
119119
120120 SECTION (" many_data_points_many_timers" )
121121 {
122- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
122+ auto tk = std::make_shared<TimekeeperSynchronous>();
123123 tk->updateByCurrentTimestamp (1653000000000 );
124- tk->updateByTimeFrameID (5 );
125- tk->updateByTimeFrameID (7 );
126- tk->updateByTimeFrameID (3 );
127- tk->updateByTimeFrameID (10 );
124+ tk->updateByTimeFrameID (5 , 32 );
125+ tk->updateByTimeFrameID (7 , 32 );
126+ tk->updateByTimeFrameID (3 , 32 );
127+ tk->updateByTimeFrameID (10 , 32 );
128128 tk->updateByCurrentTimestamp (1653500000000 );
129129
130130 CHECK (tk->getValidity () == ValidityInterval{ 1653000000000 , 1653500000000 });
@@ -136,8 +136,8 @@ TEST_CASE("timekeeper_synchronous")
136136 CHECK (tk->getSampleTimespan () == gInvalidValidityInterval );
137137 CHECK (tk->getTimerangeIdRange () == gInvalidTimeframeIdRange );
138138
139- tk->updateByTimeFrameID (12 );
140- tk->updateByTimeFrameID (54 );
139+ tk->updateByTimeFrameID (12 , 32 );
140+ tk->updateByTimeFrameID (54 , 32 );
141141 tk->updateByCurrentTimestamp (1653600000000 );
142142
143143 CHECK (tk->getValidity () == ValidityInterval{ 1653500000000 , 1653600000000 });
@@ -147,7 +147,7 @@ TEST_CASE("timekeeper_synchronous")
147147
148148 SECTION (" boundary_selection" )
149149 {
150- auto tk = std::make_shared<TimekeeperSynchronous>(32 );
150+ auto tk = std::make_shared<TimekeeperSynchronous>();
151151
152152 // ECS first
153153 tk->setStartOfActivity (1 , 2 , 3 );
@@ -181,7 +181,7 @@ TEST_CASE("timekeeper_asynchronous")
181181{
182182 SECTION (" defaults" )
183183 {
184- auto tk = std::make_shared<TimekeeperAsynchronous>(32 );
184+ auto tk = std::make_shared<TimekeeperAsynchronous>();
185185 CHECK (tk->getValidity () == gInvalidValidityInterval );
186186 CHECK (tk->getSampleTimespan () == gInvalidValidityInterval );
187187 CHECK (tk->getTimerangeIdRange () == gInvalidTimeframeIdRange );
@@ -194,7 +194,7 @@ TEST_CASE("timekeeper_asynchronous")
194194
195195 SECTION (" timers_have_no_effect" )
196196 {
197- auto tk = std::make_shared<TimekeeperAsynchronous>(32 );
197+ auto tk = std::make_shared<TimekeeperAsynchronous>();
198198 tk->setActivityDuration (ValidityInterval{ 1653000000000 , 1655000000000 });
199199 CHECK (tk->getValidity () == gInvalidValidityInterval );
200200 tk->updateByCurrentTimestamp (1654000000000 );
@@ -203,16 +203,16 @@ TEST_CASE("timekeeper_asynchronous")
203203
204204 SECTION (" sor_eor_not_set" )
205205 {
206- auto tk = std::make_shared<TimekeeperAsynchronous>(32 );
206+ auto tk = std::make_shared<TimekeeperAsynchronous>();
207207 // duration not set
208- tk->updateByTimeFrameID (1234 );
208+ tk->updateByTimeFrameID (1234 , 32 );
209209 CHECK (tk->getValidity () == gInvalidValidityInterval );
210210 CHECK (tk->getSampleTimespan () == gInvalidValidityInterval );
211211 CHECK (tk->getTimerangeIdRange () == gInvalidTimeframeIdRange );
212212
213213 // sor set, not eor - not enough
214214 tk->setActivityDuration (ValidityInterval{ 1653000000000 , 0 });
215- tk->updateByTimeFrameID (1234 );
215+ tk->updateByTimeFrameID (1234 , 32 );
216216 CHECK (tk->getValidity () == gInvalidValidityInterval );
217217 CHECK (tk->getSampleTimespan () == gInvalidValidityInterval );
218218 CHECK (tk->getTimerangeIdRange () == gInvalidTimeframeIdRange );
@@ -226,11 +226,11 @@ TEST_CASE("timekeeper_asynchronous")
226226
227227 SECTION (" data_no_moving_window" )
228228 {
229- auto tk = std::make_shared<TimekeeperAsynchronous>(32 );
229+ auto tk = std::make_shared<TimekeeperAsynchronous>();
230230 tk->setActivityDuration (ValidityInterval{ 1653000000000 , 1655000000000 });
231231
232- tk->updateByTimeFrameID (3 );
233- tk->updateByTimeFrameID (10 );
232+ tk->updateByTimeFrameID (3 , 32 );
233+ tk->updateByTimeFrameID (10 , 32 );
234234 CHECK (tk->getValidity () == ValidityInterval{ 1653000000000 , 1655000000000 });
235235 CHECK (tk->getSampleTimespan () == ValidityInterval{ 1653000000005 , 1653000000027 });
236236 CHECK (tk->getTimerangeIdRange () == TimeframeIdRange{ 3 , 10 });
@@ -240,8 +240,8 @@ TEST_CASE("timekeeper_asynchronous")
240240 CHECK (tk->getSampleTimespan () == gInvalidValidityInterval );
241241 CHECK (tk->getTimerangeIdRange () == gInvalidTimeframeIdRange );
242242
243- tk->updateByTimeFrameID (12 );
244- tk->updateByTimeFrameID (54 );
243+ tk->updateByTimeFrameID (12 , 32 );
244+ tk->updateByTimeFrameID (54 , 32 );
245245 CHECK (tk->getValidity () == ValidityInterval{ 1653000000000 , 1655000000000 });
246246 CHECK (tk->getSampleTimespan () == ValidityInterval{ 1653000000031 , 1653000000152 });
247247 CHECK (tk->getTimerangeIdRange () == TimeframeIdRange{ 12 , 54 });
@@ -250,43 +250,44 @@ TEST_CASE("timekeeper_asynchronous")
250250 SECTION (" data_moving_window" )
251251 {
252252 // for "simplicity" assuming TF length of 11246 orbits, which gives us 1.0005 second TF duration
253- auto tk = std::make_shared<TimekeeperAsynchronous>(11246 , 30 * 1000 );
253+ const auto nOrbitPerTF = 11246 ;
254+ auto tk = std::make_shared<TimekeeperAsynchronous>(30 * 1000 );
254255 tk->setActivityDuration (ValidityInterval{ 1653000000000 , 1653000095000 }); // 95 seconds: 0-30, 30-60, 60-95
255256
256257 // hitting only the 1st window
257- tk->updateByTimeFrameID (1 );
258- tk->updateByTimeFrameID (10 );
258+ tk->updateByTimeFrameID (1 , nOrbitPerTF );
259+ tk->updateByTimeFrameID (10 , nOrbitPerTF );
259260 CHECK (tk->getValidity () == ValidityInterval{ 1653000000000 , 1653000030000 });
260261 CHECK (tk->getSampleTimespan () == ValidityInterval{ 1653000000000 , 1653000009999 });
261262 CHECK (tk->getTimerangeIdRange () == TimeframeIdRange{ 1 , 10 });
262263
263264 // hitting the 1st and 2nd window
264265 tk->reset ();
265- tk->updateByTimeFrameID (1 );
266- tk->updateByTimeFrameID (55 );
266+ tk->updateByTimeFrameID (1 , nOrbitPerTF );
267+ tk->updateByTimeFrameID (55 , nOrbitPerTF );
267268 CHECK (tk->getValidity () == ValidityInterval{ 1653000000000 , 1653000060000 });
268269 CHECK (tk->getSampleTimespan () == ValidityInterval{ 1653000000000 , 1653000055001 });
269270 CHECK (tk->getTimerangeIdRange () == TimeframeIdRange{ 1 , 55 });
270271
271272 // hitting the 3rd, extended window in the main part.
272273 // there is no 4th window, since we merge the last two to avoid having the last one with too little statistics
273274 tk->reset ();
274- tk->updateByTimeFrameID (80 );
275+ tk->updateByTimeFrameID (80 , nOrbitPerTF );
275276 CHECK (tk->getValidity () == ValidityInterval{ 1653000060000 , 1653000095000 });
276277 CHECK (tk->getSampleTimespan () == ValidityInterval{ 1653000079003 , 1653000080002 });
277278 CHECK (tk->getTimerangeIdRange () == TimeframeIdRange{ 80 , 80 });
278279
279280 // hitting the 3rd window with a sample which is in the extended part.
280281 tk->reset ();
281- tk->updateByTimeFrameID (93 );
282+ tk->updateByTimeFrameID (93 , nOrbitPerTF );
282283 CHECK (tk->getValidity () == ValidityInterval{ 1653000060000 , 1653000095000 });
283284 CHECK (tk->getSampleTimespan () == ValidityInterval{ 1653000092004 , 1653000093003 });
284285 CHECK (tk->getTimerangeIdRange () == TimeframeIdRange{ 93 , 93 });
285286 }
286287
287288 SECTION (" boundary_selection" )
288289 {
289- auto tk = std::make_shared<TimekeeperAsynchronous>(32 );
290+ auto tk = std::make_shared<TimekeeperAsynchronous>();
290291
291292 // ECS first
292293 tk->setStartOfActivity (1 , 2 , 3 );
0 commit comments