pointer length conflict in Unity tests with native_sim

Hello,

In my efforts to upgrade my project from NCS 2.3.0 (with Zephyr 3.2.99) to NCS 2.6.1 (with Zephyr 3.5.99), I'm running into various build issues with Unity unit tests.

I'm running the unit tests with the native_sim board. I'm running this in a WSL environment on a Windows 10 machine.

One thing I'm running into is a width mismatch in TEST_ASSERT_EQUAL() macros on struct device pointers (or probably any pointers), e.g.:

struct device const * const my_pointer = some_value;

TEST_ASSERT_EQUAL(DEVICE_DT_GET(DT_NODELABEL(some_node)), my_pointer);

I get a "cast from pointer to integer of different size" build error, on both of the values being tested against each other.
This is because TEST_ASSERT_EQUAL() casts both values to UNITY_INT.
And, I've ascertained that UNITY_INT in my environment resolves to 64 bits, while the pointers are 32 bits.

How do I resolve this?

Thanks!

Parents Reply Children
No Data
Related