diff options
author | Alexander Goncharov <chat@joursoir.net> | 2022-11-20 11:18:00 +0400 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-11-29 21:01:51 +0000 |
commit | 571a9ac832c0e82e240849862be7a395407276aa (patch) | |
tree | c5e458f3b9633b5bbeaae157a0e3817197563ca1 /tests/libusb_wraps.c | |
parent | de016a17f25c71b4688781c7ca1b611cb9681694 (diff) | |
download | flashrom-571a9ac832c0e82e240849862be7a395407276aa.tar.gz flashrom-571a9ac832c0e82e240849862be7a395407276aa.tar.bz2 flashrom-571a9ac832c0e82e240849862be7a395407276aa.zip |
tests: add more wrappers for libusb funcs
The patch adds wrappers for libusb functions that are used in the
ch341a programmer and have not yet been introduced.
Change-Id: Ic11efb9fd746cb91911dbe87e1c0028759f5bb0b
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69872
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'tests/libusb_wraps.c')
-rw-r--r-- | tests/libusb_wraps.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/libusb_wraps.c b/tests/libusb_wraps.c index 85bb963b..a05cbe9b 100644 --- a/tests/libusb_wraps.c +++ b/tests/libusb_wraps.c @@ -34,6 +34,17 @@ int __wrap_libusb_init(libusb_context **ctx) return 0; } +void __wrap_libusb_set_debug(libusb_context *ctx, int level) +{ + LOG_ME; +} + +int __wrap_libusb_set_option(libusb_context *ctx, int option, ...) +{ + LOG_ME; + return 0; +} + int __wrap_libusb_open(libusb_device *dev, libusb_device_handle **devh) { LOG_ME; @@ -58,6 +69,19 @@ int __wrap_libusb_attach_kernel_driver(libusb_device_handle *dev_handle, int int return 0; } +struct libusb_device_handle *__wrap_libusb_open_device_with_vid_pid( + libusb_context *ctx, uint16_t vendor_id, uint16_t product_id) +{ + LOG_ME; + return not_null(); +} + +libusb_device *__wrap_libusb_get_device(libusb_device_handle *dev_handle) +{ + LOG_ME; + return not_null(); +} + ssize_t __wrap_libusb_get_device_list(libusb_context *ctx, libusb_device ***list) { LOG_ME; @@ -161,6 +185,29 @@ void __wrap_libusb_unref_device(libusb_device *dev) LOG_ME; } +struct libusb_transfer *__wrap_libusb_alloc_transfer(int iso_packets) +{ + LOG_ME; + return not_null(); +} + +int __wrap_libusb_submit_transfer(struct libusb_transfer *transfer) +{ + LOG_ME; + return 0; +} + +void __wrap_libusb_free_transfer(struct libusb_transfer *transfer) +{ + LOG_ME; +} + +int __wrap_libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv) +{ + LOG_ME; + return 0; +} + void __wrap_libusb_exit(libusb_context *ctx) { LOG_ME; |