From: Subrata M. <su...@li...> - 2007-11-29 10:01:52
|
Good that you have hit the real problem. Well i would suggest you the following: If you have time to look in to the latest code, please then go according to the latest code which is there in the Main line Kernel (as i feel that the Man pages may not be updated at the pace in which code gets patched, updated and finally released). So, our test cases will be little ahead of even the man page (eventually the issues will be displayed by the next or future man page releases). But please do not forget the following points: 1) When you write code, make it backward compatible to all those kernels also, where the features is not supported. Your test case should be able to compile in all kernels, but will definitely compile different code (compile actual code when the kernel supports, and, compile some proper message when the kernel does not support), 2) Make sure to use the standard log libraries of LTP rather than printf family of functions. Would like to know others opinion on this. Please pour in your suggestions on this. --Subrata-- On Thu, 2007-11-29 at 17:53 +0900, Masatake YAMATO wrote: > Hi, > > When writing a testcase, what should I refer as specification. > I think there are two materials: man page and source code. > The problems are in the case when there are difference between > man page and source code. > > Here I use sendfile as an example. > > In the man page fot it says: > > ERRORS > EAGAIN Non-blocking I/O has been selected using O_NONBLOCK and the > write would block. > > EBADF The input file was not opened for reading or the output file was > not opened for writing. > > EFAULT Bad address. > > EINVAL Descriptor is not valid or locked, or an mmap(2)-like operation > is not available for in_fd. > > EIO Unspecified error while reading from in_fd. > > ENOMEM Insufficient memory to read from in_fd. > > In other hand I found fs/read_write.c: > > static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, > size_t count, loff_t max) > { > ... > retval = -ESPIPE; > if (!ppos) > ppos = &in_file->f_pos; > else > if (!(in_file->f_mode & FMODE_PREAD)) > goto fput_in; > ... > fput_in: > fput_light(in_file, fput_needed_in); > out: > return retval; > } > > The man page doesn't explain ESPIPE. > Whether I should write a testcase for ESPIPE or not? > > I find two activities, writing testcases and reviewing man pages, > have very similar aspects. > > Masatake YAMATO > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Ltp-list mailing list > Ltp...@li... > https://lists.sourceforge.net/lists/listinfo/ltp-list |