vsock: increase test coverage

Add more tests in vhost-device-vsock to increase the coverage.

Some of them are really simple and perhaps nonsensical (tests for
Debug, Clone, etc.), but for now we don't know how to disable this
in the tool, so let's cover these cases.

The vhost-device-vsock functions coverage increases from 70.73% to
90.45%:
    Filename             Functions  Missed Functions  Executed
    ----------------------------------------------------------
    main.rs                     51                12    76.47%
    rxops.rs                     8                 0   100.00%
    rxqueue.rs                  20                 0   100.00%
    thread_backend.rs           20                 3    85.00%
    txbuf.rs                    17                 0   100.00%
    vhu_vsock.rs                37                 1    97.30%
    vhu_vsock_thread.rs         40                 5    87.50%
    vsock_conn.rs               27                 0   100.00%
    ----------------------------------------------------------
    TOTAL                      220                21    90.45%

Closes #229

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
This commit is contained in:
Stefano Garzarella 2023-11-06 15:53:51 +01:00 committed by Manos Pitsidianakis
parent 197dac1c81
commit 5847489855
11 changed files with 194 additions and 6 deletions

1
Cargo.lock generated
View file

@ -963,6 +963,7 @@ dependencies = [
name = "vhost-device-vsock"
version = "0.1.0"
dependencies = [
"assert_matches",
"byteorder",
"clap",
"config",