tests: devicetree: add tests for DT_GPARENT/DT_INST_GPARENT

Add some coverage for the DT_GPARENT/DT_INST_GPARENT macros.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2022-11-10 16:01:07 +01:00 committed by Kumar Gala
commit 5710f609c9

View file

@ -1773,6 +1773,15 @@ ZTEST(devicetree_api, test_parent)
TEST_SPI_BUS_0), "");
}
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT vnd_i2c_mux_controller
ZTEST(devicetree_api, test_gparent)
{
zassert_true(DT_SAME_NODE(DT_GPARENT(TEST_I2C_MUX_CTLR_1), TEST_I2C), "");
zassert_true(DT_SAME_NODE(DT_INST_GPARENT(0), TEST_I2C), "");
zassert_true(DT_SAME_NODE(DT_INST_GPARENT(1), TEST_I2C), "");
}
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT vnd_child_bindings
ZTEST(devicetree_api, test_children)