From 90b2aa8c224a3b0f5574108351c805ce3a1df9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Wed, 11 Dec 2024 16:32:24 +0100 Subject: [PATCH] tests: lib: devicetree: api: Add test for DT_PROP_LAST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend test to cover for DT_PROP_LAST. Signed-off-by: Krzysztof Chruściński --- tests/lib/devicetree/api/src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/lib/devicetree/api/src/main.c b/tests/lib/devicetree/api/src/main.c index 55337e7cf3c..5d026d02ffa 100644 --- a/tests/lib/devicetree/api/src/main.c +++ b/tests/lib/devicetree/api/src/main.c @@ -124,6 +124,7 @@ ZTEST(devicetree_api, test_path_props) zassert_equal(DT_PROP_LEN(TEST_DEADBEEF, compatible), 1, ""); zassert_true(!strcmp(DT_PROP_BY_IDX(TEST_DEADBEEF, compatible, 0), "vnd,gpio-device"), ""); + zassert_true(!strcmp(DT_PROP_LAST(TEST_DEADBEEF, compatible), "vnd,gpio-device"), ""); zassert_true(DT_NODE_HAS_PROP(TEST_DEADBEEF, status), ""); zassert_false(DT_NODE_HAS_PROP(TEST_DEADBEEF, foobar), ""); @@ -1637,6 +1638,7 @@ ZTEST(devicetree_api, test_arrays) zassert_equal(DT_PROP_BY_IDX(TEST_ARRAYS, a, 0), a[0], ""); zassert_equal(DT_PROP_BY_IDX(TEST_ARRAYS, a, 1), a[1], ""); zassert_equal(DT_PROP_BY_IDX(TEST_ARRAYS, a, 2), a[2], ""); + zassert_equal(DT_PROP_LAST(TEST_ARRAYS, a), a[2], ""); zassert_equal(DT_PROP_LEN(TEST_ARRAYS, a), 3, "");