9#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
10#include <doctest/doctest.h>
28 int getCount() {
return count; };
39std::chrono::time_point<Iterator::Clock> zeroTime<std::chrono::time_point<Iterator::Clock>>()
41 return Iterator::Clock::now();
44size_t zeroTime<size_t>()
49TEST_SUITE_BEGIN(
"Iterator");
50TEST_CASE(
"Count iterator testing")
52 Counterant cant = Counterant();
53 Iterator iterator = Iterator(&cant);
58 Duration dt(
"P0-0T0:0:1");
61 TimePoint stop = start + overall;
62 iterator.setStartStopStep(start, start + overall, dt);
65 REQUIRE(dt.seconds() == 1);
66 REQUIRE(overall.seconds() == nSteps * 1);
67 REQUIRE(stop > start);
68 REQUIRE((stop - start).seconds() == nSteps * 1);
69 REQUIRE(cant.count == nSteps);
70 REQUIRE(cant.startCount == 1);
71 REQUIRE(cant.stopCount == 1);
void init()
Initializes the model, based on some environment stored in the implementing class.
void start(const TimePoint &startTime)
void stop(const TimePoint &stopTime)
void iterate(const TimestepTime &tst)
A base class for classes that specify what happens during one timestep.