Browse Source

usb: host: Ignore asserts in control request handling when testing

Ignore assers in the control request handling when Kconfig option ZTEST
is enabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
pull/82801/merge
Johann Fischer 1 month ago committed by Dan Kalowsky
parent
commit
ebdbfa9541
  1. 3
      subsys/usb/host/usbh_ch9.c

3
subsys/usb/host/usbh_ch9.c

@ -73,7 +73,8 @@ int usbh_req_setup(struct usb_device *const udev, @@ -73,7 +73,8 @@ int usbh_req_setup(struct usb_device *const udev,
memcpy(xfer->setup_pkt, &req, sizeof(req));
__ASSERT((buf != NULL && wLength) || (buf == NULL && !wLength),
__ASSERT(IS_ENABLED(CONFIG_ZTEST) ||
(buf != NULL && wLength) || (buf == NULL && !wLength),
"Unresolved conditions for data stage");
if (wLength) {
ret = usbh_xfer_buf_add(udev, xfer, buf);

Loading…
Cancel
Save