diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2021-02-18 08:39:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 08:39:56 +0000 |
commit | 0243c6dd892f5ac0ed9c195034a67d2f1f08cec6 (patch) | |
tree | 9ba892bd9161ed891e82e2cfc2add78f88bc33c5 | |
parent | 47a6fdbb8b3e459ba4f7815269bae0abf95d29a6 (diff) | |
download | libvfio-user-0243c6dd892f5ac0ed9c195034a67d2f1f08cec6.zip libvfio-user-0243c6dd892f5ac0ed9c195034a67d2f1f08cec6.tar.gz libvfio-user-0243c6dd892f5ac0ed9c195034a67d2f1f08cec6.tar.bz2 |
drop -Wno-implicit-function-declaration from unit tests (#349)
This might cause undefined program behavior.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
-rw-r--r-- | test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/mocks.h | 28 |
2 files changed, 28 insertions, 2 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 11e243d..3e3b0cc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -39,8 +39,6 @@ target_link_libraries(unit-tests PUBLIC cmocka json-c) target_compile_definitions(unit-tests PUBLIC UNIT_TEST) -target_compile_options(unit-tests PUBLIC "-Wno-implicit-function-declaration") - # No "target_link_options" in cmake2 target_link_libraries(unit-tests PUBLIC "-Wl,--wrap=_dma_controller_do_remove_region") diff --git a/test/mocks.h b/test/mocks.h index 67a67b5..06b853c 100644 --- a/test/mocks.h +++ b/test/mocks.h @@ -42,4 +42,32 @@ handle_dirty_pages(vfu_ctx_t *vfu_ctx, uint32_t size, struct iovec **iovecs, size_t *nr_iovecs, struct vfio_iommu_type1_dirty_bitmap *dirty_bitmap); +int +__real_handle_dirty_pages(vfu_ctx_t *vfu_ctx, uint32_t size, + struct iovec **iovecs, size_t *nr_iovecs, + struct vfio_iommu_type1_dirty_bitmap *dirty_bitmap); + +int +__real_dma_controller_add_region(dma_controller_t *dma, dma_addr_t dma_addr, + size_t size, int fd, off_t offset, + uint32_t prot); + +bool +__real_device_is_stopped(struct migration *migr); + +int +__real_exec_command(vfu_ctx_t *vfu_ctx, struct vfio_user_header *hdr, + size_t size, int *fds, size_t *nr_fds, size_t **fds_out, + int *nr_fds_out, struct iovec *_iovecs, struct iovec **iovecs, + size_t *nr_iovecs, bool *free_iovec_data); +int +__real_close(int fd); + +void +__real_free(void *ptr); + +int +__real_process_request(vfu_ctx_t *vfu_ctx); + + /* ex: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab: */ |