aio-dio-regress: code clarification
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 5 Aug 2019 22:49:29 +0000 (00:49 +0200)
committerEryu Guan <guaneryu@gmail.com>
Sun, 11 Aug 2019 13:53:21 +0000 (21:53 +0800)
In this test, FILE_SIZE is defined as 300 but that definition isn't
used consistently.  Make the code more obvious.

(Used by generic/210.)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/aio-dio-regress/aio-dio-subblock-eof-read.c

index 6f35b0e8a518fcd154bc8541c5b7637bf289faec..894965ea3638b85ab15c335a27ccdd683222c59b 100644 (file)
@@ -63,7 +63,7 @@ main(int argc, char **argv)
        /* <1> use normal disk read, this should be ok */
        ret = read(fd, buffer, 4096);
        if (ret != FILE_SIZE)
        /* <1> use normal disk read, this should be ok */
        ret = read(fd, buffer, 4096);
        if (ret != FILE_SIZE)
-               fail("buffered read returned %d, should be 300\n", ret);
+               fail("buffered read returned %d, should be %d\n", ret, FILE_SIZE);
 
        /* <2> use AIO disk read, it sees error. */
        memset(&myiocb, 0, sizeof(myiocb));
 
        /* <2> use AIO disk read, it sees error. */
        memset(&myiocb, 0, sizeof(myiocb));
@@ -89,7 +89,7 @@ main(int argc, char **argv)
                fail("io_getevents returned %d\n", ret);
 
        /*
                fail("io_getevents returned %d\n", ret);
 
        /*
-        *  If all goes well, we should see 300 bytes read.  If things
+        *  If all goes well, we should see FILE_SIZE bytes read.  If things
         *  are broken, we may very well see a result of 4k.
         */
        if (ie.res != FILE_SIZE)
         *  are broken, we may very well see a result of 4k.
         */
        if (ie.res != FILE_SIZE)