[LTP] [PATCH v2 02/10] syscalls/ioctl:add common c file for loop ioctl

Cyril Hrubis chrubis@suse.cz
Tue Apr 21 10:55:44 CEST 2020


Hi!
> >> +void tst_assert_file_str(const char *file, const int lineno, const char
> >> *path, const char *buf, const char *val)
> >> +{
> >> +       char sys_val[1024];
> >> +
> >> +       SAFE_FILE_LINES_SCANF(path, buf, sys_val);
> > 
> > We should call the file_lines_scanf() here and pass the filename and
> > lineno that this functions takes as parameter instead.
> I don't understand the meaning of adding filename and line parameter(If 
> fail, it will report tst_assert.c: 29). Do you want to report the 
> correct parsed filename when failed?
> 
> If so, I think lineno is meaningless and it also overides the place of 
> the code meet problem . I prefer to add some path info in safe_file_ops.c.

What I want is to show the test source filename and line on failure, for
that we have to pass the lineno and file to the file_lines_scanf()
function. I think that it makes much more sense to print the line in a
test where the problem has happened rather than some location in the
library code.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list