tests: fix bsim bt l2cap send_on_connect to fail on err < 0

bt_l2cap_chan_send returns the total bytes sent from the buf,
hence test should only fail when it returns a negative error code
and not a positive number of bytes sent.

Signed-off-by: Tom Finet <tom.codeninja@gmail.com>
This commit is contained in:
Tom Finet 2023-08-30 00:06:56 +01:00 committed by Carles Cufí
commit 4474860744

View file

@ -40,7 +40,7 @@ static void chan_connected_cb(struct bt_l2cap_chan *l2cap_chan)
/* Try to send data */
err = bt_l2cap_chan_send(l2cap_chan, buf);
if (err) {
if (err < 0) {
FAIL("Could not send data, error %d\n", err);
}