From 1967a67763881b7aa012b4c6fe180969f91f8673 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 17 Feb 2023 08:39:46 -0500 Subject: [PATCH] Use cluster-objects response struct in DoorLockServer::getUserCommandHandler. (#25092) Get rids of some manual TLV use and use of emberAfCurrentEndpoint(). --- .../door-lock-server/door-lock-server.cpp | 100 ++++++---------- src/app/data-model/List.h | 8 ++ .../tests/suites/DL_UsersAndCredentials.yaml | 22 ++-- .../certification/Test_TC_DRLK_2_11.yaml | 2 +- .../certification/Test_TC_DRLK_2_2.yaml | 2 +- .../certification/Test_TC_DRLK_2_3.yaml | 2 +- .../certification/Test_TC_DRLK_2_4.yaml | 2 +- .../certification/Test_TC_DRLK_2_5.yaml | 2 +- .../certification/Test_TC_DRLK_2_7.yaml | 2 +- .../certification/Test_TC_DRLK_2_9.yaml | 2 +- .../chip-tool/zap-generated/test/Commands.h | 108 +++++++++++++++--- .../zap-generated/test/Commands.h | 54 ++++++--- 12 files changed, 190 insertions(+), 116 deletions(-) diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index 2a475b6a02f485..9ca9e696404da3 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -436,82 +436,58 @@ void DoorLockServer::getUserCommandHandler(chip::app::CommandHandler * commandOb return; } - CHIP_ERROR err = CHIP_NO_ERROR; EmberAfPluginDoorLockUserInfo user; - VerifyOrExit(emberAfPluginDoorLockGetUser(commandPath.mEndpointId, userIndex, user), err = CHIP_ERROR_INTERNAL); + if (!emberAfPluginDoorLockGetUser(commandPath.mEndpointId, userIndex, user)) { - chip::app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ::Id, Commands::GetUserResponse::Id }; - chip::TLV::TLVWriter * writer; - SuccessOrExit(err = commandObj->PrepareCommand(path)); - VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit( - err = writer->Put(chip::TLV::ContextTag(to_underlying(Commands::GetUserResponse::Fields::kUserIndex)), userIndex)); + emberAfDoorLockClusterPrintln("[GetUser] Could not get user info [userIndex=%d]", userIndex); + commandObj->AddStatus(commandPath, Status::Failure); + return; + } - using ResponseFields = Commands::GetUserResponse::Fields; + Commands::GetUserResponse::Type response; + response.userIndex = userIndex; - // appclusters, 5.2.4.36: we should not add user-specific field if the user status is set to Available - if (UserStatusEnum::kAvailable != user.userStatus) - { - emberAfDoorLockClusterPrintln("Found user in storage: " - "[userIndex=%d,userName=\"%.*s\",userStatus=%u,userType=%u" - ",credentialRule=%u,createdBy=%u,modifiedBy=%u]", - userIndex, static_cast(user.userName.size()), user.userName.data(), - to_underlying(user.userStatus), to_underlying(user.userType), - to_underlying(user.credentialRule), user.createdBy, user.lastModifiedBy); + // appclusters, 5.2.4.36: we should not set user-specific fields to non-null if the user status is set to Available + if (UserStatusEnum::kAvailable != user.userStatus) + { + emberAfDoorLockClusterPrintln("Found user in storage: " + "[userIndex=%d,userName=\"%.*s\",userStatus=%u,userType=%u" + ",credentialRule=%u,createdBy=%u,modifiedBy=%u]", + userIndex, static_cast(user.userName.size()), user.userName.data(), + to_underlying(user.userStatus), to_underlying(user.userType), + to_underlying(user.credentialRule), user.createdBy, user.lastModifiedBy); - SuccessOrExit(err = writer->PutString(TLV::ContextTag(to_underlying(ResponseFields::kUserName)), user.userName)); - if (0xFFFFFFFFU != user.userUniqueId) - { - SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(ResponseFields::kUserUniqueID)), user.userUniqueId)); - } - SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(ResponseFields::kUserStatus)), user.userStatus)); - SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(ResponseFields::kUserType)), user.userType)); - SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(ResponseFields::kCredentialRule)), user.credentialRule)); - if (!user.credentials.empty()) - { - TLV::TLVType credentialsContainer; - SuccessOrExit(err = writer->StartContainer(TLV::ContextTag(to_underlying(ResponseFields::kCredentials)), - TLV::kTLVType_Array, credentialsContainer)); - for (size_t i = 0; i < user.credentials.size(); ++i) - { - SuccessOrExit(err = user.credentials.data()[i].Encode(*writer, TLV::AnonymousTag())); - } - SuccessOrExit(err = writer->EndContainer(credentialsContainer)); - } - // Append fabric IDs only if the user was created/modified by matter - if (user.creationSource == DlAssetSource::kMatterIM) - { - SuccessOrExit(err = - writer->Put(TLV::ContextTag(to_underlying(ResponseFields::kCreatorFabricIndex)), user.createdBy)); - } - if (user.modificationSource == DlAssetSource::kMatterIM) - { - SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(ResponseFields::kLastModifiedFabricIndex)), - user.lastModifiedBy)); - } + response.userName.SetNonNull(user.userName); + if (0xFFFFFFFFU != user.userUniqueId) + { + response.userUniqueID.SetNonNull(user.userUniqueId); } - else + response.userStatus.SetNonNull(user.userStatus); + response.userType.SetNonNull(user.userType); + response.credentialRule.SetNonNull(user.credentialRule); + response.credentials.SetNonNull(user.credentials); + // Set fabric indices only if the user was created/modified by matter. + if (user.creationSource == DlAssetSource::kMatterIM) { - emberAfDoorLockClusterPrintln("[GetUser] User not found [userIndex=%d]", userIndex); + response.creatorFabricIndex.SetNonNull(user.createdBy); } - - // appclusters, 5.2.4.36.1: We need to add next occupied user after userIndex if any. - uint16_t nextAvailableUserIndex = 0; - if (findOccupiedUserSlot(commandPath.mEndpointId, static_cast(userIndex + 1), nextAvailableUserIndex)) + if (user.modificationSource == DlAssetSource::kMatterIM) { - SuccessOrExit(err = - writer->Put(TLV::ContextTag(to_underlying(ResponseFields::kNextUserIndex)), nextAvailableUserIndex)); + response.lastModifiedFabricIndex.SetNonNull(user.lastModifiedBy); } - SuccessOrExit(err = commandObj->FinishCommand()); + } + else + { + emberAfDoorLockClusterPrintln("[GetUser] User not found [userIndex=%d]", userIndex); } -exit: - if (CHIP_NO_ERROR != err) + // appclusters, 5.2.4.36.1: We need to add next occupied user after userIndex if any. + uint16_t nextAvailableUserIndex = 0; + if (findOccupiedUserSlot(commandPath.mEndpointId, static_cast(userIndex + 1), nextAvailableUserIndex)) { - ChipLogError(Zcl, "[GetUser] Command processing failed [endpointId=%d,userIndex=%d,err=\"%s\"]", commandPath.mEndpointId, - userIndex, err.AsString()); - commandObj->AddStatus(commandPath, Status::Failure); + response.nextUserIndex.SetNonNull(nextAvailableUserIndex); } + commandObj->AddResponse(commandPath, response); } void DoorLockServer::clearUserCommandHandler(chip::app::CommandHandler * commandObj, diff --git a/src/app/data-model/List.h b/src/app/data-model/List.h index b48b79905fc522..c2ef715a84d21f 100644 --- a/src/app/data-model/List.h +++ b/src/app/data-model/List.h @@ -50,6 +50,14 @@ struct List : public Span // using Span::Span; + // Inherited copy constructors are _not_ imported by the using statement + // above, though, so we need to implement that ourselves. This is templated + // on the span's type to allow us to init a List from Span. + // Span's constructor handles the checks on the types for us. + template + constexpr List(const Span & other) : Span(other) + {} + template constexpr List & operator=(T (&databuf)[N]) { diff --git a/src/app/tests/suites/DL_UsersAndCredentials.yaml b/src/app/tests/suites/DL_UsersAndCredentials.yaml index 3e26badf671fc3..e8c09fa05dd39e 100644 --- a/src/app/tests/suites/DL_UsersAndCredentials.yaml +++ b/src/app/tests/suites/DL_UsersAndCredentials.yaml @@ -124,7 +124,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -195,7 +195,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -244,7 +244,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -293,7 +293,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -342,7 +342,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -391,7 +391,7 @@ tests: - name: "CredentialRule" value: 2 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -440,7 +440,7 @@ tests: - name: "CredentialRule" value: 1 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -489,7 +489,7 @@ tests: - name: "CredentialRule" value: 2 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -640,7 +640,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -689,7 +689,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" @@ -820,7 +820,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_11.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_11.yaml index 603f6dff85c59a..179cbdb2d287e2 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_11.yaml @@ -77,7 +77,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml index b7a3dfab2f38f2..ed46ba5de15df7 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml @@ -72,7 +72,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml index 6959fa0d7c61c2..aaeeefc5b7aab2 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml @@ -73,7 +73,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml index 285f6b6cbb997a..ebedeffaed3e0a 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml @@ -74,7 +74,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml index 8f028db5922847..1cdd72bf7815d8 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml @@ -75,7 +75,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml index 2632aed097708f..b3c749e56b2345 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml @@ -75,7 +75,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml index 2b65f9e6106277..8d171385b893a6 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml @@ -75,7 +75,7 @@ tests: - name: "CredentialRule" value: 0 - name: "Credentials" - value: null + value: [] - name: "CreatorFabricIndex" value: 1 - name: "LastModifiedFabricIndex" diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 73cb583b541529..1344bc9124e1fb 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -74772,7 +74772,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -74801,7 +74805,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -74828,7 +74836,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -74855,7 +74867,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -74882,7 +74898,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 6U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -74909,7 +74929,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 6U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 2U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -74936,7 +74960,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 1U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -74963,7 +74991,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 2U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -75030,7 +75062,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -75056,7 +75092,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -75109,7 +75149,11 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -82064,7 +82108,11 @@ class Test_TC_DRLK_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -82564,7 +82612,11 @@ class Test_TC_DRLK_2_3Suite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -83184,7 +83236,11 @@ class Test_TC_DRLK_2_4Suite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -83468,7 +83524,11 @@ class Test_TC_DRLK_2_5Suite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -84025,7 +84085,11 @@ class Test_TC_DRLK_2_7Suite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -84454,7 +84518,11 @@ class Test_TC_DRLK_2_9Suite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -84990,7 +85058,11 @@ class Test_TC_DRLK_2_11Suite : public TestCommand VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); - VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("credentials", value.credentials)); + { + auto iter_1 = value.credentials.Value().begin(); + VerifyOrReturn(CheckNoMoreListItems("credentials.Value()", iter_1, 0)); + } VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index e72fc7d6ec5a44..6c9c3f89592329 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -110875,7 +110875,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111008,7 +111009,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111113,7 +111115,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111218,7 +111221,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111323,7 +111327,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111428,7 +111433,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111533,7 +111539,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111638,7 +111645,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -111943,7 +111951,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -112047,7 +112056,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -112302,7 +112312,8 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -123949,7 +123960,8 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -125102,7 +125114,8 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -126208,7 +126221,8 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -126755,7 +126769,8 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -127902,7 +127917,8 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -128796,7 +128812,8 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } { @@ -129750,7 +129767,8 @@ class Test_TC_DRLK_2_11 : public TestCommandBridge { { id actualValue = values.credentials; - VerifyOrReturn(CheckValueNull("Credentials", actualValue)); + VerifyOrReturn(CheckValueNonNull("Credentials", actualValue)); + VerifyOrReturn(CheckValue("Credentials", [actualValue count], static_cast(0))); } {