-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Devicetree: Devicetree Bindings: Add tests for new DT_ENUM_ macros
Test the new c-macros for dt enums. The new macros are already used in the existing macros. As an example, DT_ENUM_IDX(node_id, prop) uses DT_ENUM_IDX_BY_IDX(node_id, prop, 0) to get its result. However, this is insufficient for testing the complete functionality of these macros. Therefore, additional tests are added to make sure they work appropriately for other indices besides 0. (cherry picked from commit 405c671) Original-Signed-off-by: Joel Hirsbrunner <jhirsbrunner@baumer.com> GitOrigin-RevId: 405c671 Cr-Build-Id: 8733565196572304993 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8733565196572304993 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: Ia4a13d25faf8dac1a9e2c1cc424252ea7f15cb17 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5934726 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Dawid Niedźwiecki <dawidn@google.com> Tested-by: Dawid Niedźwiecki <dawidn@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com>
- Loading branch information
1 parent
915b2d1
commit ac58e22
Showing
4 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2020 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: Test enum property container | ||
|
||
compatible: "vnd,enum-int-array-holder" | ||
|
||
include: [base.yaml] | ||
|
||
properties: | ||
val: | ||
type: array | ||
enum: | ||
- 7 | ||
- 6 | ||
- 5 | ||
- 4 | ||
- 3 | ||
- 2 | ||
- 1 | ||
- 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2020 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: Test enum property container | ||
|
||
compatible: "vnd,enum-string-array-holder" | ||
|
||
include: [base.yaml] | ||
|
||
properties: | ||
val: | ||
type: string-array | ||
enum: | ||
- foo | ||
- bar | ||
- baz | ||
- zoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters