[Spice-commits] server/tests

Frediano Ziglio fziglio at kemper.freedesktop.org
Fri Jan 15 03:05:24 PST 2016


 server/tests/stream-test.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 47df90a8ceb8b4d5a41aeb023e7f6a419e64847e
Author: Marc-Andre Lureau <marcandre.lureau at gmail.com>
Date:   Thu Jan 14 22:01:04 2016 +0100

    stream-test: add batch test
    
    Check that two consecutive msgfd are read back from two different reads.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/tests/stream-test.c b/server/tests/stream-test.c
index 7dc9fbf..f83f0e1 100644
--- a/server/tests/stream-test.c
+++ b/server/tests/stream-test.c
@@ -111,6 +111,22 @@ int main(int argc, char *argv[])
     spice_assert(ret == 1);
     spice_assert(fd == -1);
 
+    /* batch test */
+    ret = reds_stream_send_msgfd(st[0], 0);
+    spice_assert(ret == 1);
+    ret = reds_stream_send_msgfd(st[0], 0);
+    spice_assert(ret == 1);
+    ret = sock_fd_read(sv[1], &c, 1, &fd);
+    spice_assert(c == '@');
+    spice_assert(ret == 1);
+    spice_assert(fd != -1);
+    close(fd);
+    ret = sock_fd_read(sv[1], &c, 1, &fd);
+    spice_assert(c == '@');
+    spice_assert(ret == 1);
+    spice_assert(fd != -1);
+    close(fd);
+
     reds_stream_free(st[0]);
     reds_stream_free(st[1]);
 


More information about the Spice-commits mailing list