-
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. Signed-off-by: Joel Hirsbrunner <jhirsbrunner@baumer.com>
- Loading branch information
1 parent
ae747c4
commit 405c671
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