diff options
Diffstat (limited to 'test/helpers.h')
-rw-r--r-- | test/helpers.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/helpers.h b/test/helpers.h index 74fe162..d0beb93 100644 --- a/test/helpers.h +++ b/test/helpers.h @@ -41,6 +41,12 @@ void *t_calloc(size_t nmemb, size_t size); void t_create_file(const char *file, size_t size); /* + * Helper for creating file and write @size byte buf with @pattern value in + * the file. + */ +void t_create_file_pattern(const char *file, size_t size, char pattern); + +/* * Helper for creating @buf_num number of iovec * with @buf_size bytes buffer of each iovec. */ @@ -54,6 +60,12 @@ enum t_setup_ret t_create_ring_params(int depth, struct io_uring *ring, enum t_setup_ret t_create_ring(int depth, struct io_uring *ring, unsigned int flags); +enum t_setup_ret t_register_buffers(struct io_uring *ring, + const struct iovec *iovecs, + unsigned nr_iovecs); + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + #ifdef __cplusplus } #endif |