Skip to content

Commit 5e7f23f

Browse files
cvinayakjhedberg
authored andcommitted
tests: bsim: Bluetooth: Fail on advertising start error
Add back test failure that was missed when fixing double and redundant advertising start in commit 7a672c0 ("Bluetooth: tests: bsim: Fix double advertising in test_connect2"). Also, relates to commit 8cfad44 ("Bluetooth: Deprecate adv auto-resume"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent bb8e8e9 commit 5e7f23f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/bsim/bluetooth/ll/conn/src/test_connect2.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,20 @@ static int start_advertising(void)
127127
int err;
128128

129129
err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), NULL, 0);
130-
if (err) {
131-
printk("Advertising failed to start (err %d)\n", err);
132-
}
133130

134131
return err;
135132
}
136133

137134
static void recycled(void)
138135
{
139-
start_advertising();
136+
int err;
137+
138+
err = start_advertising();
139+
if (err) {
140+
FAIL("Advertising failed to restart (err %d)\n", err);
141+
} else {
142+
printk("Advertising successfully restarted\n");
143+
}
140144
}
141145

142146
static struct bt_conn_cb conn_callbacks = {
@@ -152,7 +156,9 @@ static void bt_ready(void)
152156
printk("Peripheral Bluetooth initialized\n");
153157

154158
err = start_advertising();
155-
if (!err) {
159+
if (err) {
160+
FAIL("Advertising failed to start (err %d)\n", err);
161+
} else {
156162
printk("Advertising successfully started\n");
157163
}
158164
}

0 commit comments

Comments
 (0)