feat(datastore): add getter and setter for size

This commit is contained in:
fallenoak 2023-02-25 10:18:54 -06:00
parent 08725b8455
commit f98814690c
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
3 changed files with 38 additions and 0 deletions

View file

@ -108,3 +108,31 @@ TEST_CASE("CDataStore::Get", "[datastore]") {
REQUIRE(msg.m_read == 0);
}
}
TEST_CASE("CDataStore::SetSize", "[datastore]") {
SECTION("sets size") {
uint8_t writeVal = 8;
CDataStore msg;
msg.Put(writeVal);
CHECK(msg.Size() == 1);
msg.SetSize(0);
CHECK(msg.Size() == 0);
}
}
TEST_CASE("CDataStore::Size", "[datastore]") {
SECTION("gets size") {
uint8_t writeVal1 = 8;
uint16_t writeVal2 = 9;
CDataStore msg;
msg.Put(writeVal1);
msg.Put(writeVal2);
REQUIRE(msg.Size() == 3);
}
}