@@ -4104,7 +4104,7 @@ void TestReadInteraction::TestSubscribeInvalidateFabric(nlTestSuite * apSuite, v
4104
4104
4105
4105
readPrepareParams.mpAttributePathParamsList [0 ].mEndpointId = Test::kMockEndpoint3 ;
4106
4106
readPrepareParams.mpAttributePathParamsList [0 ].mClusterId = Test::MockClusterId (2 );
4107
- readPrepareParams.mpAttributePathParamsList [0 ].mAttributeId = Test::MockAttributeId (4 );
4107
+ readPrepareParams.mpAttributePathParamsList [0 ].mAttributeId = Test::MockAttributeId (1 );
4108
4108
4109
4109
readPrepareParams.mMinIntervalFloorSeconds = 0 ;
4110
4110
readPrepareParams.mMaxIntervalCeilingSeconds = 0 ;
@@ -4163,7 +4163,7 @@ void TestReadInteraction::TestShutdownSubscription(nlTestSuite * apSuite, void *
4163
4163
4164
4164
readPrepareParams.mpAttributePathParamsList [0 ].mEndpointId = Test::kMockEndpoint3 ;
4165
4165
readPrepareParams.mpAttributePathParamsList [0 ].mClusterId = Test::MockClusterId (2 );
4166
- readPrepareParams.mpAttributePathParamsList [0 ].mAttributeId = Test::MockAttributeId (4 );
4166
+ readPrepareParams.mpAttributePathParamsList [0 ].mAttributeId = Test::MockAttributeId (1 );
4167
4167
4168
4168
readPrepareParams.mMinIntervalFloorSeconds = 0 ;
4169
4169
readPrepareParams.mMaxIntervalCeilingSeconds = 0 ;
@@ -4210,7 +4210,7 @@ void TestReadInteraction::TestSubscriptionReportWithDefunctSession(nlTestSuite *
4210
4210
err = engine->Init (&ctx.GetExchangeManager (), &ctx.GetFabricTable ());
4211
4211
NL_TEST_ASSERT (apSuite, err == CHIP_NO_ERROR);
4212
4212
4213
- AttributePathParams subscribePath (Test::kMockEndpoint3 , Test::MockClusterId (2 ), Test::MockAttributeId (4 ));
4213
+ AttributePathParams subscribePath (Test::kMockEndpoint3 , Test::MockClusterId (2 ), Test::MockAttributeId (1 ));
4214
4214
4215
4215
ReadPrepareParams readPrepareParams (ctx.GetSessionBobToAlice ());
4216
4216
readPrepareParams.mpAttributePathParamsList = &subscribePath;
@@ -4231,6 +4231,7 @@ void TestReadInteraction::TestSubscriptionReportWithDefunctSession(nlTestSuite *
4231
4231
ctx.DrainAndServiceIO ();
4232
4232
4233
4233
NL_TEST_ASSERT (apSuite, delegate.mGotReport );
4234
+ NL_TEST_ASSERT (apSuite, delegate.mNumAttributeResponse == 1 );
4234
4235
NL_TEST_ASSERT (apSuite, engine->GetNumActiveReadHandlers (ReadHandler::InteractionType::Subscribe) == 1 );
4235
4236
NL_TEST_ASSERT (apSuite, engine->GetNumActiveReadHandlers (ReadHandler::InteractionType::Read) == 0 );
4236
4237
NL_TEST_ASSERT (apSuite, engine->GetReportingEngine ().GetNumReportsInFlight () == 0 );
@@ -4244,12 +4245,14 @@ void TestReadInteraction::TestSubscriptionReportWithDefunctSession(nlTestSuite *
4244
4245
4245
4246
// Test that we send reports as needed.
4246
4247
readHandler->SetStateFlag (ReadHandler::ReadHandlerFlags::HoldReport, false );
4247
- delegate.mGotReport = false ;
4248
+ delegate.mGotReport = false ;
4249
+ delegate.mNumAttributeResponse = 0 ;
4248
4250
engine->GetReportingEngine ().SetDirty (subscribePath);
4249
4251
4250
4252
ctx.DrainAndServiceIO ();
4251
4253
4252
4254
NL_TEST_ASSERT (apSuite, delegate.mGotReport );
4255
+ NL_TEST_ASSERT (apSuite, delegate.mNumAttributeResponse == 1 );
4253
4256
NL_TEST_ASSERT (apSuite, engine->GetNumActiveReadHandlers (ReadHandler::InteractionType::Subscribe) == 1 );
4254
4257
NL_TEST_ASSERT (apSuite, engine->GetNumActiveReadHandlers (ReadHandler::InteractionType::Read) == 0 );
4255
4258
NL_TEST_ASSERT (apSuite, engine->GetReportingEngine ().GetNumReportsInFlight () == 0 );
@@ -4258,12 +4261,14 @@ void TestReadInteraction::TestSubscriptionReportWithDefunctSession(nlTestSuite *
4258
4261
// up properly.
4259
4262
readHandler->GetSession ()->MarkAsDefunct ();
4260
4263
readHandler->SetStateFlag (ReadHandler::ReadHandlerFlags::HoldReport, false );
4261
- delegate.mGotReport = false ;
4264
+ delegate.mGotReport = false ;
4265
+ delegate.mNumAttributeResponse = 0 ;
4262
4266
engine->GetReportingEngine ().SetDirty (subscribePath);
4263
4267
4264
4268
ctx.DrainAndServiceIO ();
4265
4269
4266
4270
NL_TEST_ASSERT (apSuite, !delegate.mGotReport );
4271
+ NL_TEST_ASSERT (apSuite, delegate.mNumAttributeResponse == 0 );
4267
4272
NL_TEST_ASSERT (apSuite, engine->GetNumActiveReadHandlers (ReadHandler::InteractionType::Subscribe) == 0 );
4268
4273
NL_TEST_ASSERT (apSuite, engine->GetNumActiveReadHandlers (ReadHandler::InteractionType::Read) == 0 );
4269
4274
NL_TEST_ASSERT (apSuite, engine->GetReportingEngine ().GetNumReportsInFlight () == 0 );
0 commit comments