Lines Matching +full:uuid +full:- +full:dev

2  * QEMU tests for shared dma-buf API
22 #include "hw/virtio/virtio-dmabuf.h"
27 QemuUUID uuid; in test_add_remove_resources() local
31 qemu_uuid_generate(&uuid); in test_add_remove_resources()
34 g_assert(virtio_add_dmabuf(&uuid, dmabuf_fd)); in test_add_remove_resources()
35 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, dmabuf_fd); in test_add_remove_resources()
37 g_assert(virtio_remove_resource(&uuid)); in test_add_remove_resources()
39 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, -1); in test_add_remove_resources()
45 QemuUUID uuid; in test_add_remove_dev() local
46 struct vhost_dev *dev = g_new0(struct vhost_dev, 1); in test_add_remove_dev() local
50 qemu_uuid_generate(&uuid); in test_add_remove_dev()
51 virtio_add_vhost_device(&uuid, dev); in test_add_remove_dev()
53 g_assert(virtio_lookup_vhost_device(&uuid) != NULL); in test_add_remove_dev()
55 g_assert(virtio_remove_resource(&uuid)); in test_add_remove_dev()
57 g_assert(virtio_lookup_vhost_device(&uuid) == NULL); in test_add_remove_dev()
59 g_free(dev); in test_add_remove_dev()
64 QemuUUID uuid; in test_remove_invalid_resource() local
68 qemu_uuid_generate(&uuid); in test_remove_invalid_resource()
69 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, -1); in test_remove_invalid_resource()
71 g_assert_false(virtio_remove_resource(&uuid)); in test_remove_invalid_resource()
77 QemuUUID uuid; in test_add_invalid_resource() local
78 struct vhost_dev *dev = NULL; in test_add_invalid_resource() local
79 int i, dmabuf_fd = -2, alt_dmabuf = 2; in test_add_invalid_resource()
82 qemu_uuid_generate(&uuid); in test_add_invalid_resource()
84 g_assert_false(virtio_add_dmabuf(&uuid, dmabuf_fd)); in test_add_invalid_resource()
86 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, -1); in test_add_invalid_resource()
88 g_assert_false(virtio_add_vhost_device(&uuid, dev)); in test_add_invalid_resource()
90 g_assert(virtio_lookup_vhost_device(&uuid) == NULL); in test_add_invalid_resource()
95 qemu_uuid_generate(&uuid); in test_add_invalid_resource()
97 g_assert(virtio_add_dmabuf(&uuid, dmabuf_fd)); in test_add_invalid_resource()
98 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, dmabuf_fd); in test_add_invalid_resource()
99 /* Add a new resource with repeated uuid returns false */ in test_add_invalid_resource()
100 g_assert_false(virtio_add_dmabuf(&uuid, alt_dmabuf)); in test_add_invalid_resource()
101 /* The value for the uuid key is not replaced */ in test_add_invalid_resource()
102 g_assert_cmpint(virtio_lookup_dmabuf(&uuid), ==, dmabuf_fd); in test_add_invalid_resource()
120 g_assert_cmpint(virtio_lookup_dmabuf(&uuids[i]), ==, -1); in test_free_resources()
128 g_test_add_func("/virtio-dmabuf/add_rm_res", test_add_remove_resources); in main()
129 g_test_add_func("/virtio-dmabuf/add_rm_dev", test_add_remove_dev); in main()
130 g_test_add_func("/virtio-dmabuf/rm_invalid_res", in main()
132 g_test_add_func("/virtio-dmabuf/add_invalid_res", in main()
134 g_test_add_func("/virtio-dmabuf/free_res", test_free_resources); in main()