diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-04-14 16:27:15 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-14 16:27:15 -0600 |
commit | 7983bed070cbea274edc6224d7fb2137c82e3854 (patch) | |
tree | b774081f9fdef3ad4c71bc1426e8bcfb192f0683 | |
parent | 7cea31e742c175b8df2895b57f472b49ff514ee0 (diff) | |
parent | 045b8c5b183859fbc481ec7ab6b818442cc57ab0 (diff) | |
download | liburing-7983bed070cbea274edc6224d7fb2137c82e3854.tar.gz liburing-7983bed070cbea274edc6224d7fb2137c82e3854.tar.bz2 |
Merge tag 'test-fixes-2022-04-15' of https://github.com/ammarfaizi2/liburing
Pull test fixes from Ammar Faizi:
- Two fixes for `-Wunused-but-set-variable` warning from clang-15.
- Fix the wrong assertion condition and testfile cleanup in
test/submit_reuse.
Link: https://github.com/axboe/liburing/pull/567
* tag 'test-fixes-2022-04-15' of https://github.com/ammarfaizi2/liburing:
test/submit-reuse: Fix `-Wunused-but-set-variable` warning from clang-15
test/35fa71a030ca: Fix `-Wunused-but-set-variable` warning from clang-15
test/rw_merge_test: Fix the wrong assertion condition and unlink testfile
-rw-r--r-- | test/35fa71a030ca.c | 3 | ||||
-rw-r--r-- | test/rw_merge_test.c | 3 | ||||
-rw-r--r-- | test/submit-reuse.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/test/35fa71a030ca.c b/test/35fa71a030ca.c index f83cc9d..9a6ddb6 100644 --- a/test/35fa71a030ca.c +++ b/test/35fa71a030ca.c @@ -238,8 +238,7 @@ static void execute_one(void); static void loop(void) { - int iter; - for (iter = 0;; iter++) { + for (;;) { int pid = fork(); if (pid < 0) exit(1); diff --git a/test/rw_merge_test.c b/test/rw_merge_test.c index 43feed4..03f6467 100644 --- a/test/rw_merge_test.c +++ b/test/rw_merge_test.c @@ -35,7 +35,8 @@ int main(int argc, char *argv[]) assert(!ret); fd = open("testfile", O_RDWR | O_CREAT, 0644); - assert(ret >= 0); + assert(fd >= 0); + unlink("testfile"); ret = ftruncate(fd, 4096); assert(!ret); diff --git a/test/submit-reuse.c b/test/submit-reuse.c index ca30e98..d5ccdd4 100644 --- a/test/submit-reuse.c +++ b/test/submit-reuse.c @@ -26,13 +26,11 @@ struct thread_data { static void *flusher(void *__data) { struct thread_data *data = __data; - int i = 0; while (!data->do_exit) { posix_fadvise(data->fd1, 0, FILE_SIZE, POSIX_FADV_DONTNEED); posix_fadvise(data->fd2, 0, FILE_SIZE, POSIX_FADV_DONTNEED); usleep(10); - i++; } return NULL; |