From 4ab8073b87faf720a1d3716dc1988de9a77b703b Mon Sep 17 00:00:00 2001 From: Jonathan Rico Date: Mon, 26 Aug 2024 14:24:41 +0200 Subject: [PATCH] tests: Bluetooth: disable optimizations in unit test Very very weird behavior. Deleting the `options & BT_LE_ADV_OPT_USE_NRPA` branch in `id.c:bt_id_set_adv_own_addr` makes the test pass. But add a log in that branch, and you'll see that we never take it in the UT binary.. I don't have time for this, maybe some compiler guru or C language lawyer can look at that decompiled function and figure out the root cause. Someone should also really fix the Bluetooth unit tests and make them run on any Bluetooth related PR. Also nightly. Signed-off-by: Jonathan Rico --- tests/bluetooth/host/id/bt_id_set_adv_own_addr/prj.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/bluetooth/host/id/bt_id_set_adv_own_addr/prj.conf b/tests/bluetooth/host/id/bt_id_set_adv_own_addr/prj.conf index 2682cec05b5..95e91d3abd6 100644 --- a/tests/bluetooth/host/id/bt_id_set_adv_own_addr/prj.conf +++ b/tests/bluetooth/host/id/bt_id_set_adv_own_addr/prj.conf @@ -7,3 +7,7 @@ CONFIG_ASSERT=y CONFIG_ASSERT_LEVEL=2 CONFIG_ASSERT_VERBOSE=y CONFIG_ASSERT_ON_ERRORS=y + +# Enabling optimizations will make the test fail. +# Reason is (at the time of writing) unknown. +CONFIG_NO_OPTIMIZATIONS=y