Bugs item #1592647, was opened at 2006-11-08 14:01
Message generated for change (Comment added) made by subrata_modak
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=103382&aid=1592647&group_id=3382
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Testcases
Group: I/O
>Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Vagin Andrey (shpagin)
Assigned to: Robert Williamson (robbiew)
Summary: incorrect testcase diotest4-4
Initial Comment:
--- diotest4.c.third 2006-11-02 20:39:35.000000000 +0300
+++ diotest4.c 2006-11-08 16:55:03.000000000 +0300
@@ -284,7 +284,7 @@ main(int argc, char *argv[])
else
tst_resm (TPASS, "Odd count of read and
write");
total++;
-
+ errno = 0;
/* Test-4: Read beyond the file size */
offset = BUFSIZE * (fblocks + 10);
count = bufsize;
output:
.........
diotest4 4 FAIL : allows read beyond file size.
returns 0: Success
........
error is in this logic expression "(ret > 0 || errno !=
EINVAL)"
If read has returned 0, we should not test errno.
----------------------------------------------------------------------
>Comment By: Subrata (subrata_modak)
Date: 2007-04-27 11:18
Message:
Logged In: YES
user_id=1737361
Originator: NO
Accepted and Fixed.
Regards--
Subrata
----------------------------------------------------------------------
Comment By: Vagin Andrey (shpagin)
Date: 2006-11-10 11:21
Message:
Logged In: YES
user_id=1618673
If read return -1, you should check errno. In some version
of the kernel read return -1 and errno=EINVAL, in other
read() return 0.
----------------------------------------------------------------------
Comment By: Vagin Andrey (shpagin)
Date: 2006-11-09 13:11
Message:
Logged In: YES
user_id=1618673
My patch reduse to fail test, though mustn't. And it should
not be commit!!!
Patch for fixing bug:
--- diotest4.c.third 2006-11-09 15:41:24.000000000 +0300
+++ diotest4.c 2006-11-09 16:02:54.000000000 +0300
@@ -280,7 +280,6 @@ main(int argc, char *argv[])
else
tst_resm (TPASS, "Odd count of read and write");
total++;
- errno = 0;
/* Test-4: Read beyond the file size */
offset = BUFSIZE * (fblocks + 10);
count = bufsize;
@@ -291,8 +290,8 @@ main(int argc, char *argv[])
tst_resm (TFAIL, "Read beyond the file size");
}
else {
- ret = read(fd, buf2, count);
- if (ret > 0 || errno != EINVAL) {
+ TEST(read(fd, buf2, count));
+ if ( (TEST_RETURN != 0) && ((TEST_RETURN>0)
|| ( TEST_ERRNO != EINVAL)) ) {
tst_resm(TFAIL,"allows read beyond
file size. returns %d: %s",
ret, strerror(errno));
failed = TRUE;
----------------------------------------------------------------------
Comment By: Vagin Andrey (shpagin)
Date: 2006-11-09 08:58
Message:
Logged In: YES
user_id=1618673
How do you fix?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=103382&aid=1592647&group_id=3382
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list