added some test, initial tick counter higher now

This commit is contained in:
Robin Müller 2021-03-10 18:03:39 +01:00
parent 6501c16fd7
commit b2e4438811
2 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,9 @@ void PeriodicHousekeepingHelper::initialize(float collectionInterval,
nonDiagIntervalFactor; nonDiagIntervalFactor;
} }
collectionIntervalTicks = intervalSecondsToInterval(collectionInterval); collectionIntervalTicks = intervalSecondsToInterval(collectionInterval);
/* This will cause a checkOpNecessary call to be true immediately. I think it's okay
if a HK packet is generated immediately instead of waiting one generation cycle. */
internalTickCounter = collectionIntervalTicks;
} }
float PeriodicHousekeepingHelper::getCollectionIntervalInSeconds() { float PeriodicHousekeepingHelper::getCollectionIntervalInSeconds() {

View File

@ -80,6 +80,13 @@ TEST_CASE("DataSetTest" , "[DataSetTest]") {
localSet.localPoolVarUint8 = 0; localSet.localPoolVarUint8 = 0;
localSet.localPoolVarFloat = 0; localSet.localPoolVarFloat = 0;
localSet.setAllVariablesReadOnly();
CHECK(localSet.localPoolUint16Vec.getReadWriteMode() == pool_rwm_t::VAR_READ);
CHECK(localSet.localPoolVarUint8.getReadWriteMode() == pool_rwm_t::VAR_READ);
CHECK(localSet.localPoolVarFloat.getReadWriteMode() == pool_rwm_t::VAR_READ);
/* For code coverage */
localSet.initializePeriodicHelper(0.0, 0.4, false);
{ {
/* Now we read again and check whether our zeroed values were overwritten with /* Now we read again and check whether our zeroed values were overwritten with
the values in the pool */ the values in the pool */