diff --git a/unittest/tests/datapoollocal/LocalPoolManagerTest.cpp b/unittest/tests/datapoollocal/LocalPoolManagerTest.cpp index ccd8e70e..d43f3c80 100644 --- a/unittest/tests/datapoollocal/LocalPoolManagerTest.cpp +++ b/unittest/tests/datapoollocal/LocalPoolManagerTest.cpp @@ -63,12 +63,27 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") { HousekeepingMessage::HK_REPORT)); /* Clear message to avoid memory leak, our mock won't do it for us (yet) */ CommandMessageCleaner::clearCommandMessage(&messageSent); - } - - SECTION("AdvancedTests") { /* we need to reset the subscription list because the pool owner is a global object. */ poolOwner->resetSubscriptionList(); + } + + SECTION("SnapshotUpdateTests") { + /* we need to reset the subscription list because the pool owner + is a global object. */ + poolOwner->resetSubscriptionList(); + + /* Subscribe for snapshot generation on update. */ + REQUIRE(poolOwner->subscribeWrapperSetUpdateSnapshot() == retval::CATCH_OK); + poolOwner->dataset.setChanged(true); + REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK); + REQUIRE(mqMock->wasMessageSent(&messagesSent) == true); + CHECK(messagesSent == 1); + + } + + SECTION("AdvancedTests") { + /* Subscribe for variable update as well */ REQUIRE(not poolOwner->dataset.hasChanged()); REQUIRE(poolOwner->subscribeWrapperVariableUpdate(lpool::uint8VarId) == diff --git a/unittest/tests/datapoollocal/LocalPoolOwnerBase.h b/unittest/tests/datapoollocal/LocalPoolOwnerBase.h index 737f2613..353f7b4d 100644 --- a/unittest/tests/datapoollocal/LocalPoolOwnerBase.h +++ b/unittest/tests/datapoollocal/LocalPoolOwnerBase.h @@ -155,7 +155,12 @@ public: ReturnValue_t subscribeWrapperSetUpdate() { return poolManager.subscribeForSetUpdateMessages(lpool::testSetId, - objects::NO_OBJECT, MessageQueueIF::NO_QUEUE, false); + objects::NO_OBJECT, objects::HK_RECEIVER_MOCK, false); + } + + ReturnValue_t subscribeWrapperSetUpdateSnapshot() { + return poolManager.subscribeForSetUpdateMessages(lpool::testSetId, + objects::NO_OBJECT, objects::HK_RECEIVER_MOCK, true); } ReturnValue_t subscribeWrapperSetUpdateHk(bool diagnostics = false) {