Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e9c169c
Initial commit
LyudmilaKostanyan Nov 27, 2025
6414608
Refactor test context usage in various cluster tests to use `chip::Te…
LyudmilaKostanyan Nov 27, 2025
68984b6
Refactor test cases to use `SetMockNodeConfig` directly from the `Tes…
LyudmilaKostanyan Nov 27, 2025
b4422e2
Refactor ClusterTester.h
LyudmilaKostanyan Nov 27, 2025
c12489b
Update test files to consistently use `chip::Testing` namespace for t…
LyudmilaKostanyan Nov 27, 2025
c359e0d
Update references from `chip::Test` to `chip::Testing` across multipl…
LyudmilaKostanyan Nov 27, 2025
0cfb408
Refactor test files to replace all instances of `chip::Test` with `ch…
LyudmilaKostanyan Nov 27, 2025
9570e72
Refactor AppTestContext.h
LyudmilaKostanyan Nov 27, 2025
d85f7fd
Refactor test-interaction-model-api.h for improved readability and co…
LyudmilaKostanyan Nov 27, 2025
de1924b
Refactor MessagingContext.h to improve code readability
LyudmilaKostanyan Nov 27, 2025
9a113e8
Refactor test files to replace all instances of `chip::Test` with `ch…
LyudmilaKostanyan Nov 27, 2025
c122560
Refactor LoopbackTransport and IOContext classes for improved readabi…
LyudmilaKostanyan Nov 27, 2025
efc97f1
Refactor test files to consistently use `chip::Testing` namespace, en…
LyudmilaKostanyan Nov 27, 2025
4cc2e41
Refactor ICDConfigurationData and related test access class to consis…
LyudmilaKostanyan Nov 27, 2025
35f76df
Update test files to consistently use `chip::Testing` namespace, enha…
LyudmilaKostanyan Nov 27, 2025
216a13a
Refactor test files to consistently use `chip::Testing` namespace, im…
LyudmilaKostanyan Nov 27, 2025
41623d2
Refactor test files to replace all instances of `chip::Test` with `ch…
LyudmilaKostanyan Nov 27, 2025
384419f
Refactor attribute-storage.cpp to replace `namespace Test` with `name…
LyudmilaKostanyan Nov 27, 2025
0da984f
Restyled by whitespace
restyled-commits Nov 27, 2025
12e1918
Restyled by clang-format
restyled-commits Nov 27, 2025
f37e492
Remove unnecessary `using namespace chip::Testing;` from TestRead.cpp…
LyudmilaKostanyan Nov 27, 2025
e611b60
Update TestMessagingLayer to use `chip::Testing` namespace for consis…
LyudmilaKostanyan Nov 27, 2025
df61fd4
Restyled by clang-format
restyled-commits Nov 27, 2025
9a8f92f
Refactor test files to consistently use `DispatchCount` and `GetLastD…
LyudmilaKostanyan Nov 27, 2025
b40a302
Refactor test-ember-api.h to improve namespace formatting and enhance…
LyudmilaKostanyan Nov 27, 2025
e34a008
Refactor TestExchange to use `Testing::LoopbackMessagingContext` dire…
LyudmilaKostanyan Nov 27, 2025
af62f49
Update src/app/util/mock/attribute-storage.cpp
LyudmilaKostanyan Nov 27, 2025
e06f2de
Restyled by clang-format
restyled-commits Nov 27, 2025
aa53b2c
Refactor TestPASESession to directly use `Testing::LoopbackMessagingC…
LyudmilaKostanyan Nov 27, 2025
00531d3
Refactor TestCodegenModelViaMocks to use `Protocols::InteractionModel…
LyudmilaKostanyan Nov 27, 2025
ecb5bdd
Refactor MockNodeConfig to improve code consistency by replacing `int…
LyudmilaKostanyan Nov 27, 2025
4734e1b
Refactor DataModelFixtures to use `Testing::MockClusterId` and `Testi…
LyudmilaKostanyan Nov 27, 2025
e0bf98b
Refactor TestAclEvent to improve namespace usage and enhance consiste…
LyudmilaKostanyan Nov 27, 2025
28be38c
Restyled by clang-format
restyled-commits Nov 27, 2025
a3b4624
Remove redundant namespace declaration in attribute-storage.cpp to im…
LyudmilaKostanyan Nov 27, 2025
0f6e2c8
Merge branch 'master' into RefactoringNamespaces
LyudmilaKostanyan Dec 1, 2025
5dbac2e
Merge branch 'master' into RefactoringNamespaces
LyudmilaKostanyan Dec 2, 2025
81f1e3f
Refactor test namespaces for consistency across network commissioning…
LyudmilaKostanyan Dec 2, 2025
c19592e
Refactor `DataModelFixtures.h `
LyudmilaKostanyan Dec 2, 2025
74c2c1a
Restyled by clang-format
restyled-commits Dec 2, 2025
37f6101
Remove unused includes in `TestResourceMonitoringCluster.cpp`
LyudmilaKostanyan Dec 2, 2025
7b8dc94
Merge branch 'master' into RefactoringNamespaces
LyudmilaKostanyan Dec 2, 2025
ab5f792
Merge branch 'master' into RefactoringNamespaces
LyudmilaKostanyan Dec 4, 2025
9cdea0c
Merge branch 'master' into RefactoringNamespaces
LyudmilaKostanyan Dec 5, 2025
8512f79
Refactor namespace usage in `Group Key Management Cluster` tests
LyudmilaKostanyan Dec 5, 2025
f767b62
Refactor namespace, initial commit
LyudmilaKostanyan Dec 5, 2025
8e83213
Refactor: Move `chip::app::Testing` to `chip::Testing`
LyudmilaKostanyan Dec 5, 2025
e83f82d
Merge branch 'master' into Namespaces
LyudmilaKostanyan Dec 5, 2025
cd71bae
Restyled by clang-format
restyled-commits Dec 5, 2025
71cb499
Refactor: Remove redundant `using namespace chip::Testing;` from `Tes…
LyudmilaKostanyan Dec 5, 2025
f4d8e99
Merge branch 'master' into Namespaces
LyudmilaKostanyan Dec 8, 2025
e741d79
Merge branch 'master' into Namespaces
andy31415 Dec 8, 2025
afa05ac
Merge branch 'master' into Namespaces
LyudmilaKostanyan Dec 9, 2025
e7891c7
Merge branch 'master' into Namespaces
LyudmilaKostanyan Dec 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/testing/unit_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ own text context class.
- If your test requires access to private/protected members of the underlying
class you're testing, you'll need to create an accessor class that performs
these operations and is friended to the underlying class. Please name the
class `chip::Test::SomethingTestAccess` where `Something` is the name of the
underlying class whose private/protected members you're trying to access.
Then add `friend class chip::Test::SomethingTestAccess;` to the underlying
class. Make sure your test's BUILD.gn file contains
class `chip::Testing::SomethingTestAccess` where `Something` is the name of
the underlying class whose private/protected members you're trying to
access. Then add `friend class chip::Testing::SomethingTestAccess;` to the
underlying class. Make sure your test's BUILD.gn file contains
`sources = [ "SomethingTestAccess.h" ]`. Before creating a new TestAccess
class, check if one already exists. If it does exist but doesn't expose the
member you need, you can add a function to that class to do so. Note that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using namespace chip::Testing;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::DataModel;
using namespace chip::app::Testing;
using namespace chip::Testing;
using namespace chip::Protocols::InteractionModel;
using namespace chip::app::Clusters::Globals::Attributes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ TEST_F(TestElectricalEnergyMeasurementCluster, FeatureAttributeTest)
// Test CumulativeEnergyImported (requires kCumulativeEnergy + kImportedEnergy)
{
const ConcreteDataAttributePath path = { paths[0].mEndpointId, paths[0].mClusterId, CumulativeEnergyImported::Id };
chip::app::Testing::ReadOperation readOperation(path);
chip::Testing::ReadOperation readOperation(path);
std::unique_ptr<AttributeValueEncoder> encoder = readOperation.StartEncoding();
auto result = cluster.ReadAttribute(readOperation.GetRequest(), *encoder);
EXPECT_TRUE(result.IsSuccess());
Expand All @@ -231,7 +231,7 @@ TEST_F(TestElectricalEnergyMeasurementCluster, FeatureAttributeTest)
// Test CumulativeEnergyExported (requires kCumulativeEnergy + kExportedEnergy)
{
const ConcreteDataAttributePath path = { paths[0].mEndpointId, paths[0].mClusterId, CumulativeEnergyExported::Id };
chip::app::Testing::ReadOperation readOperation(path);
chip::Testing::ReadOperation readOperation(path);
std::unique_ptr<AttributeValueEncoder> encoder = readOperation.StartEncoding();
auto result = cluster.ReadAttribute(readOperation.GetRequest(), *encoder);
EXPECT_TRUE(result.IsSuccess());
Expand All @@ -240,7 +240,7 @@ TEST_F(TestElectricalEnergyMeasurementCluster, FeatureAttributeTest)
// Test PeriodicEnergyImported (requires kPeriodicEnergy + kImportedEnergy)
{
const ConcreteDataAttributePath path = { paths[0].mEndpointId, paths[0].mClusterId, PeriodicEnergyImported::Id };
chip::app::Testing::ReadOperation readOperation(path);
chip::Testing::ReadOperation readOperation(path);
std::unique_ptr<AttributeValueEncoder> encoder = readOperation.StartEncoding();
auto result = cluster.ReadAttribute(readOperation.GetRequest(), *encoder);
EXPECT_TRUE(result.IsSuccess());
Expand All @@ -249,7 +249,7 @@ TEST_F(TestElectricalEnergyMeasurementCluster, FeatureAttributeTest)
// Test PeriodicEnergyExported (requires kPeriodicEnergy + kExportedEnergy)
{
const ConcreteDataAttributePath path = { paths[0].mEndpointId, paths[0].mClusterId, PeriodicEnergyExported::Id };
chip::app::Testing::ReadOperation readOperation(path);
chip::Testing::ReadOperation readOperation(path);
std::unique_ptr<AttributeValueEncoder> encoder = readOperation.StartEncoding();
auto result = cluster.ReadAttribute(readOperation.GetRequest(), *encoder);
EXPECT_TRUE(result.IsSuccess());
Expand All @@ -258,7 +258,7 @@ TEST_F(TestElectricalEnergyMeasurementCluster, FeatureAttributeTest)
// Test CumulativeEnergyReset (requires kCumulativeEnergy)
{
const ConcreteDataAttributePath path = { paths[0].mEndpointId, paths[0].mClusterId, CumulativeEnergyReset::Id };
chip::app::Testing::ReadOperation readOperation(path);
chip::Testing::ReadOperation readOperation(path);
std::unique_ptr<AttributeValueEncoder> encoder = readOperation.StartEncoding();
auto result = cluster.ReadAttribute(readOperation.GetRequest(), *encoder);
EXPECT_TRUE(result.IsSuccess());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::GeneralDiagnostics::Attributes;
using namespace chip::app::DataModel;
using namespace chip::Test;
using namespace chip::Testing;

template <class T>
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/groupcast/tests/TestGroupcastCluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TEST_F(TestGroupcastCluster, TestJoinGroupCommand)
cmdData.gracePeriod = MakeOptional(0U);
cmdData.useAuxiliaryACL = MakeOptional(true);

chip::app::Testing::MockCommandHandler cmdHandler;
chip::Testing::MockCommandHandler cmdHandler;
chip::Testing::ClusterTester tester(cluster);
auto result = tester.Invoke(Commands::JoinGroup::Id, cmdData);
ASSERT_TRUE(result.status.has_value());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ using namespace chip::app::Clusters::NetworkCommissioning::Attributes;

using chip::app::AttributeValueDecoder;
using chip::app::DataModel::AttributeEntry;
using chip::app::Testing::kAdminSubjectDescriptor;
using chip::app::Testing::WriteOperation;
using chip::Testing::kAdminSubjectDescriptor;
using chip::Testing::WriteOperation;

class NoopBreadcrumbTracker : public BreadCrumbTracker
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ using namespace chip::app::Clusters::NetworkCommissioning;

using chip::app::AttributeValueDecoder;
using chip::app::DataModel::AttributeEntry;
using chip::app::Testing::kAdminSubjectDescriptor;
using chip::app::Testing::WriteOperation;
using chip::Testing::kAdminSubjectDescriptor;
using chip::Testing::WriteOperation;

class NoopBreadcrumbTracker : public BreadCrumbTracker
{
Expand Down
14 changes: 7 additions & 7 deletions src/app/clusters/testing/ClusterTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ class ClusterTester
// Store the read operation in a vector<std::unique_ptr<...>> to ensure its lifetime
// using std::unique_ptr because ReadOperation is non-copyable and non-movable
// vector reallocation is not an issue since we store unique_ptrs
std::unique_ptr<app::Testing::ReadOperation> readOperation =
std::make_unique<app::Testing::ReadOperation>(path.mEndpointId, path.mClusterId, attr_id);
std::unique_ptr<chip::Testing::ReadOperation> readOperation =
std::make_unique<chip::Testing::ReadOperation>(path.mEndpointId, path.mClusterId, attr_id);

mReadOperations.push_back(std::move(readOperation));
app::Testing::ReadOperation & readOperationRef = *mReadOperations.back().get();
chip::Testing::ReadOperation & readOperationRef = *mReadOperations.back().get();

std::unique_ptr<app::AttributeValueEncoder> encoder = readOperationRef.StartEncoding();
app::DataModel::ActionReturnStatus status = mCluster.ReadAttribute(readOperationRef.GetRequest(), *encoder);
VerifyOrReturnError(status.IsSuccess(), status);
ReturnErrorOnFailure(readOperationRef.FinishEncoding());

std::vector<app::Testing::DecodedAttributeData> attributeData;
std::vector<chip::Testing::DecodedAttributeData> attributeData;
ReturnErrorOnFailure(readOperationRef.GetEncodedIBs().Decode(attributeData));
VerifyOrReturnError(attributeData.size() == 1u, CHIP_ERROR_INCORRECT_STATE);

Expand All @@ -124,7 +124,7 @@ class ClusterTester
VerifyOrReturnError(paths.size() == 1u, CHIP_ERROR_INCORRECT_STATE);

app::ConcreteAttributePath path(paths[0].mEndpointId, paths[0].mClusterId, attr);
app::Testing::WriteOperation writeOp(path);
chip::Testing::WriteOperation writeOp(path);

// Create a stable object on the stack
Access::SubjectDescriptor subjectDescriptor{ mHandler.GetAccessingFabricIndex() };
Expand Down Expand Up @@ -293,9 +293,9 @@ class ClusterTester
// If protocol or test requirements change, this value may need to be increased.
static constexpr size_t kTlvBufferSize = 256;

app::Testing::MockCommandHandler mHandler;
chip::Testing::MockCommandHandler mHandler;
uint8_t mTlvBuffer[kTlvBufferSize];
std::vector<std::unique_ptr<app::Testing::ReadOperation>> mReadOperations;
std::vector<std::unique_ptr<chip::Testing::ReadOperation>> mReadOperations;
};

} // namespace Testing
Expand Down
16 changes: 7 additions & 9 deletions src/app/clusters/testing/MockCommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,32 @@
#include <transport/raw/MessageHeader.h>

namespace chip {
namespace app {
namespace Testing {

CHIP_ERROR MockCommandHandler::FallibleAddStatus(const ConcreteCommandPath & aRequestCommandPath,
CHIP_ERROR MockCommandHandler::FallibleAddStatus(const app::ConcreteCommandPath & aRequestCommandPath,
const Protocols::InteractionModel::ClusterStatusCode & aStatus,
const char * context)
{
mStatuses.emplace_back(StatusRecord{ aRequestCommandPath, aStatus, context });
return CHIP_NO_ERROR;
}

void MockCommandHandler::AddStatus(const ConcreteCommandPath & aRequestCommandPath,
void MockCommandHandler::AddStatus(const app::ConcreteCommandPath & aRequestCommandPath,
const Protocols::InteractionModel::ClusterStatusCode & aStatus, const char * context)
{
CHIP_ERROR err = FallibleAddStatus(aRequestCommandPath, aStatus, context);
VerifyOrDie(err == CHIP_NO_ERROR);
}

CHIP_ERROR MockCommandHandler::AddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const DataModel::EncodableToTLV & aEncodable)
CHIP_ERROR MockCommandHandler::AddResponseData(const app::ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const app::DataModel::EncodableToTLV & aEncodable)
{
chip::System::PacketBufferHandle handle = chip::MessagePacketBuffer::New(chip::kMaxAppMessageLen);
VerifyOrReturnError(!handle.IsNull(), CHIP_ERROR_NO_MEMORY);

TLV::TLVWriter baseWriter;
baseWriter.Init(handle->Start(), handle->MaxDataLength());
DataModel::FabricAwareTLVWriter writer(baseWriter, mFabricIndex);
app::DataModel::FabricAwareTLVWriter writer(baseWriter, mFabricIndex);
TLV::TLVType ct;

ReturnErrorOnFailure(writer.mTLVWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, ct));
Expand All @@ -64,8 +63,8 @@ CHIP_ERROR MockCommandHandler::AddResponseData(const ConcreteCommandPath & aRequ
return CHIP_NO_ERROR;
}

void MockCommandHandler::AddResponse(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const DataModel::EncodableToTLV & aEncodable)
void MockCommandHandler::AddResponse(const app::ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const app::DataModel::EncodableToTLV & aEncodable)
{
CHIP_ERROR err = AddResponseData(aRequestCommandPath, aResponseCommandId, aEncodable);
VerifyOrDie(err == CHIP_NO_ERROR);
Expand Down Expand Up @@ -93,5 +92,4 @@ CHIP_ERROR MockCommandHandler::GetResponseReader(TLV::TLVReader & reader, size_t
}

} // namespace Testing
} // namespace app
} // namespace chip
22 changes: 10 additions & 12 deletions src/app/clusters/testing/MockCommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,48 +32,47 @@
#include <vector>

namespace chip {
namespace app {
namespace Testing {

constexpr FabricIndex kTestFabricIndex = static_cast<FabricIndex>(151);

// Mock class that simulates CommandHandler behavior for unit testing, allowing capture and
// verification of responses and statuses without real network interactions.
class MockCommandHandler : public CommandHandler
class MockCommandHandler : public app::CommandHandler
{
public:
struct ResponseRecord
{
CommandId commandId;
System::PacketBufferHandle encodedData;
ConcreteCommandPath path;
app::ConcreteCommandPath path;
};

struct StatusRecord
{
ConcreteCommandPath path;
app::ConcreteCommandPath path;
Protocols::InteractionModel::ClusterStatusCode status;
const char * context;
};

~MockCommandHandler() override = default;

CHIP_ERROR FallibleAddStatus(const ConcreteCommandPath & aRequestCommandPath,
CHIP_ERROR FallibleAddStatus(const app::ConcreteCommandPath & aRequestCommandPath,
const Protocols::InteractionModel::ClusterStatusCode & aStatus,
const char * context = nullptr) override;

void AddStatus(const ConcreteCommandPath & aRequestCommandPath, const Protocols::InteractionModel::ClusterStatusCode & aStatus,
const char * context = nullptr) override;
void AddStatus(const app::ConcreteCommandPath & aRequestCommandPath,
const Protocols::InteractionModel::ClusterStatusCode & aStatus, const char * context = nullptr) override;

FabricIndex GetAccessingFabricIndex() const override { return mFabricIndex; }

// Encodes and stores response data, returning error if encoding fails (fallible version for robust test handling).
CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const DataModel::EncodableToTLV & aEncodable) override;
CHIP_ERROR AddResponseData(const app::ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const app::DataModel::EncodableToTLV & aEncodable) override;

// Encodes and stores response data, without error return (non-fallible version that assumes successful encoding in tests).
void AddResponse(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const DataModel::EncodableToTLV & aEncodable) override;
void AddResponse(const app::ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId,
const app::DataModel::EncodableToTLV & aEncodable) override;

bool IsTimedInvoke() const override { return false; }
void FlushAcksRightAwayOnSlowCommand() override {}
Expand Down Expand Up @@ -133,5 +132,4 @@ class MockCommandHandler : public CommandHandler
};

} // namespace Testing
} // namespace app
} // namespace chip
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <lib/support/CodeUtils.h>

using namespace chip;
using namespace chip::Test;
using namespace chip::Testing;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::ZoneManagement;
Expand Down
22 changes: 10 additions & 12 deletions src/app/data-model-provider/tests/ReadTesting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <app/MessageDef/ReportDataMessage.h>

namespace chip {
namespace app {
namespace Testing {
namespace {

Expand Down Expand Up @@ -56,10 +55,10 @@ CHIP_ERROR DecodeAttributeReportIBs(ByteSpan data, std::vector<DecodedAttributeD
while (CHIP_NO_ERROR == (err = reportIBsReader.Next()))
{
TLV::TLVReader attributeReportReader = reportIBsReader;
AttributeReportIB::Parser attributeReportParser;
app::AttributeReportIB::Parser attributeReportParser;
ReturnErrorOnFailure(attributeReportParser.Init(attributeReportReader));

AttributeDataIB::Parser dataParser;
app::AttributeDataIB::Parser dataParser;
// NOTE: to also grab statuses, use GetAttributeStatus and check for CHIP_END_OF_TLV
ReturnErrorOnFailure(attributeReportParser.GetAttributeData(&dataParser));

Expand Down Expand Up @@ -93,7 +92,7 @@ CHIP_ERROR DecodeAttributeReportIBs(ByteSpan data, std::vector<DecodedAttributeD

} // namespace

std::unique_ptr<AttributeValueEncoder> ReadOperation::StartEncoding(const EncodingParams & params)
std::unique_ptr<app::AttributeValueEncoder> ReadOperation::StartEncoding(const EncodingParams & params)
{
VerifyOrDie((mState == State::kEncoding) || (mState == State::kInitializing));
mState = State::kEncoding;
Expand All @@ -107,9 +106,9 @@ std::unique_ptr<AttributeValueEncoder> ReadOperation::StartEncoding(const Encodi

// mRequest.subjectDescriptor is known non-null because it is set in the constructor
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
return std::make_unique<AttributeValueEncoder>(mAttributeReportIBsBuilder, *mRequest.subjectDescriptor, mRequest.path,
params.GetDataVersion(), params.GetIsFabricFiltered(),
params.GetAttributeEncodeState());
return std::make_unique<app::AttributeValueEncoder>(mAttributeReportIBsBuilder, *mRequest.subjectDescriptor, mRequest.path,
params.GetDataVersion(), params.GetIsFabricFiltered(),
params.GetAttributeEncodeState());
}

CHIP_ERROR ReadOperation::FinishEncoding()
Expand All @@ -119,13 +118,13 @@ CHIP_ERROR ReadOperation::FinishEncoding()
return mEncodedIBs.FinishEncoding(mAttributeReportIBsBuilder);
}

CHIP_ERROR DecodedAttributeData::DecodeFrom(const AttributeDataIB::Parser & parser)
CHIP_ERROR DecodedAttributeData::DecodeFrom(const app::AttributeDataIB::Parser & parser)
{
ReturnErrorOnFailure(parser.GetDataVersion(&dataVersion));

AttributePathIB::Parser pathParser;
app::AttributePathIB::Parser pathParser;
ReturnErrorOnFailure(parser.GetPath(&pathParser));
ReturnErrorOnFailure(pathParser.GetConcreteAttributePath(attributePath, AttributePathIB::ValidateIdRanges::kNo));
ReturnErrorOnFailure(pathParser.GetConcreteAttributePath(attributePath, app::AttributePathIB::ValidateIdRanges::kNo));
ReturnErrorOnFailure(parser.GetData(&dataReader));

return CHIP_NO_ERROR;
Expand All @@ -135,7 +134,7 @@ CHIP_ERROR EncodedReportIBs::StartEncoding(app::AttributeReportIBs::Builder & bu
{
mEncodeWriter.Init(mTlvDataBuffer);
ReturnErrorOnFailure(mEncodeWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, mOuterStructureType));
return builder.Init(&mEncodeWriter, to_underlying(ReportDataMessage::Tag::kAttributeReportIBs));
return builder.Init(&mEncodeWriter, to_underlying(app::ReportDataMessage::Tag::kAttributeReportIBs));
}

CHIP_ERROR EncodedReportIBs::FinishEncoding(app::AttributeReportIBs::Builder & builder)
Expand All @@ -154,5 +153,4 @@ CHIP_ERROR EncodedReportIBs::Decode(std::vector<DecodedAttributeData> & decoded_
}

} // namespace Testing
} // namespace app
} // namespace chip
Loading
Loading