Attention is currently required from: Felix Singer, Thomas Heijligen, Alexander Goncharov.
3 comments:
File tests/ch341a_spi.c:
transfer->status = LIBUSB_TRANSFER_COMPLETED;
transfer->actual_length = transfer->length;
transfer->callback(transfer);
*TL;DR* Yeah, it's important step. Without it the code go to an infinite loop. […]
Thank you so much for the detailed explanation, I appreciate a lot!
It is so amazing, you digging deep to find the answer and explain to others!
I understand about callback now, and seems like you found a nice trick to invoke static functions in test (I mean `cb_in` and `cb_out`).
The only thing left is to add a comment in the beginning of `ch341a_libusb_submit_transfer` explaining (in short) that the code would normally be executing as a part of handle_events_timeout, and the test needs to mock that to be able to invoke callback from the programmer and indicate that transfer completed. Something like that.
File tests/libusb_wraps.c:
Commits should only do one thing and not multiple things. I think this commit does two things: […]
Okay I agree on that. Let's say we are introducing this as a default approach from now on.
Joursoir, looks like you need to split the patch into 2. First one will just wraps, which means specifically: io_mock.h, libusb_wraps.h, libusb_wraps.c. And the second patch adding the new test and implementing custom mocks.
You can leave the splitting until the end, when all other comments are resolved. It is easier to modify one large patch locally.
File tests/usb_unittests.h:
Patch Set #5, Line 58: struct libusb_transfer;
Typedefs above are exciting in libusb code. But there's no typedef for `struct libusb_transfer`. […]
Okay I agree, resolved.
To view, visit change 67664. To unsubscribe, or for help writing mail filters, visit settings.