Skip to content

Commit c801b4c

Browse files
committed
Code review comments
1 parent 272ac40 commit c801b4c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/app/codegen-data-model/CodegenDataModel.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ CHIP_ERROR CodegenDataModel::Invoke(const InteractionModel::InvokeRequest & requ
238238
// TODO: CommandHandlerInterface support is currently
239239
// residing in InteractionModelEngine itself. We may want to separate this out
240240
// into its own registry, similar to attributes, so that IM is decoupled from actual storage of things.
241+
//
242+
// Open issue at https://github.com/project-chip/connectedhomeip/issues/34258
241243

242244
// Ember dispatching automatically uses `handler` to set an appropriate result or status
243245
// This never fails (as handler error is encoded as needed).

src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -2437,8 +2437,12 @@ TEST(TestCodegenModelViaMocks, EmberWriteAttributeAccessInterfaceTest)
24372437

24382438
TEST(TestCodegenModelViaMocks, EmberInvokeTest)
24392439
{
2440-
// Ember invoke is extrealy hard-coded, so generally we just need to validate that
2441-
// correct paths are invoked.
2440+
// Ember invoke is fully code-generated - there is a single function for Dispatch
2441+
// that will do a `switch` on the path elements and invoke a corresponding `emberAf*`
2442+
// callback.
2443+
//
2444+
// The only thing that can be validated is that this `DispatchSingleClusterCommand`
2445+
// is actually invoked.
24422446

24432447
UseMockNodeConfig config(gTestNodeConfig);
24442448
chip::app::CodegenDataModel model;
@@ -2450,7 +2454,8 @@ TEST(TestCodegenModelViaMocks, EmberInvokeTest)
24502454

24512455
const uint32_t kDispatchCountPre = chip::Test::DispatchCount();
24522456

2453-
ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, nullptr /* handler, NOT used by impl*/), CHIP_NO_ERROR);
2457+
// Using a handler set to nullpotr as it is not used by the impl
2458+
ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, /* handler = */ nullptr), CHIP_NO_ERROR);
24542459

24552460
EXPECT_EQ(chip::Test::DispatchCount(), kDispatchCountPre + 1); // single dispatch
24562461
EXPECT_EQ(chip::Test::GetLastDispatchPath(), kCommandPath); // for the right path
@@ -2463,7 +2468,8 @@ TEST(TestCodegenModelViaMocks, EmberInvokeTest)
24632468

24642469
const uint32_t kDispatchCountPre = chip::Test::DispatchCount();
24652470

2466-
ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, nullptr /* handler, NOT used by impl*/), CHIP_NO_ERROR);
2471+
// Using a handler set to nullpotr as it is not used by the impl
2472+
ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, /* handler = */ nullptr), CHIP_NO_ERROR);
24672473

24682474
EXPECT_EQ(chip::Test::DispatchCount(), kDispatchCountPre + 1); // single dispatch
24692475
EXPECT_EQ(chip::Test::GetLastDispatchPath(), kCommandPath); // for the right path

0 commit comments

Comments
 (0)