Skip to content

Commit 506233d

Browse files
Anders Esbensenjmartinez-silabs
Anders Esbensen
authored andcommitted
Pull request project-chip#884: UIC-2773: Re-eanble unit tests for color control
Merge in WMN_TOOLS/matter from bugfix/UIC-2773 to silabs Squashed commit of the following: commit 08f4fe842fd3940090f0ab64893581c86fcc5597 Author: Anders Lynge Esbensen <anders.esbensen@silabs.com> Date: Tue Jun 13 15:21:19 2023 +0200 UIC-2773: Re-eanble unit tests for color control
1 parent d04d377 commit 506233d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

silabs_examples/unify-matter-bridge/linux/src/tests/BUILD.gn

+2-5
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,13 @@ chip_test_suite("tests") {
4747
"TestClusterInteractor.cpp",
4848
"TestClusterTranslator.cpp",
4949
"TestDeviceMapper.cpp",
50-
# TODO Fix test and renable
51-
# (../scripts/run_tests.sh: line 35: 7421 Segmentation fault (core dumped) $testExecutable &> /dev/null)
52-
# "TestClusterEmulator.cpp",
50+
"TestClusterEmulator.cpp",
5351
"TestExample.cpp",
5452
"TestLevelControl.cpp",
5553
"TestGroupTranslator.cpp",
5654
"TestGroupCommandTranslator.cpp",
5755
"TestCli.cpp",
58-
# TODO Fix test and renable when possible
59-
#"TestColorControl.cpp",
56+
"TestColorControl.cpp",
6057
"TestNodeStateMonitor.cpp",
6158
"TestOnOff.cpp",
6259
"TestOnOffCommandsHandler.cpp",

silabs_examples/unify-matter-bridge/linux/src/tests/TestColorControl.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,10 @@ static void TestColorControlCommandStepHue(nlTestSuite * sSuite, void * apContex
579579
{
580580
TestContext & ctx = *static_cast<TestContext *>(apContext);
581581
Clusters::ColorControl::Commands::StepHue::Type request;
582+
request.stepMode = chip::app::Clusters::ColorControl::HueStepMode::kUp;
582583
CHIP_ERROR err = ctx.command_test<Clusters::ColorControl::Commands::StepHue::Type>(
583584
sSuite, "ucl/by-unid/zw-0x0002/ep2/ColorControl/Commands/StepHue",
584-
R"({"OptionsMask":0,"OptionsOverride":0,"StepMode":"{}","StepSize":0,"TransitionTime":0})", request);
585+
R"({"OptionsMask":0,"OptionsOverride":0,"StepMode":"Up","StepSize":0,"TransitionTime":0})", request);
585586
NL_TEST_ASSERT(sSuite, err == CHIP_NO_ERROR);
586587
}
587588

@@ -609,9 +610,10 @@ static void TestColorControlCommandStepSaturation(nlTestSuite * sSuite, void * a
609610
{
610611
TestContext & ctx = *static_cast<TestContext *>(apContext);
611612
Clusters::ColorControl::Commands::StepSaturation::Type request;
613+
request.stepMode = chip::app::Clusters::ColorControl::SaturationStepMode::kUp;
612614
CHIP_ERROR err = ctx.command_test<Clusters::ColorControl::Commands::StepSaturation::Type>(
613615
sSuite, "ucl/by-unid/zw-0x0002/ep2/ColorControl/Commands/StepSaturation",
614-
R"({"OptionsMask":0,"OptionsOverride":0,"StepMode":"{}","StepSize":0,"TransitionTime":0})", request);
616+
R"({"OptionsMask":0,"OptionsOverride":0,"StepMode":"Up","StepSize":0,"TransitionTime":0})", request);
615617
NL_TEST_ASSERT(sSuite, err == CHIP_NO_ERROR);
616618
}
617619

@@ -689,9 +691,10 @@ static void TestColorControlCommandEnhancedStepHue(nlTestSuite * sSuite, void *
689691
{
690692
TestContext & ctx = *static_cast<TestContext *>(apContext);
691693
Clusters::ColorControl::Commands::EnhancedStepHue::Type request;
694+
request.stepMode = chip::app::Clusters::ColorControl::HueStepMode::kUp;
692695
CHIP_ERROR err = ctx.command_test<Clusters::ColorControl::Commands::EnhancedStepHue::Type>(
693696
sSuite, "ucl/by-unid/zw-0x0002/ep2/ColorControl/Commands/EnhancedStepHue",
694-
R"({"OptionsMask":0,"OptionsOverride":0,"StepMode":"{}","StepSize":0,"TransitionTime":0})", request);
697+
R"({"OptionsMask":0,"OptionsOverride":0,"StepMode":"Up","StepSize":0,"TransitionTime":0})", request);
695698
NL_TEST_ASSERT(sSuite, err == CHIP_NO_ERROR);
696699
}
697700

@@ -741,9 +744,10 @@ static void TestColorControlCommandStepColorTemperature(nlTestSuite * sSuite, vo
741744
{
742745
TestContext & ctx = *static_cast<TestContext *>(apContext);
743746
Clusters::ColorControl::Commands::StepColorTemperature::Type request;
747+
request.stepMode = chip::app::Clusters::ColorControl::HueStepMode::kUp;
744748
CHIP_ERROR err = ctx.command_test<Clusters::ColorControl::Commands::StepColorTemperature::Type>(
745749
sSuite, "ucl/by-unid/zw-0x0002/ep2/ColorControl/Commands/StepColorTemperature",
746-
R"({"ColorTemperatureMaximumMireds":0,"ColorTemperatureMinimumMireds":0,"OptionsMask":0,"OptionsOverride":0,"StepMode":"{}","StepSize":0,"TransitionTime":0})",
750+
R"({"ColorTemperatureMaximumMireds":0,"ColorTemperatureMinimumMireds":0,"OptionsMask":0,"OptionsOverride":0,"StepMode":"Up","StepSize":0,"TransitionTime":0})",
747751
request);
748752
NL_TEST_ASSERT(sSuite, err == CHIP_NO_ERROR);
749753
}

0 commit comments

Comments
 (0)