#include #include "checkpoint.hpp" #include "ephermal_checkpoint.hpp" #include "vector.hpp" #include "scalar.hpp" #include "mempool.hpp" using namespace std; int main() { Checkpoint cont("cont", 0), add("moppelkotze", -10); EphermalCheckpoint eph("ignored", -10); // check that all initial values are set for (int i=0; i<16; i++) { if (add.getValue(0, i) != -10) { cerr << "initial value of " << i << "wrong (" << add.getValue(0, i) << " != -10)" << endl; return -1; } if (add.getValue(0, i) != -10) { cerr << "(ephermal) initial value of " << i << "wrong (" << add.getValue(0, i) << " != -10)" << endl; return -1; } } // check takeover to the next generation add.getValue(1, 0); // readout already triggers (yes, this also happens below) for (int i=0; i<16; i++) if (add.getValue(1, i) != -10) { cerr << "checkout generation takover of " << i << "failed (" << add.getValue(0, i) << " != -10)" << endl; return -1; } // set and get value add.set(6, 5, 42); // check value continuation over time // WARN: tests also the behaviour that only the most recent value per timeslot is stored for (int i=1; i<1000; i++) if (add.getValue(i, 5) != 42) { cerr << "new value takover failed (time: " << i << ", element 5); value 42 != " << add.getValue(0, i) << endl; return -1; } add.sync(); // success return 0; }