From ed95611a2d4a2b62b4e99c533b899442baad1894 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 11 Jan 2022 21:06:45 +0100 Subject: [PATCH] Share more code between examples/chip-tool and examples/placeholder (#13452) * [chip-tool] Create ValueChecker.h and ConstraintsChecker.h from methods signature living into TestCommand.h Use CharSpan instead of Span and add a few const prefix * Move ValueChecker.h and ConstraintsChecker.h to src/app/tests/suites/include * [chip-tool] Create LogCommands class and move it under src/app/tests/suites/commands/log * Use LogCommands from src/app/tests/suites/commands/log into examples/placeholder instead of a custom implementation * [chip-tool] Add src/app/tests/suites/include/PICSChecker.h and use it into examples/chip-tool and examples/placeholder * Update generated test content --- examples/chip-tool/BUILD.gn | 4 + .../chip-tool/commands/tests/TestCommand.cpp | 114 -- .../chip-tool/commands/tests/TestCommand.h | 231 +-- .../templates/partials/test_cluster.zapt | 9 +- examples/placeholder/linux/BUILD.gn | 1 + .../placeholder/linux/include/TestCommand.h | 36 +- src/app/tests/suites/commands/log/BUILD.gn | 29 + .../tests/suites/commands/log/LogCommands.cpp | 33 + .../tests/suites/commands/log/LogCommands.h | 33 + .../tests/suites/include/ConstraintsChecker.h | 180 +++ src/app/tests/suites/include/PICSChecker.h | 49 + src/app/tests/suites/include/ValueChecker.h | 172 ++ .../chip-tool/zap-generated/test/Commands.h | 1433 +++++++++++++---- 13 files changed, 1674 insertions(+), 650 deletions(-) create mode 100644 src/app/tests/suites/commands/log/BUILD.gn create mode 100644 src/app/tests/suites/commands/log/LogCommands.cpp create mode 100644 src/app/tests/suites/commands/log/LogCommands.h create mode 100644 src/app/tests/suites/include/ConstraintsChecker.h create mode 100644 src/app/tests/suites/include/PICSChecker.h create mode 100644 src/app/tests/suites/include/ValueChecker.h diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 4b06c0eaba8589..7b2fb7081f1d00 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -37,6 +37,8 @@ config("config") { static_library("chip-tool-utils") { sources = [ + "${chip_root}/src/app/tests/suites/include/ConstraintsChecker.h", + "${chip_root}/src/app/tests/suites/include/ValueChecker.h", "commands/clusters/ModelCommand.cpp", "commands/common/CHIPCommand.cpp", "commands/common/CHIPCommand.h", @@ -63,6 +65,7 @@ static_library("chip-tool-utils") { deps = [ "${chip_root}/src/app/server", + "${chip_root}/src/app/tests/suites/commands/log", "${chip_root}/src/app/tests/suites/pics", "${chip_root}/src/controller/data_model", "${chip_root}/src/lib", @@ -87,6 +90,7 @@ executable("chip-tool") { deps = [ ":chip-tool-utils", "${chip_root}/src/app/server", + "${chip_root}/src/app/tests/suites/commands/log", "${chip_root}/src/app/tests/suites/pics", "${chip_root}/src/controller/data_model", "${chip_root}/src/lib", diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 70af22f64663cb..72d4fdc870d40d 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -65,20 +65,6 @@ CHIP_ERROR TestCommand::Wait(chip::System::Clock::Timeout duration) return chip::DeviceLayer::SystemLayer().StartTimer(duration, OnWaitForMsFn, this); } -CHIP_ERROR TestCommand::Log(const char * message) -{ - ChipLogDetail(chipTool, "%s", message); - ReturnErrorOnFailure(ContinueOnChipMainThread()); - return CHIP_NO_ERROR; -} - -CHIP_ERROR TestCommand::UserPrompt(const char * message) -{ - ChipLogDetail(chipTool, "USER_PROMPT: %s", message); - ReturnErrorOnFailure(ContinueOnChipMainThread()); - return CHIP_NO_ERROR; -} - void TestCommand::Exit(std::string message) { ChipLogError(chipTool, " ***** Test Failure: %s\n", message.c_str()); @@ -94,103 +80,3 @@ void TestCommand::ThrowSuccessResponse() { Exit("Expecting failure response but got a success response"); } - -bool TestCommand::CheckConstraintType(const char * itemName, const char * current, const char * expected) -{ - ChipLogError(chipTool, "Warning: %s type checking is not implemented yet. Expected type: '%s'", itemName, expected); - return true; -} - -bool TestCommand::CheckConstraintFormat(const char * itemName, const char * current, const char * expected) -{ - ChipLogError(chipTool, "Warning: %s format checking is not implemented yet. Expected format: '%s'", itemName, expected); - return true; -} - -bool TestCommand::CheckConstraintStartsWith(const char * itemName, const chip::Span current, const char * expected) -{ - std::string value(current.data(), current.size()); - if (value.rfind(expected, 0) != 0) - { - Exit(std::string(itemName) + " (\"" + value + "\") does not starts with: \"" + std::string(expected) + "\""); - return false; - } - - return true; -} - -bool TestCommand::CheckConstraintEndsWith(const char * itemName, const chip::Span current, const char * expected) -{ - std::string value(current.data(), current.size()); - if (value.find(expected, value.size() - strlen(expected)) == std::string::npos) - { - Exit(std::string(itemName) + " (\"" + value + "\") does not ends with: \"" + std::string(expected) + "\""); - return false; - } - - return true; -} - -bool TestCommand::CheckConstraintMinLength(const char * itemName, uint64_t current, uint64_t expected) -{ - if (current < expected) - { - Exit(std::string(itemName) + " length < minLength: " + std::to_string(current) + " < " + std::to_string(expected)); - return false; - } - - return true; -} - -bool TestCommand::CheckConstraintMaxLength(const char * itemName, uint64_t current, uint64_t expected) -{ - if (current > expected) - { - Exit(std::string(itemName) + " length > minLength: " + std::to_string(current) + " > " + std::to_string(expected)); - return false; - } - - return true; -} - -bool TestCommand::CheckValueAsString(const char * itemName, chip::ByteSpan current, chip::ByteSpan expected) -{ - if (!current.data_equal(expected)) - { - Exit(std::string(itemName) + " value mismatch, expecting " + - std::string(chip::Uint8::to_const_char(expected.data()), expected.size())); - return false; - } - - return true; -} - -bool TestCommand::CheckValueAsString(const char * itemName, chip::CharSpan current, chip::CharSpan expected) -{ - if (!current.data_equal(expected)) - { - Exit(std::string(itemName) + " value mismatch, expected '" + std::string(expected.data(), expected.size()) + "' but got '" + - std::string(current.data(), current.size()) + "'"); - return false; - } - - return true; -} - -bool TestCommand::ShouldSkip(const char * expression) -{ - // If there is no PICS configuration file, considers that nothing should be skipped. - if (!PICS.HasValue()) - { - return false; - } - - std::map pics(PICS.Value()); - bool shouldSkip = !PICSBooleanExpressionParser::Eval(expression, pics); - if (shouldSkip) - { - ChipLogProgress(chipTool, " **** Skipping: %s == false\n", expression); - ContinueOnChipMainThread(); - } - return shouldSkip; -} diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index acaff9a8335859..28e203b9139ace 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -19,19 +19,16 @@ #pragma once #include "../common/CHIPCommand.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include #include constexpr uint16_t kTimeoutInSeconds = 90; -class TestCommand : public CHIPCommand +class TestCommand : public CHIPCommand, public ValueChecker, public ConstraintsChecker, public PICSChecker, public LogCommands { public: TestCommand(const char * commandName) : @@ -43,6 +40,8 @@ class TestCommand : public CHIPCommand AddArgument("PICS", &mPICSFilePath); } + ~TestCommand(){}; + /////////// CHIPCommand Interface ///////// CHIP_ERROR RunCommand() override; chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(kTimeoutInSeconds); } @@ -53,8 +52,6 @@ class TestCommand : public CHIPCommand CHIP_ERROR Wait(chip::System::Clock::Timeout ms); CHIP_ERROR WaitForMs(uint16_t ms) { return Wait(chip::System::Clock::Milliseconds32(ms)); } CHIP_ERROR WaitForCommissionee(); - CHIP_ERROR Log(const char * message); - CHIP_ERROR UserPrompt(const char * message); protected: std::map mDevices; @@ -64,224 +61,15 @@ class TestCommand : public CHIPCommand static void OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error); static void OnWaitForMsFn(chip::System::Layer * systemLayer, void * context); - CHIP_ERROR ContinueOnChipMainThread() { return WaitForMs(0); }; + CHIP_ERROR ContinueOnChipMainThread() override { return WaitForMs(0); }; - void Exit(std::string message); + void Exit(std::string message) override; void ThrowFailureResponse(); void ThrowSuccessResponse(); - bool CheckConstraintType(const char * itemName, const char * current, const char * expected); - bool CheckConstraintFormat(const char * itemName, const char * current, const char * expected); - bool CheckConstraintMinLength(const char * itemName, uint64_t current, uint64_t expected); - bool CheckConstraintMaxLength(const char * itemName, uint64_t current, uint64_t expected); - bool CheckConstraintStartsWith(const char * itemName, const chip::Span current, const char * expected); - bool CheckConstraintEndsWith(const char * itemName, const chip::Span current, const char * expected); - template - bool CheckConstraintMinValue(const char * itemName, T current, T expected) - { - if (current < expected) - { - Exit(std::string(itemName) + " value < minValue: " + std::to_string(current) + " < " + std::to_string(expected)); - return false; - } - - return true; - } - template - bool CheckConstraintMinValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) - { - if (current.IsNull()) - { - return true; - } - return CheckConstraintMinValue(itemName, current.Value(), static_cast(expected)); - } - template - bool CheckConstraintMaxValue(const char * itemName, T current, T expected) - { - if (current > expected) - { - Exit(std::string(itemName) + " value > maxValue: " + std::to_string(current) + " > " + std::to_string(expected)); - return false; - } - - return true; - } - template - bool CheckConstraintMaxValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) - { - if (current.IsNull()) - { - return true; - } - return CheckConstraintMaxValue(itemName, current.Value(), static_cast(expected)); - } - template - bool CheckConstraintNotValue(const char * itemName, T current, U expected) - { - if (current == expected) - { - Exit(std::string(itemName) + " got unexpected value: " + std::to_string(current)); - return false; - } - - return true; - } - template - bool CheckConstraintNotValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) - { - if (current.IsNull()) - { - return true; - } - return CheckConstraintNotValue(itemName, current.Value(), expected); - } - - bool CheckConstraintNotValue(const char * itemName, chip::CharSpan current, chip::CharSpan expected) - { - if (current.data_equal(expected)) - { - Exit(std::string(itemName) + " got unexpected value: " + std::string(current.data(), current.size())); - return false; - } - - return true; - } - - bool CheckConstraintNotValue(const char * itemName, chip::ByteSpan current, chip::ByteSpan expected) - { - if (current.data_equal(expected)) - { - Exit(std::string(itemName) + " got unexpected value of size: " + std::to_string(current.size())); - return false; - } - - return true; - } - - // Allow a different expected type from the actual value type, because if T - // is short the literal we are using is not short-typed. - template ::value, int> = 0> - bool CheckValue(const char * itemName, T current, U expected) - { - if (current != expected) - { - Exit(std::string(itemName) + " value mismatch: expected " + std::to_string(expected) + " but got " + - std::to_string(current)); - return false; - } - - return true; - } - - template - bool CheckValue(const char * itemName, chip::BitFlags current, U expected) - { - return CheckValue(itemName, current.Raw(), expected); - } - - template ::value, int> = 0> - bool CheckValue(const char * itemName, T current, U expected) - { - return CheckValue(itemName, chip::to_underlying(current), expected); - } - - /** - * Check that the next list item, which is at index "index", exists and - * decodes properly. - */ - template - bool CheckNextListItemDecodes(const char * listName, typename std::remove_reference_t::Iterator & iter, size_t index) - { - bool hasValue = iter.Next(); - if (iter.GetStatus() != CHIP_NO_ERROR) - { - Exit(std::string(listName) + " value mismatch: error '" + iter.GetStatus().AsString() + "'decoding item at index " + - std::to_string(index)); - return false; - } - - if (hasValue) - { - return true; - } - - Exit(std::string(listName) + " value mismatch: should have value at index " + std::to_string(index) + - " but doesn't (actual value too short)"); - return false; - } - - /** - * Check that there are no more list items now that we have seen - * "expectedCount" of them. - */ - template - bool CheckNoMoreListItems(const char * listName, typename std::remove_reference_t::Iterator & iter, - size_t expectedCount) - { - bool hasValue = iter.Next(); - if (iter.GetStatus() != CHIP_NO_ERROR) - { - Exit(std::string(listName) + " value mismatch: error '" + iter.GetStatus().AsString() + - "'decoding item after we have seen " + std::to_string(expectedCount) + " items"); - return false; - } - - if (!hasValue) - { - return true; - } - - Exit(std::string(listName) + " value mismatch: expected only " + std::to_string(expectedCount) + - " items, but have more than that (actual value too long)"); - return false; - } - - bool CheckValueAsString(const char * itemName, chip::ByteSpan current, chip::ByteSpan expected); - - bool CheckValueAsString(const char * itemName, chip::CharSpan current, chip::CharSpan expected); - - template - bool CheckValuePresent(const char * itemName, const chip::Optional & value) - { - if (value.HasValue()) - { - return true; - } - - Exit(std::string(itemName) + " expected to have value but doesn't"); - return false; - } - - template - bool CheckValueNull(const char * itemName, const chip::app::DataModel::Nullable & value) - { - if (value.IsNull()) - { - return true; - } - - Exit(std::string(itemName) + " expected to be null but isn't"); - return false; - } - - template - bool CheckValueNonNull(const char * itemName, const chip::app::DataModel::Nullable & value) - { - if (!value.IsNull()) - { - return true; - } - - Exit(std::string(itemName) + " expected to not be null but is"); - return false; - } - chip::Callback::Callback mOnDeviceConnectedCallback; chip::Callback::Callback mOnDeviceConnectionFailureCallback; - bool ShouldSkip(const char * expression); - void Wait() { if (mDelayInMs.HasValue()) @@ -293,5 +81,4 @@ class TestCommand : public CHIPCommand chip::Optional mPICSFilePath; chip::Optional mEndpointId; chip::Optional mTimeout; - chip::Optional> PICS; }; diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 0a0a24fdf81835..311b21326b4a2d 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -41,7 +41,14 @@ class {{filename}}: public TestCommand {{#chip_tests_items}} case {{index}}: ChipLogProgress(chipTool, " ***** Test Step {{index}} : {{label}}\n"); - err = {{#if PICS}}ShouldSkip("{{PICS}}") ? CHIP_NO_ERROR : {{/if}}Test{{asUpperCamelCase label}}_{{index}}(); + {{#if PICS}} + if (ShouldSkip("{{PICS}}")) + { + NextTest(); + return; + } + {{/if}} + err = Test{{asUpperCamelCase label}}_{{index}}(); break; {{/chip_tests_items}} } diff --git a/examples/placeholder/linux/BUILD.gn b/examples/placeholder/linux/BUILD.gn index 3ca3b3adef5096..1917652769dc64 100644 --- a/examples/placeholder/linux/BUILD.gn +++ b/examples/placeholder/linux/BUILD.gn @@ -41,6 +41,7 @@ executable("chip-${chip_tests_zap_config}") { deps = [ ":configuration", "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/src/app/tests/suites/commands/log", "${chip_root}/src/app/tests/suites/pics", "${chip_root}/src/lib", ] diff --git a/examples/placeholder/linux/include/TestCommand.h b/examples/placeholder/linux/include/TestCommand.h index f3032560f48cb9..40e111fc3cd737 100644 --- a/examples/placeholder/linux/include/TestCommand.h +++ b/examples/placeholder/linux/include/TestCommand.h @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -34,7 +34,7 @@ constexpr const char kIdentityAlpha[] = ""; constexpr const char kIdentityBeta[] = ""; constexpr const char kIdentityGamma[] = ""; -class TestCommand +class TestCommand : public PICSChecker, public LogCommands { public: TestCommand(const char * commandName) : mCommandPath(0, 0, 0), mAttributePath(0, 0, 0) {} @@ -60,16 +60,8 @@ class TestCommand return 0; } - CHIP_ERROR Log(const char * message) + CHIP_ERROR ContinueOnChipMainThread() override { - ChipLogProgress(chipTool, "%s", message); - NextTest(); - return CHIP_NO_ERROR; - } - - CHIP_ERROR UserPrompt(const char * message) - { - ChipLogProgress(chipTool, "USER_PROMPT: %s", message); NextTest(); return CHIP_NO_ERROR; } @@ -125,26 +117,6 @@ class TestCommand mAttributePath = chip::app::ConcreteAttributePath(0, 0, 0); } - bool ShouldSkip(const char * expression) - { - // If there is no PICS configuration file, considers that nothing should be skipped. - if (!PICS.HasValue()) - { - return false; - } - - std::map pics(PICS.Value()); - bool shouldSkip = !PICSBooleanExpressionParser::Eval(expression, pics); - if (shouldSkip) - { - ChipLogProgress(chipTool, " **** Skipping: %s == false\n", expression); - NextTest(); - } - return shouldSkip; - } - - chip::Optional> PICS; - std::atomic_bool isRunning{ true }; protected: diff --git a/src/app/tests/suites/commands/log/BUILD.gn b/src/app/tests/suites/commands/log/BUILD.gn new file mode 100644 index 00000000000000..c0f2ffa3eb6b55 --- /dev/null +++ b/src/app/tests/suites/commands/log/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +static_library("log") { + output_name = "libLogCommands" + + sources = [ + "LogCommands.cpp", + "LogCommands.h", + ] + + cflags = [ "-Wconversion" ] + + public_deps = [ "${chip_root}/src/lib/support" ] +} diff --git a/src/app/tests/suites/commands/log/LogCommands.cpp b/src/app/tests/suites/commands/log/LogCommands.cpp new file mode 100644 index 00000000000000..ffc0bd3e874e9c --- /dev/null +++ b/src/app/tests/suites/commands/log/LogCommands.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "LogCommands.h" + +CHIP_ERROR LogCommands::Log(const char * message) +{ + ChipLogDetail(chipTool, "%s", message); + ReturnErrorOnFailure(ContinueOnChipMainThread()); + return CHIP_NO_ERROR; +} + +CHIP_ERROR LogCommands::UserPrompt(const char * message) +{ + ChipLogDetail(chipTool, "USER_PROMPT: %s", message); + ReturnErrorOnFailure(ContinueOnChipMainThread()); + return CHIP_NO_ERROR; +} diff --git a/src/app/tests/suites/commands/log/LogCommands.h b/src/app/tests/suites/commands/log/LogCommands.h new file mode 100644 index 00000000000000..f301fcadf3c420 --- /dev/null +++ b/src/app/tests/suites/commands/log/LogCommands.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include + +class LogCommands +{ +public: + LogCommands(){}; + virtual ~LogCommands(){}; + + virtual CHIP_ERROR ContinueOnChipMainThread() = 0; + + CHIP_ERROR Log(const char * message); + CHIP_ERROR UserPrompt(const char * message); +}; diff --git a/src/app/tests/suites/include/ConstraintsChecker.h b/src/app/tests/suites/include/ConstraintsChecker.h new file mode 100644 index 00000000000000..0c44c8b3bbe5d9 --- /dev/null +++ b/src/app/tests/suites/include/ConstraintsChecker.h @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include + +#include +#include + +class ConstraintsChecker +{ +public: + ConstraintsChecker(){}; + virtual ~ConstraintsChecker(){}; + +protected: + virtual void Exit(std::string message) = 0; + + bool CheckConstraintType(const char * itemName, const char * current, const char * expected) + { + ChipLogError(chipTool, "Warning: %s type checking is not implemented yet. Expected type: '%s'", itemName, expected); + return true; + } + + bool CheckConstraintFormat(const char * itemName, const char * current, const char * expected) + { + ChipLogError(chipTool, "Warning: %s format checking is not implemented yet. Expected format: '%s'", itemName, expected); + return true; + } + + bool CheckConstraintMinLength(const char * itemName, uint64_t current, uint64_t expected) + { + if (current < expected) + { + Exit(std::string(itemName) + " length < minLength: " + std::to_string(current) + " < " + std::to_string(expected)); + return false; + } + + return true; + } + + bool CheckConstraintMaxLength(const char * itemName, uint64_t current, uint64_t expected) + { + if (current > expected) + { + Exit(std::string(itemName) + " length > minLength: " + std::to_string(current) + " > " + std::to_string(expected)); + return false; + } + + return true; + } + + bool CheckConstraintStartsWith(const char * itemName, const chip::CharSpan current, const char * expected) + { + std::string value(current.data(), current.size()); + if (value.rfind(expected, 0) != 0) + { + Exit(std::string(itemName) + " (\"" + value + "\") does not starts with: \"" + std::string(expected) + "\""); + return false; + } + + return true; + } + + bool CheckConstraintEndsWith(const char * itemName, const chip::CharSpan current, const char * expected) + { + std::string value(current.data(), current.size()); + if (value.find(expected, value.size() - strlen(expected)) == std::string::npos) + { + Exit(std::string(itemName) + " (\"" + value + "\") does not ends with: \"" + std::string(expected) + "\""); + return false; + } + + return true; + } + + template + bool CheckConstraintMinValue(const char * itemName, T current, T expected) + { + if (current < expected) + { + Exit(std::string(itemName) + " value < minValue: " + std::to_string(current) + " < " + std::to_string(expected)); + return false; + } + + return true; + } + + template + bool CheckConstraintMinValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) + { + if (current.IsNull()) + { + return true; + } + return CheckConstraintMinValue(itemName, current.Value(), static_cast(expected)); + } + + template + bool CheckConstraintMaxValue(const char * itemName, T current, T expected) + { + if (current > expected) + { + Exit(std::string(itemName) + " value > maxValue: " + std::to_string(current) + " > " + std::to_string(expected)); + return false; + } + + return true; + } + + template + bool CheckConstraintMaxValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) + { + if (current.IsNull()) + { + return true; + } + return CheckConstraintMaxValue(itemName, current.Value(), static_cast(expected)); + } + + template + bool CheckConstraintNotValue(const char * itemName, T current, U expected) + { + if (current == expected) + { + Exit(std::string(itemName) + " got unexpected value: " + std::to_string(current)); + return false; + } + + return true; + } + + template + bool CheckConstraintNotValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) + { + if (current.IsNull()) + { + return true; + } + return CheckConstraintNotValue(itemName, current.Value(), expected); + } + + bool CheckConstraintNotValue(const char * itemName, const chip::CharSpan current, const chip::CharSpan expected) + { + if (current.data_equal(expected)) + { + Exit(std::string(itemName) + " got unexpected value: " + std::string(current.data(), current.size())); + return false; + } + + return true; + } + + bool CheckConstraintNotValue(const char * itemName, const chip::ByteSpan current, const chip::ByteSpan expected) + { + if (current.data_equal(expected)) + { + Exit(std::string(itemName) + " got unexpected value of size: " + std::to_string(current.size())); + return false; + } + + return true; + } +}; diff --git a/src/app/tests/suites/include/PICSChecker.h b/src/app/tests/suites/include/PICSChecker.h new file mode 100644 index 00000000000000..28c07af5a94482 --- /dev/null +++ b/src/app/tests/suites/include/PICSChecker.h @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +#include + +class PICSChecker +{ +public: + bool ShouldSkip(const char * expression) + { + // If there is no PICS configuration file, considers that nothing should be skipped. + if (!PICS.HasValue()) + { + return false; + } + + std::map pics(PICS.Value()); + bool shouldSkip = !PICSBooleanExpressionParser::Eval(expression, pics); + if (shouldSkip) + { + ChipLogProgress(chipTool, " **** Skipping: %s == false\n", expression); + } + return shouldSkip; + } + + chip::Optional> PICS; +}; diff --git a/src/app/tests/suites/include/ValueChecker.h b/src/app/tests/suites/include/ValueChecker.h new file mode 100644 index 00000000000000..8c6ea93e64a157 --- /dev/null +++ b/src/app/tests/suites/include/ValueChecker.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include + +#include +#include + +class ValueChecker +{ +public: + ValueChecker(){}; + virtual ~ValueChecker(){}; + +protected: + virtual void Exit(std::string message) = 0; + + bool CheckValueAsString(const char * itemName, chip::ByteSpan current, chip::ByteSpan expected) + { + if (!current.data_equal(expected)) + { + Exit(std::string(itemName) + " value mismatch, expecting " + + std::string(chip::Uint8::to_const_char(expected.data()), expected.size())); + return false; + } + + return true; + } + + bool CheckValueAsString(const char * itemName, chip::CharSpan current, chip::CharSpan expected) + { + if (!current.data_equal(expected)) + { + Exit(std::string(itemName) + " value mismatch, expected '" + std::string(expected.data(), expected.size()) + + "' but got '" + std::string(current.data(), current.size()) + "'"); + return false; + } + + return true; + } + + // Allow a different expected type from the actual value type, because if T + // is short the literal we are using is not short-typed. + template ::value, int> = 0> + bool CheckValue(const char * itemName, T current, U expected) + { + if (current != expected) + { + Exit(std::string(itemName) + " value mismatch: expected " + std::to_string(expected) + " but got " + + std::to_string(current)); + return false; + } + + return true; + } + + template ::value, int> = 0> + bool CheckValue(const char * itemName, T current, U expected) + { + return CheckValue(itemName, chip::to_underlying(current), expected); + } + + template + bool CheckValue(const char * itemName, chip::BitFlags current, U expected) + { + return CheckValue(itemName, current.Raw(), expected); + } + + template + bool CheckValuePresent(const char * itemName, const chip::Optional & value) + { + if (value.HasValue()) + { + return true; + } + + Exit(std::string(itemName) + " expected to have value but doesn't"); + return false; + } + + template + bool CheckValueNull(const char * itemName, const chip::app::DataModel::Nullable & value) + { + if (value.IsNull()) + { + return true; + } + + Exit(std::string(itemName) + " expected to be null but isn't"); + return false; + } + + template + bool CheckValueNonNull(const char * itemName, const chip::app::DataModel::Nullable & value) + { + if (!value.IsNull()) + { + return true; + } + + Exit(std::string(itemName) + " expected to not be null but is"); + return false; + } + + /** + * Check that the next list item, which is at index "index", exists and + * decodes properly. + */ + template + bool CheckNextListItemDecodes(const char * listName, typename std::remove_reference_t::Iterator & iter, size_t index) + { + bool hasValue = iter.Next(); + if (iter.GetStatus() != CHIP_NO_ERROR) + { + Exit(std::string(listName) + " value mismatch: error '" + iter.GetStatus().AsString() + "'decoding item at index " + + std::to_string(index)); + return false; + } + + if (hasValue) + { + return true; + } + + Exit(std::string(listName) + " value mismatch: should have value at index " + std::to_string(index) + + " but doesn't (actual value too short)"); + return false; + } + + /** + * Check that there are no more list items now that we have seen + * "expectedCount" of them. + */ + template + bool CheckNoMoreListItems(const char * listName, typename std::remove_reference_t::Iterator & iter, + size_t expectedCount) + { + bool hasValue = iter.Next(); + if (iter.GetStatus() != CHIP_NO_ERROR) + { + Exit(std::string(listName) + " value mismatch: error '" + iter.GetStatus().AsString() + + "'decoding item after we have seen " + std::to_string(expectedCount) + " items"); + return false; + } + + if (!hasValue) + { + return true; + } + + Exit(std::string(listName) + " value mismatch: expected only " + std::to_string(expectedCount) + + " items, but have more than that (actual value too long)"); + return false; + } +}; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 11bde29340c432..8169cedb2573b5 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -830,35 +830,75 @@ class Test_TC_BI_2_2 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads PresentValue attribute from DUT\n"); - err = ShouldSkip("A_PRESENTVALUE") ? CHIP_NO_ERROR : TestReadsPresentValueAttributeFromDut_1(); + if (ShouldSkip("A_PRESENTVALUE")) + { + NextTest(); + return; + } + err = TestReadsPresentValueAttributeFromDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Reads OutOfService attribute from DUT\n"); - err = ShouldSkip("A_OUTOFSERVICE") ? CHIP_NO_ERROR : TestReadsOutOfServiceAttributeFromDut_2(); + if (ShouldSkip("A_OUTOFSERVICE")) + { + NextTest(); + return; + } + err = TestReadsOutOfServiceAttributeFromDut_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_3(); + if (ShouldSkip("A_STATUSFLAGS")) + { + NextTest(); + return; + } + err = TestReadsStatusFlagsAttributeFromDut_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Reads PresentValue attribute from DUT\n"); - err = ShouldSkip("A_PRESENTVALUE") ? CHIP_NO_ERROR : TestReadsPresentValueAttributeFromDut_4(); + if (ShouldSkip("A_PRESENTVALUE")) + { + NextTest(); + return; + } + err = TestReadsPresentValueAttributeFromDut_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Reads OutOfService attribute from DUT\n"); - err = ShouldSkip("A_OUTOFSERVICE") ? CHIP_NO_ERROR : TestReadsOutOfServiceAttributeFromDut_5(); + if (ShouldSkip("A_OUTOFSERVICE")) + { + NextTest(); + return; + } + err = TestReadsOutOfServiceAttributeFromDut_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_6(); + if (ShouldSkip("A_STATUSFLAGS")) + { + NextTest(); + return; + } + err = TestReadsStatusFlagsAttributeFromDut_6(); break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_7(); + if (ShouldSkip("A_STATUSFLAGS")) + { + NextTest(); + return; + } + err = TestReadsStatusFlagsAttributeFromDut_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Reads StatusFlags attribute from DUT\n"); - err = ShouldSkip("A_STATUSFLAGS") ? CHIP_NO_ERROR : TestReadsStatusFlagsAttributeFromDut_8(); + if (ShouldSkip("A_STATUSFLAGS")) + { + NextTest(); + return; + } + err = TestReadsStatusFlagsAttributeFromDut_8(); break; } @@ -12032,80 +12072,174 @@ class Test_TC_CC_9_1 : public TestCommand break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_3(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_4(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_5(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_6(); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_6(); break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_7(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Read ColorLoopTime attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_8(); + if (ShouldSkip("A_COLORLOOPTIME")) + { + NextTest(); + return; + } + err = TestReadColorLoopTimeAttributeFromDut_8(); break; case 9: ChipLogProgress(chipTool, " ***** Test Step 9 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_9(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_9(); break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Read ColorLoopStartEnhancedHue attribute from DUT\n"); - err = - ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE") ? CHIP_NO_ERROR : TestReadColorLoopStartEnhancedHueAttributeFromDut_10(); + if (ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStartEnhancedHueAttributeFromDut_10(); break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_11(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_12(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_12(); break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_13(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_13(); break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_14(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_14(); break; case 15: ChipLogProgress(chipTool, " ***** Test Step 15 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_15(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_15(); break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_16(); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_16(); break; case 17: ChipLogProgress(chipTool, " ***** Test Step 17 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_17(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_17(); break; case 18: ChipLogProgress(chipTool, " ***** Test Step 18 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_18(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_18(); break; case 19: ChipLogProgress(chipTool, " ***** Test Step 19 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_19(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_19(); break; case 20: ChipLogProgress(chipTool, " ***** Test Step 20 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_20(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_20(); break; case 21: ChipLogProgress(chipTool, " ***** Test Step 21 : Enhanced Move To Hue command 10\n"); - err = ShouldSkip("CR_ENHANCEDMOVETOHUE") ? CHIP_NO_ERROR : TestEnhancedMoveToHueCommand10_21(); + if (ShouldSkip("CR_ENHANCEDMOVETOHUE")) + { + NextTest(); + return; + } + err = TestEnhancedMoveToHueCommand10_21(); break; case 22: ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 2000ms\n"); @@ -12113,55 +12247,120 @@ class Test_TC_CC_9_1 : public TestCommand break; case 23: ChipLogProgress(chipTool, " ***** Test Step 23 : Read EnhancedCurrentHue attribute from DUT\n"); - err = ShouldSkip("A_ENHANCEDCURRENTHUE") ? CHIP_NO_ERROR : TestReadEnhancedCurrentHueAttributeFromDut_23(); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + { + NextTest(); + return; + } + err = TestReadEnhancedCurrentHueAttributeFromDut_23(); break; case 24: ChipLogProgress(chipTool, " ***** Test Step 24 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_24(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_24(); break; case 25: ChipLogProgress(chipTool, " ***** Test Step 25 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_25(); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_25(); break; case 26: ChipLogProgress(chipTool, " ***** Test Step 26 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_26(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_26(); break; case 27: ChipLogProgress(chipTool, " ***** Test Step 27 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_27(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_27(); break; case 28: ChipLogProgress(chipTool, " ***** Test Step 28 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_28(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_28(); break; case 29: ChipLogProgress(chipTool, " ***** Test Step 29 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_29(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_29(); break; case 30: ChipLogProgress(chipTool, " ***** Test Step 30 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_30(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_30(); break; case 31: ChipLogProgress(chipTool, " ***** Test Step 31 : Read ColorLoopDirection attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_31(); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_31(); break; case 32: ChipLogProgress(chipTool, " ***** Test Step 32 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_32(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_32(); break; case 33: ChipLogProgress(chipTool, " ***** Test Step 33 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_33(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_33(); break; case 34: ChipLogProgress(chipTool, " ***** Test Step 34 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_34(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_34(); break; case 35: ChipLogProgress(chipTool, " ***** Test Step 35 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_35(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_35(); break; case 36: ChipLogProgress(chipTool, " ***** Test Step 36 : Turn Off light for color control tests\n"); @@ -13283,47 +13482,102 @@ class Test_TC_CC_9_2 : public TestCommand break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_3(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_4(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Read ColorLoopDirection attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_5(); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Read ColorLoopTime attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_6(); + if (ShouldSkip("A_COLORLOOPTIME")) + { + NextTest(); + return; + } + err = TestReadColorLoopTimeAttributeFromDut_6(); break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Read ColorLoopStartEnhancedHue attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE") ? CHIP_NO_ERROR : TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); + if (ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandSetAllAttributes_8(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandSetAllAttributes_8(); break; case 9: ChipLogProgress(chipTool, " ***** Test Step 9 : Read ColorLoopActive attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_9(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_9(); break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_10(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandStartColorLoop_10(); break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopDirection attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_11(); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_12(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandStartColorLoop_12(); break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_13(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_13(); break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light for color control tests\n"); @@ -13811,47 +14065,102 @@ class Test_TC_CC_9_3 : public TestCommand break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Sends ColorLoopSet Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestSendsColorLoopSetCommandSetAllAttributes_3(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_4(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Read ColorLoopDirection attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPDIRECTION") ? CHIP_NO_ERROR : TestReadColorLoopDirectionAttributeFromDut_5(); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Read ColorLoopTime attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_6(); + if (ShouldSkip("A_COLORLOOPTIME")) + { + NextTest(); + return; + } + err = TestReadColorLoopTimeAttributeFromDut_6(); break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Read ColorLoopStartEnhancedHue attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE") ? CHIP_NO_ERROR : TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); + if (ShouldSkip("A_COLORLOOPSTARTENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStartEnhancedHueAttributeFromDut_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Set all Attributes\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandSetAllAttributes_8(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandSetAllAttributes_8(); break; case 9: ChipLogProgress(chipTool, " ***** Test Step 9 : Read ColorLoopActive attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_9(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_9(); break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_10(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandStartColorLoop_10(); break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopTime attribute from DUT.\n"); - err = ShouldSkip("A_COLORLOOPTIME") ? CHIP_NO_ERROR : TestReadColorLoopTimeAttributeFromDut_11(); + if (ShouldSkip("A_COLORLOOPTIME")) + { + NextTest(); + return; + } + err = TestReadColorLoopTimeAttributeFromDut_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Start Color Loop\n"); - err = ShouldSkip("CR_COLORLOOPSET") ? CHIP_NO_ERROR : TestColorLoopSetCommandStartColorLoop_12(); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandStartColorLoop_12(); break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopActive attribute from DUT\n"); - err = ShouldSkip("A_COLORLOOPACTIVE") ? CHIP_NO_ERROR : TestReadColorLoopActiveAttributeFromDut_13(); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_13(); break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light for color control tests\n"); @@ -14765,11 +15074,21 @@ class Test_TC_DM_1_1 : public TestCommand break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Query ManufacturingDate\n"); - err = ShouldSkip("MANF_DATE") ? CHIP_NO_ERROR : TestQueryManufacturingDate_12(); + if (ShouldSkip("MANF_DATE")) + { + NextTest(); + return; + } + err = TestQueryManufacturingDate_12(); break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Query PartNumber\n"); - err = ShouldSkip("PART_NUM") ? CHIP_NO_ERROR : TestQueryPartNumber_13(); + if (ShouldSkip("PART_NUM")) + { + NextTest(); + return; + } + err = TestQueryPartNumber_13(); break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Query ProductURL\n"); @@ -20002,11 +20321,21 @@ class Test_TC_OCC_2_2 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads Occupancy attribute from DUT\n"); - err = ShouldSkip("A_OCCUPANCY") ? CHIP_NO_ERROR : TestReadsOccupancyAttributeFromDut_1(); + if (ShouldSkip("A_OCCUPANCY")) + { + NextTest(); + return; + } + err = TestReadsOccupancyAttributeFromDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Reads Occupancy attribute from DUT\n"); - err = ShouldSkip("A_OCCUPANCY") ? CHIP_NO_ERROR : TestReadsOccupancyAttributeFromDut_2(); + if (ShouldSkip("A_OCCUPANCY")) + { + NextTest(); + return; + } + err = TestReadsOccupancyAttributeFromDut_2(); break; } @@ -21527,7 +21856,12 @@ class Test_TC_OO_2_3 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_1(); + if (ShouldSkip("CR_ON")) + { + NextTest(); + return; + } + err = TestSendOnCommand_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Wait 1000ms\n"); @@ -21535,15 +21869,30 @@ class Test_TC_OO_2_3 : public TestCommand break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_3(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Reads GlobalSceneControl attribute from DUT\n"); - err = ShouldSkip("A_GLOBALSCENECONTROL") ? CHIP_NO_ERROR : TestReadsGlobalSceneControlAttributeFromDut_4(); + if (ShouldSkip("A_GLOBALSCENECONTROL")) + { + NextTest(); + return; + } + err = TestReadsGlobalSceneControlAttributeFromDut_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_5(); + if (ShouldSkip("CR_ON")) + { + NextTest(); + return; + } + err = TestSendOnCommand_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 1000ms\n"); @@ -21551,15 +21900,30 @@ class Test_TC_OO_2_3 : public TestCommand break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_7(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Reads GlobalSceneControl attribute from DUT\n"); - err = ShouldSkip("A_GLOBALSCENECONTROL") ? CHIP_NO_ERROR : TestReadsGlobalSceneControlAttributeFromDut_8(); + if (ShouldSkip("A_GLOBALSCENECONTROL")) + { + NextTest(); + return; + } + err = TestReadsGlobalSceneControlAttributeFromDut_8(); break; case 9: ChipLogProgress(chipTool, " ***** Test Step 9 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_9(); + if (ShouldSkip("CR_ON")) + { + NextTest(); + return; + } + err = TestSendOnCommand_9(); break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 1000ms\n"); @@ -21567,147 +21931,327 @@ class Test_TC_OO_2_3 : public TestCommand break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_11(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Reads GlobalSceneControl attribute from DUT\n"); - err = ShouldSkip("A_GLOBALSCENECONTROL") ? CHIP_NO_ERROR : TestReadsGlobalSceneControlAttributeFromDut_12(); + if (ShouldSkip("A_GLOBALSCENECONTROL")) + { + NextTest(); + return; + } + err = TestReadsGlobalSceneControlAttributeFromDut_12(); break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_13(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_13(); break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_14(); + if (ShouldSkip("A_OFFWAITTIME")) + { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_14(); break; case 15: ChipLogProgress(chipTool, " ***** Test Step 15 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_15(); + if (ShouldSkip("CR_ON")) + { + NextTest(); + return; + } + err = TestSendOnCommand_15(); break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_16(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_16(); break; case 17: ChipLogProgress(chipTool, " ***** Test Step 17 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_17(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_17(); break; case 18: ChipLogProgress(chipTool, " ***** Test Step 18 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_18(); + if (ShouldSkip("A_OFFWAITTIME")) + { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_18(); break; case 19: ChipLogProgress(chipTool, " ***** Test Step 19 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_19(); + if (ShouldSkip("CR_OFF")) + { + NextTest(); + return; + } + err = TestSendOffCommand_19(); break; case 20: ChipLogProgress(chipTool, " ***** Test Step 20 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_20(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_20(); break; case 21: ChipLogProgress(chipTool, " ***** Test Step 21 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_21(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_21(); break; case 22: ChipLogProgress(chipTool, " ***** Test Step 22 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_22(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_22(); break; case 23: ChipLogProgress(chipTool, " ***** Test Step 23 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_23(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_23(); break; case 24: ChipLogProgress(chipTool, " ***** Test Step 24 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_24(); + if (ShouldSkip("A_OFFWAITTIME")) + { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_24(); break; case 25: ChipLogProgress(chipTool, " ***** Test Step 25 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_25(); + if (ShouldSkip("CR_ON")) + { + NextTest(); + return; + } + err = TestSendOnCommand_25(); break; case 26: ChipLogProgress(chipTool, " ***** Test Step 26 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_26(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_26(); break; case 27: ChipLogProgress(chipTool, " ***** Test Step 27 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_27(); + if (ShouldSkip("A_OFFWAITTIME")) + { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_27(); break; case 28: ChipLogProgress(chipTool, " ***** Test Step 28 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_28(); + if (ShouldSkip("CR_OFF")) + { + NextTest(); + return; + } + err = TestSendOffCommand_28(); break; case 29: ChipLogProgress(chipTool, " ***** Test Step 29 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_29(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_29(); break; case 30: ChipLogProgress(chipTool, " ***** Test Step 30 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_30(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_30(); break; case 31: ChipLogProgress(chipTool, " ***** Test Step 31 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_31(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_31(); break; case 32: ChipLogProgress(chipTool, " ***** Test Step 32 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_32(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_32(); break; case 33: ChipLogProgress(chipTool, " ***** Test Step 33 : Send On Command\n"); - err = ShouldSkip("CR_ON") ? CHIP_NO_ERROR : TestSendOnCommand_33(); + if (ShouldSkip("CR_ON")) + { + NextTest(); + return; + } + err = TestSendOnCommand_33(); break; case 34: ChipLogProgress(chipTool, " ***** Test Step 34 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_34(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_34(); break; case 35: ChipLogProgress(chipTool, " ***** Test Step 35 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_35(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_35(); break; case 36: ChipLogProgress(chipTool, " ***** Test Step 36 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_36(); + if (ShouldSkip("A_OFFWAITTIME")) + { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_36(); break; case 37: ChipLogProgress(chipTool, " ***** Test Step 37 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_37(); + if (ShouldSkip("CR_OFF")) + { + NextTest(); + return; + } + err = TestSendOffCommand_37(); break; case 38: ChipLogProgress(chipTool, " ***** Test Step 38 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_38(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_38(); break; case 39: ChipLogProgress(chipTool, " ***** Test Step 39 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_39(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_39(); break; case 40: ChipLogProgress(chipTool, " ***** Test Step 40 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_40(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_40(); break; case 41: ChipLogProgress(chipTool, " ***** Test Step 41 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_41(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_41(); break; case 42: ChipLogProgress(chipTool, " ***** Test Step 42 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_42(); + if (ShouldSkip("A_OFFWAITTIME")) + { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_42(); break; case 43: ChipLogProgress(chipTool, " ***** Test Step 43 : Reads OnOff attribute from DUT\n"); - err = ShouldSkip("A_ONOFF") ? CHIP_NO_ERROR : TestReadsOnOffAttributeFromDut_43(); + if (ShouldSkip("A_ONOFF")) + { + NextTest(); + return; + } + err = TestReadsOnOffAttributeFromDut_43(); break; case 44: ChipLogProgress(chipTool, " ***** Test Step 44 : Reads OnTime attribute from DUT\n"); - err = ShouldSkip("A_ONTIME") ? CHIP_NO_ERROR : TestReadsOnTimeAttributeFromDut_44(); + if (ShouldSkip("A_ONTIME")) + { + NextTest(); + return; + } + err = TestReadsOnTimeAttributeFromDut_44(); break; case 45: ChipLogProgress(chipTool, " ***** Test Step 45 : Reads OffWaitTime attribute from DUT\n"); - err = ShouldSkip("A_OFFWAITTIME") ? CHIP_NO_ERROR : TestReadsOffWaitTimeAttributeFromDut_45(); + if (ShouldSkip("A_OFFWAITTIME")) + { + NextTest(); + return; + } + err = TestReadsOffWaitTimeAttributeFromDut_45(); break; case 46: ChipLogProgress(chipTool, " ***** Test Step 46 : Send Off Command\n"); - err = ShouldSkip("CR_OFF") ? CHIP_NO_ERROR : TestSendOffCommand_46(); + if (ShouldSkip("CR_OFF")) + { + NextTest(); + return; + } + err = TestSendOffCommand_46(); break; } @@ -25530,15 +26074,30 @@ class Test_TC_PCC_2_2 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the OperationMode attribute to DUT: OperationMode\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite2ToTheOperationModeAttributeToDutOperationMode_2(); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite3ToTheOperationModeAttributeToDutOperationMode_3(); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_3(); break; } @@ -25685,39 +26244,84 @@ class Test_TC_PCC_2_3 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Write 0 to the OperationMode attribute to DUT\n"); - err = ShouldSkip("A_OPERATIONMODE") ? CHIP_NO_ERROR : TestWrite0ToTheOperationModeAttributeToDut_1(); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite0ToTheOperationModeAttributeToDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); - err = ShouldSkip("A_EFFECTIVEOPERATIONMODE") ? CHIP_NO_ERROR : TestReadsTheAttributeEffectiveOperationMode_2(); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Write 0 to the ControlMode attribute to DUT\n"); - err = ShouldSkip("A_CONTROLMODE") ? CHIP_NO_ERROR : TestWrite0ToTheControlModeAttributeToDut_3(); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite0ToTheControlModeAttributeToDut_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveControlMode\n"); - err = ShouldSkip("A_EFFECTIVECONTROLMODE") ? CHIP_NO_ERROR : TestReadsTheAttributeEffectiveControlMode_4(); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Write 1 to the ControlMode attribute to DUT\n"); - err = ShouldSkip("A_CONTROLMODE") ? CHIP_NO_ERROR : TestWrite1ToTheControlModeAttributeToDut_5(); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite1ToTheControlModeAttributeToDut_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Write 2 to the ControlMode attribute to DUT\n"); - err = ShouldSkip("A_CONTROLMODE") ? CHIP_NO_ERROR : TestWrite2ToTheControlModeAttributeToDut_6(); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite2ToTheControlModeAttributeToDut_6(); break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Write 3 to the ControlMode attribute to DUT\n"); - err = ShouldSkip("A_CONTROLMODE") ? CHIP_NO_ERROR : TestWrite3ToTheControlModeAttributeToDut_7(); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite3ToTheControlModeAttributeToDut_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Write 5 to the ControlMode attribute to DUT\n"); - err = ShouldSkip("A_CONTROLMODE") ? CHIP_NO_ERROR : TestWrite5ToTheControlModeAttributeToDut_8(); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite5ToTheControlModeAttributeToDut_8(); break; case 9: ChipLogProgress(chipTool, " ***** Test Step 9 : Write 7 to the ControlMode attribute to DUT\n"); - err = ShouldSkip("A_CONTROLMODE") ? CHIP_NO_ERROR : TestWrite7ToTheControlModeAttributeToDut_9(); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite7ToTheControlModeAttributeToDut_9(); break; } @@ -26374,11 +26978,21 @@ class Test_TC_RH_2_2 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads MeasuredValue attribute from DUT\n"); - err = ShouldSkip("A_RELATIVEHUMIDITY") ? CHIP_NO_ERROR : TestReadsMeasuredValueAttributeFromDut_1(); + if (ShouldSkip("A_RELATIVEHUMIDITY")) + { + NextTest(); + return; + } + err = TestReadsMeasuredValueAttributeFromDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MeasuredValue\n"); - err = ShouldSkip("A_RELATIVEHUMIDITY") ? CHIP_NO_ERROR : TestReadTheMandatoryAttributeMeasuredValue_2(); + if (ShouldSkip("A_RELATIVEHUMIDITY")) + { + NextTest(); + return; + } + err = TestReadTheMandatoryAttributeMeasuredValue_2(); break; } @@ -26847,11 +27461,21 @@ class Test_TC_TM_2_2 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads MeasuredValue attribute from DUT\n"); - err = ShouldSkip("A_TEMPERATURE") ? CHIP_NO_ERROR : TestReadsMeasuredValueAttributeFromDut_1(); + if (ShouldSkip("A_TEMPERATURE")) + { + NextTest(); + return; + } + err = TestReadsMeasuredValueAttributeFromDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MeasuredValue\n"); - err = ShouldSkip("A_TEMPERATURE") ? CHIP_NO_ERROR : TestReadTheMandatoryAttributeMeasuredValue_2(); + if (ShouldSkip("A_TEMPERATURE")) + { + NextTest(); + return; + } + err = TestReadTheMandatoryAttributeMeasuredValue_2(); break; } @@ -29284,344 +29908,509 @@ class Test_TC_TSTAT_2_2 : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 1 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the " "value is within range\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsOccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_1(); break; case 2: ChipLogProgress( chipTool, " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForOccupiedCoolingSetpointAttribute_2(); break; case 3: ChipLogProgress( chipTool, " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedCoolingSetpointAttribute_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the " "value is within range\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_6(); break; case 7: ChipLogProgress( chipTool, " ***** Test Step 7 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_7(); break; case 8: ChipLogProgress( chipTool, " ***** Test Step 8 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_8(); break; case 9: ChipLogProgress(chipTool, " ***** Test Step 9 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_9(); break; case 10: ChipLogProgress( chipTool, " ***** Test Step 10 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_10(); break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the " "value is within range\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_11(); break; case 12: ChipLogProgress( chipTool, " ***** Test Step 12 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_12(); break; case 13: ChipLogProgress( chipTool, " ***** Test Step 13 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_13(); break; case 14: ChipLogProgress( chipTool, " ***** Test Step 14 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_14(); break; case 15: ChipLogProgress( chipTool, " ***** Test Step 15 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_15(); break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the " "value is within range\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16(); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_16(); break; case 17: ChipLogProgress( chipTool, " ***** Test Step 17 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17(); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_17(); break; case 18: ChipLogProgress( chipTool, " ***** Test Step 18 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18(); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_18(); break; case 19: ChipLogProgress( chipTool, " ***** Test Step 19 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19(); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_19(); break; case 20: ChipLogProgress( chipTool, " ***** Test Step 20 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20(); + if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_20(); break; case 21: ChipLogProgress(chipTool, " ***** Test Step 21 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the " "value is within range\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21(); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_21(); break; case 22: ChipLogProgress( chipTool, " ***** Test Step 22 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22(); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_22(); break; case 23: ChipLogProgress( chipTool, " ***** Test Step 23 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23(); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_23(); break; case 24: ChipLogProgress( chipTool, " ***** Test Step 24 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24(); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_24(); break; case 25: ChipLogProgress(chipTool, " ***** Test Step 25 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25(); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_25(); break; case 26: ChipLogProgress(chipTool, " ***** Test Step 26 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the " "value is within range\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26(); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_26(); break; case 27: ChipLogProgress( chipTool, " ***** Test Step 27 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27(); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_27(); break; case 28: ChipLogProgress( chipTool, " ***** Test Step 28 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28(); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_28(); break; case 29: ChipLogProgress( chipTool, " ***** Test Step 29 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29(); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_29(); break; case 30: ChipLogProgress(chipTool, " ***** Test Step 30 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30(); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_30(); break; case 31: ChipLogProgress( chipTool, " ***** Test Step 31 : Writes (sets back) the limit of MinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_31(); break; case 32: ChipLogProgress( chipTool, " ***** Test Step 32 : Writes (sets back) the limit of MaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_32(); break; case 33: ChipLogProgress( chipTool, " ***** Test Step 33 : Writes (sets back) the limit of MinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_33(); break; case 34: ChipLogProgress( chipTool, " ***** Test Step 34 : Writes (sets back) the limit of MaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - err = ShouldSkip("A_MINHEATSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34(); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_34(); break; case 35: ChipLogProgress( chipTool, " ***** Test Step 35 : Writes (sets back) the limit of MinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35(); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_35(); break; case 36: ChipLogProgress( chipTool, " ***** Test Step 36 : Writes (sets back) the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MINCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36(); + if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_36(); break; case 37: ChipLogProgress( chipTool, " ***** Test Step 37 : Writes (sets back) the limit of MinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37(); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_37(); break; case 38: ChipLogProgress( chipTool, " ***** Test Step 38 : Writes (sets back) the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - err = ShouldSkip("A_MAXCOOLSETPOINTLIMIT") - ? CHIP_NO_ERROR - : TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38(); + if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) + { + NextTest(); + return; + } + err = TestWritesSetsBackTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_38(); break; case 39: ChipLogProgress( chipTool, " ***** Test Step 39 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); - err = ShouldSkip("A_CONTROLSEQUENCEOFOPERATION") - ? CHIP_NO_ERROR - : TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39(); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) + { + NextTest(); + return; + } + err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_39(); break; case 40: ChipLogProgress( chipTool, " ***** Test Step 40 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); - err = ShouldSkip("A_CONTROLSEQUENCEOFOPERATION") - ? CHIP_NO_ERROR - : TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40(); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) + { + NextTest(); + return; + } + err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_40(); break; case 41: ChipLogProgress(chipTool, " ***** Test Step 41 : Read it back again to confirm the successful write\n"); - err = ShouldSkip("A_CONTROLSEQUENCEOFOPERATION") ? CHIP_NO_ERROR : TestReadItBackAgainToConfirmTheSuccessfulWrite_41(); + if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) + { + NextTest(); + return; + } + err = TestReadItBackAgainToConfirmTheSuccessfulWrite_41(); break; case 42: ChipLogProgress(chipTool, " ***** Test Step 42 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_42(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_42(); break; case 43: ChipLogProgress(chipTool, " ***** Test Step 43 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_43(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_43(); break; case 44: ChipLogProgress(chipTool, " ***** Test Step 44 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_44(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_44(); break; case 45: ChipLogProgress(chipTool, " ***** Test Step 45 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_45(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_45(); break; case 46: ChipLogProgress(chipTool, " ***** Test Step 46 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_46(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_46(); break; case 47: ChipLogProgress(chipTool, " ***** Test Step 47 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_47(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_47(); break; case 48: ChipLogProgress(chipTool, " ***** Test Step 48 : Sets OccupiedCoolingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedCoolingSetpointToDefaultValue_48(); + if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_48(); break; case 49: ChipLogProgress(chipTool, " ***** Test Step 49 : Sets OccupiedHeatingSetpoint to default value\n"); - err = ShouldSkip("A_OCCUPIEDHEATINGSETPOINT") ? CHIP_NO_ERROR : TestSetsOccupiedHeatingSetpointToDefaultValue_49(); + if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) + { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_49(); break; } @@ -31702,51 +32491,95 @@ class Test_TC_TSUIC_2_2 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Writes a value of 0 to TemperatureDisplayMode attribute of DUT\n"); - err = ShouldSkip("A_TEMPERATURE_DISPLAY_MODE") ? CHIP_NO_ERROR - : TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1(); + if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) + { + NextTest(); + return; + } + err = TestWritesAValueOf0ToTemperatureDisplayModeAttributeOfDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value of 1 to TemperatureDisplayMode attribute of DUT\n"); - err = ShouldSkip("A_TEMPERATURE_DISPLAY_MODE") ? CHIP_NO_ERROR - : TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2(); + if (ShouldSkip("A_TEMPERATURE_DISPLAY_MODE")) + { + NextTest(); + return; + } + err = TestWritesAValueOf1ToTemperatureDisplayModeAttributeOfDut_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Writes a value of 0 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3(); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf0ToKeypadLockoutAttributeOfDut_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Writes a value of 1 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4(); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf1ToKeypadLockoutAttributeOfDut_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Writes a value of 2 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5(); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf2ToKeypadLockoutAttributeOfDut_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Writes a value of 3 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6(); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf3ToKeypadLockoutAttributeOfDut_6(); break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Writes a value of 4 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7(); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf4ToKeypadLockoutAttributeOfDut_7(); break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Writes a value of 5 to KeypadLockout attribute of DUT\n"); - err = ShouldSkip("A_KEYPAD_LOCKOUT") ? CHIP_NO_ERROR : TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8(); + if (ShouldSkip("A_KEYPAD_LOCKOUT")) + { + NextTest(); + return; + } + err = TestWritesAValueOf5ToKeypadLockoutAttributeOfDut_8(); break; case 9: ChipLogProgress(chipTool, " ***** Test Step 9 : Writes a value of 0 to ScheduleProgrammingVisibility attribute of DUT\n"); - err = ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY") - ? CHIP_NO_ERROR - : TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9(); + if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) + { + NextTest(); + return; + } + err = TestWritesAValueOf0ToScheduleProgrammingVisibilityAttributeOfDut_9(); break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Writes a value of 1 to ScheduleProgrammingVisibility attribute of DUT\n"); - err = ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY") - ? CHIP_NO_ERROR - : TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10(); + if (ShouldSkip("A_SCHEDULE_PROGRAMMING_VISIBILITY")) + { + NextTest(); + return; + } + err = TestWritesAValueOf1ToScheduleProgrammingVisibilityAttributeOfDut_10(); break; } @@ -34597,11 +35430,21 @@ class Test_TC_WNCV_2_4 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads Type attribute from DUT\n"); - err = ShouldSkip("A_TYPE") ? CHIP_NO_ERROR : TestReadsTypeAttributeFromDut_1(); + if (ShouldSkip("A_TYPE")) + { + NextTest(); + return; + } + err = TestReadsTypeAttributeFromDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Reads Type attribute constraints\n"); - err = ShouldSkip("A_TYPE") ? CHIP_NO_ERROR : TestReadsTypeAttributeConstraints_2(); + if (ShouldSkip("A_TYPE")) + { + NextTest(); + return; + } + err = TestReadsTypeAttributeConstraints_2(); break; } @@ -34730,11 +35573,21 @@ class Test_TC_WNCV_2_5 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads EndProductType attribute from DUT\n"); - err = ShouldSkip("A_ENDPRODUCTTYPE") ? CHIP_NO_ERROR : TestReadsEndProductTypeAttributeFromDut_1(); + if (ShouldSkip("A_ENDPRODUCTTYPE")) + { + NextTest(); + return; + } + err = TestReadsEndProductTypeAttributeFromDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Reads EndProductType attribute constraints from DUT\n"); - err = ShouldSkip("A_ENDPRODUCTTYPE") ? CHIP_NO_ERROR : TestReadsEndProductTypeAttributeConstraintsFromDut_2(); + if (ShouldSkip("A_ENDPRODUCTTYPE")) + { + NextTest(); + return; + } + err = TestReadsEndProductTypeAttributeConstraintsFromDut_2(); break; } @@ -60857,12 +61710,21 @@ class Test_TC_SWDIAG_1_1 : public TestCommand break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapUsed non-global attribute value from DUT\n"); - err = ShouldSkip("A_CURRENTHEAPUSED") ? CHIP_NO_ERROR : TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_2(); + if (ShouldSkip("A_CURRENTHEAPUSED")) + { + NextTest(); + return; + } + err = TestReadsCurrentHeapUsedNonGlobalAttributeValueFromDut_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHeapHighWaterMark non-global attribute value from DUT\n"); - err = ShouldSkip("A_CURRENTHEAPHIGHWATERMARK") ? CHIP_NO_ERROR - : TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_3(); + if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) + { + NextTest(); + return; + } + err = TestReadsCurrentHeapHighWaterMarkNonGlobalAttributeValueFromDut_3(); break; } @@ -61083,12 +61945,21 @@ class Test_TC_SWDIAG_3_1 : public TestCommand break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Reads CurrentHeapUsed attribute value from DUT\n"); - err = ShouldSkip("A_CURRENTHEAPUSED") ? CHIP_NO_ERROR : TestReadsCurrentHeapUsedAttributeValueFromDut_1(); + if (ShouldSkip("A_CURRENTHEAPUSED")) + { + NextTest(); + return; + } + err = TestReadsCurrentHeapUsedAttributeValueFromDut_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Reads CurrentHeapHighWaterMark attribute value from DUT\n"); - err = ShouldSkip("A_CURRENTHEAPHIGHWATERMARK") ? CHIP_NO_ERROR - : TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_2(); + if (ShouldSkip("A_CURRENTHEAPHIGHWATERMARK")) + { + NextTest(); + return; + } + err = TestReadsCurrentHeapHighWaterMarkAttributeValueFromDut_2(); break; }