summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmmar Faizi <ammarfaizi2@gnuweeb.org>2022-04-15 04:03:51 +0700
committerAmmar Faizi <ammarfaizi2@gnuweeb.org>2022-04-15 04:08:41 +0700
commitf315941786b574f7586dbee4096c940610755141 (patch)
tree82df44682f4cf75161916d60cf540201bbb478ba
parent7cea31e742c175b8df2895b57f472b49ff514ee0 (diff)
downloadliburing-f315941786b574f7586dbee4096c940610755141.tar.gz
liburing-f315941786b574f7586dbee4096c940610755141.tar.bz2
test/rw_merge_test: Fix the wrong assertion condition and unlink testfile
The following code: ``` ret = pipe(pipe1); assert(!ret); fd = open("testfile", O_RDWR | O_CREAT, 0644); assert(ret >= 0); // wrong assertion condition here ``` is wrong, we should check the @fd after open(), not @ret. While in there, add unlink("testfile") to make the "git status" clean after running this test. Fixes: d731f67819523f76520994b8408a76da4ec30309 ("add test case for 5.4 io merge regression logic") Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
-rw-r--r--test/rw_merge_test.c3
1 files changed, 2 insertions, 1 deletions
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);