some more tests added

This commit is contained in:
Robin Müller 2021-03-11 12:44:35 +01:00
parent e55f74a00e
commit 33823b445c
4 changed files with 22 additions and 4 deletions

View File

@ -96,11 +96,11 @@ union gp_id_t {
return raw == INVALID_GPID;
}
bool operator==(const sid_t& other) const {
bool operator==(const gp_id_t& other) const {
return raw == other.raw;
}
bool operator!=(const sid_t& other) const {
bool operator!=(const gp_id_t& other) const {
return not (raw == other.raw);
}
};

View File

@ -67,7 +67,9 @@ void arrayprinter::printHex(const uint8_t *data, size_t size,
}
}
}
#if FSFW_DISABLE_PRINTOUT == 0
printf("[%s]\n", printBuffer);
#endif /* FSFW_DISABLE_PRINTOUT == 0 */
#endif
}
@ -108,7 +110,9 @@ void arrayprinter::printDec(const uint8_t *data, size_t size,
}
}
}
#if FSFW_DISABLE_PRINTOUT == 0
printf("[%s]\n", printBuffer);
#endif /* FSFW_DISABLE_PRINTOUT == 0 */
#endif
}

View File

@ -362,7 +362,21 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") {
gp_id_t gpidToCheck;
CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK);
CHECK(poolOwner->changedVariableCallbackWasCalled(gpidToCheck, storeId) == true);
CHECK(gpidToCheck == lpool::testSid);
CHECK(gpidToCheck == lpool::uint8VarGpid);
HousekeepingMessage::setUpdateSnapshotSetCommand(&hkCmd, lpool::testSid,
storeId::INVALID_STORE_ADDRESS);
CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK);
CHECK(poolOwner->changedDataSetCallbackWasCalled(sidToCheck, storeId) == true);
CHECK(sidToCheck == lpool::testSid);
HousekeepingMessage::setUpdateSnapshotVariableCommand(&hkCmd, lpool::uint8VarGpid,
storeId::INVALID_STORE_ADDRESS);
CHECK(poolOwner->poolManager.handleHousekeepingMessage(&hkCmd) == retval::CATCH_OK);
CHECK(poolOwner->changedVariableCallbackWasCalled(gpidToCheck, storeId) == true);
CHECK(gpidToCheck == lpool::uint8VarGpid);
poolOwner->poolManager.printPoolEntry(lpool::uint8VarId);
}