diff options
author | John Levon <john.levon@nutanix.com> | 2021-04-13 17:10:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-13 17:10:35 +0100 |
commit | 7c08067fa7376589ff8177c6cc9a36a12a12c407 (patch) | |
tree | 487c93737401f4ca2fe4aaeed2cea5f5294c8bdc /test | |
parent | 1c2301b05baefe4e224adb93e1b642df4edca3f2 (diff) | |
download | libvfio-user-7c08067fa7376589ff8177c6cc9a36a12a12c407.zip libvfio-user-7c08067fa7376589ff8177c6cc9a36a12a12c407.tar.gz libvfio-user-7c08067fa7376589ff8177c6cc9a36a12a12c407.tar.bz2 |
tran_sock: use ERROR_INT() (#431)
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/mocks.c | 6 | ||||
-rw-r--r-- | test/unit-tests.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/test/mocks.c b/test/mocks.c index 7121826..3361c5a 100644 --- a/test/mocks.c +++ b/test/mocks.c @@ -39,11 +39,11 @@ #include <cmocka.h> -#include "mocks.h" #include "dma.h" #include "migration.h" -#include "../lib/private.h" -#include "../lib/tran_sock.h" +#include "mocks.h" +#include "private.h" +#include "tran_sock.h" struct function { diff --git a/test/unit-tests.c b/test/unit-tests.c index cf7c7a8..ef93ccb 100644 --- a/test/unit-tests.c +++ b/test/unit-tests.c @@ -1648,6 +1648,7 @@ recv_body(UNUSED vfu_ctx_t *vfu_ctx, UNUSED const struct vfio_user_header *hdr, UNUSED void **datap) { /* hack to avoid having to refactor the rest of exec_command */ + errno = ENOBUFS; return -1; } @@ -1685,7 +1686,7 @@ test_exec_command(UNUSED void **state) expect_value(should_exec_command, cmd, 0xbeef); r = exec_command(&vfu_ctx, &hdr, size, &fds, 0, NULL, NULL, &_iovecs, &iovecs, &nr_iovecs, &free_iovec_data); - assert_int_equal(-1, r); + assert_int_equal(-ENOBUFS, r); } static void |