Skip to content

Commit 2396b9c

Browse files
committed
Enable and fix backwards-compatibility tests
1 parent aace21b commit 2396b9c

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

src/BUILD.gn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ if (chip_build_tests) {
161161
]
162162
}
163163

164+
if (chip_device_platform == "darwin" || chip_device_platform == "linux") {
165+
tests += [
166+
# keep-sorted: start
167+
"${chip_root}/src/app/clusters/actions-server/tests:tests-backwards-compatibility",
168+
# keep-sorted: end
169+
]
170+
}
171+
164172
if (current_os != "zephyr") {
165173
# Avoid these items from "one single binary" test executions. Once tests
166174
# are split, we can re-visit this (and likely many others).

src/app/clusters/actions-server/tests/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ chip_test_suite("tests-backwards-compatibility") {
6060
sources += [ "../" + file ]
6161
}
6262

63-
sources += [ "${chip_root}/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp" ]
64-
6563
public_deps = [
6664
"${chip_root}/src/app/clusters/actions-server",
6765
"${chip_root}/src/app/common:cluster-objects",

src/app/clusters/actions-server/tests/TestActionsClusterBackwardCompatability.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,20 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
#include <vector>
19-
2018
#include "lib/support/CHIPMem.h"
2119
#include <app-common/zap-generated/cluster-objects.h>
2220
#include <app/clusters/actions-server/actions-server.h>
21+
22+
// Stub for the ZAP-generated SetupURL::Get accessor. CodegenIntegration.cpp calls this
23+
// at construction time to read the initial URL from Ember RAM. In tests there is no Ember
24+
// storage, so we return an empty string to simulate "attribute not populated".
25+
namespace chip::app::Clusters::Actions::Attributes::SetupURL {
26+
chip::Protocols::InteractionModel::Status Get(chip::EndpointId, chip::MutableCharSpan & value)
27+
{
28+
value.reduce_size(0);
29+
return chip::Protocols::InteractionModel::Status::Success;
30+
}
31+
} // namespace chip::app::Clusters::Actions::Attributes::SetupURL
2332
#include <app/tests/test-ember-api.h>
2433
#include <app/util/attribute-storage.h>
2534
#include <lib/core/ErrorStr.h>

0 commit comments

Comments
 (0)