continued tests
This commit is contained in:
parent
a05cf8d4ab
commit
b241ef6aad
@ -10,6 +10,7 @@
|
|||||||
namespace lpool {
|
namespace lpool {
|
||||||
static constexpr lp_id_t uint8VarId = 0;
|
static constexpr lp_id_t uint8VarId = 0;
|
||||||
static constexpr lp_id_t floatVarId = 1;
|
static constexpr lp_id_t floatVarId = 1;
|
||||||
|
static constexpr lp_id_t uint32VarId = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -74,6 +75,7 @@ private:
|
|||||||
|
|
||||||
lp_var_t<uint8_t> testUint8 = lp_var_t<uint8_t>(this, lpool::uint8VarId);
|
lp_var_t<uint8_t> testUint8 = lp_var_t<uint8_t>(this, lpool::uint8VarId);
|
||||||
lp_var_t<float> testFloat = lp_var_t<float>(this, lpool::floatVarId);
|
lp_var_t<float> testFloat = lp_var_t<float>(this, lpool::floatVarId);
|
||||||
|
lp_var_t<uint32_t> testUint32 = lp_var_t<uint32_t>(this, lpool::uint32VarId);
|
||||||
|
|
||||||
MessageQueueIF* messageQueue = nullptr;
|
MessageQueueIF* messageQueue = nullptr;
|
||||||
LocalDataPoolManager hkManager;
|
LocalDataPoolManager hkManager;
|
||||||
|
@ -23,6 +23,8 @@ TEST_CASE("LocalPoolVariable" , "[LocPoolVarTest]") {
|
|||||||
REQUIRE(testVariable.value == 5);
|
REQUIRE(testVariable.value == 5);
|
||||||
|
|
||||||
CHECK(not testVariable.isValid());
|
CHECK(not testVariable.isValid());
|
||||||
|
testVariable.setValid(true);
|
||||||
|
CHECK(testVariable.isValid());
|
||||||
|
|
||||||
// not try to use a local pool variable which does not exist
|
// not try to use a local pool variable which does not exist
|
||||||
lp_var_t<uint8_t> invalidVariable = lp_var_t<uint8_t>(
|
lp_var_t<uint8_t> invalidVariable = lp_var_t<uint8_t>(
|
||||||
@ -36,12 +38,20 @@ TEST_CASE("LocalPoolVariable" , "[LocPoolVarTest]") {
|
|||||||
REQUIRE(invalidVariable2.read() ==
|
REQUIRE(invalidVariable2.read() ==
|
||||||
static_cast<int>(HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT));
|
static_cast<int>(HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT));
|
||||||
|
|
||||||
// now try to access with wrong type
|
lp_var_t<uint8_t> readOnlyVar = lp_var_t<uint8_t>(
|
||||||
lp_var_t<int8_t> readOnlyVar = lp_var_t<int8_t>(
|
|
||||||
objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint8VarId,
|
objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint8VarId,
|
||||||
nullptr, pool_rwm_t::VAR_READ);
|
nullptr, pool_rwm_t::VAR_READ);
|
||||||
REQUIRE(readOnlyVar.commit() ==
|
REQUIRE(readOnlyVar.commit() ==
|
||||||
static_cast<int>(PoolVariableIF::INVALID_READ_WRITE_MODE));
|
static_cast<int>(PoolVariableIF::INVALID_READ_WRITE_MODE));
|
||||||
|
lp_var_t<uint8_t> writeOnlyVar = lp_var_t<uint8_t>(
|
||||||
|
objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint8VarId,
|
||||||
|
nullptr, pool_rwm_t::VAR_WRITE);
|
||||||
|
REQUIRE(writeOnlyVar.read() == static_cast<int>(
|
||||||
|
PoolVariableIF::INVALID_READ_WRITE_MODE));
|
||||||
|
|
||||||
|
lp_var_t<uint32_t> uint32tVar = lp_var_t<uint32_t>(
|
||||||
|
objects::TEST_LOCAL_POOL_OWNER_BASE, lpool::uint32VarId);
|
||||||
|
sif::info << "LocalPoolVariable printout: " <<uint32tVar << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user