diff --git a/src/controller/tests/TestEventCaching.cpp b/src/controller/tests/TestEventCaching.cpp index ee6dc6c852bc93..6609f3c314ba91 100644 --- a/src/controller/tests/TestEventCaching.cpp +++ b/src/controller/tests/TestEventCaching.cpp @@ -61,6 +61,11 @@ class TestContext : public chip::Test::AppContext auto * ctx = static_cast(context); + if (ctx->mEventCounter.Init(0) != CHIP_NO_ERROR) + { + return FAILURE; + } + chip::app::LogStorageResources logStorageResources[] = { { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), chip::app::PriorityLevel::Info }, @@ -69,7 +74,7 @@ class TestContext : public chip::Test::AppContext chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), sizeof(logStorageResources) / sizeof(logStorageResources[0]), - gCircularEventBuffer, logStorageResources, nullptr, 0, nullptr); + gCircularEventBuffer, logStorageResources, &ctx->mEventCounter); return SUCCESS; } @@ -83,6 +88,9 @@ class TestContext : public chip::Test::AppContext return SUCCESS; } + +private: + MonotonicallyIncreasingCounter mEventCounter; }; nlTestSuite * gSuite = nullptr;