Skip to content

Commit

Permalink
[chip-tool-darwin] Fix ignored return values for simulated clusters (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Aug 10, 2023
1 parent 0d1694a commit 5b244c1
Show file tree
Hide file tree
Showing 3 changed files with 568 additions and 1,141 deletions.
13 changes: 2 additions & 11 deletions examples/chip-tool-darwin/commands/tests/TestCommandBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "../common/CHIPCommandBridge.h"
#include <app/tests/suites/commands/delay/DelayCommands.h>
#include <app/tests/suites/commands/log/LogCommands.h>
#include <app/tests/suites/commands/system/SystemCommands.h>
#include <app/tests/suites/include/ConstraintsChecker.h>
#include <app/tests/suites/include/PICSChecker.h>
Expand Down Expand Up @@ -60,6 +61,7 @@ class TestCommandBridge : public CHIPCommandBridge,
public ConstraintsChecker,
public PICSChecker,
public DelayCommands,
public LogCommands,
public SystemCommands {
public:
TestCommandBridge(const char * _Nonnull commandName)
Expand Down Expand Up @@ -100,17 +102,6 @@ class TestCommandBridge : public CHIPCommandBridge,
SetCommandExitStatus(err);
}

void Log(const char * _Nullable identity, const chip::app::Clusters::LogCommands::Commands::Log::Type & value)
{
NSLog(@"%.*s", static_cast<int>(value.message.size()), value.message.data());
NextTest();
}

void UserPrompt(const char * _Nullable identity, const chip::app::Clusters::LogCommands::Commands::UserPrompt::Type & value)
{
NextTest();
}

/////////// DelayCommands Interface /////////
void OnWaitForMs() override
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class {{filename}}: public TestCommandBridge
{{#chip_tests_item_parameters}}
{{>commandValue ns=parent.cluster container=(asPropertyValue dontUnwrapValue=true) definedValue=definedValue depth=0}}
{{/chip_tests_item_parameters}}
{{command}}("{{identity}}", value);
return {{command}}("{{identity}}", value);
{{else}}
CHIPDevice * device = GetDevice("{{identity}}");
CHIPTest{{asUpperCamelCase cluster}} * cluster = [[CHIPTest{{asUpperCamelCase cluster}} alloc] initWithDevice:device endpoint:{{endpoint}} queue:mCallbackQueue];
Expand Down Expand Up @@ -269,11 +269,11 @@ class {{filename}}: public TestCommandBridge
{{/chip_tests_item_responses}}
}{{#unless isWaitForReport}}]{{/unless}};

{{/if}}
{{#if async}}
NextTest();
{{/if}}
return CHIP_NO_ERROR;
{{/if}}
}
{{/chip_tests_items}}

Expand Down
Loading

0 comments on commit 5b244c1

Please sign in to comment.