[sane-devel] a backend test
Sat, 16 Mar 2002 14:09:04 +0100
On Fri, Mar 15, 2002 at 12:05:17AM -0600, Frank Zago wrote:
> I've derived scanimage into a test for backend.
> Currently it does not much:
> - options check (get/set, consistent type/range, ...)
> - 2 scans per scan mode (read byte per byte, read random size)
While testing the pnm backend:
hmg@hmg1$ frontend/tstbackend --device-name pnm:0 -l1
TEST: options consistency
lt-tstbackend: tstbackend.c:219: test_options: Assertion opt->constraint_type == SANE_CONSTRAINT_STRING_LIST' failed.
A SANE_TYPE_STRING can also be a single string that can be entered in
the frontend like the filename in this case.
Concerning the commented line:
/*assert(opt->name != NULL);*/
I think this is valid for all but SANE_TYPE_GROUP.
With pnm, there is a segfault when testing option 14 (gamma). You
assume that SANE_Int is only 4 bytes but it may be an array of ints.
So better use mallocs for opt->size.
Then tstbackend doesn't like that pnm doesn't return SANE_STATUS_INVAL
when sane_control_option is called for an inactive option. I'm not
sure if this is a violation of the standard. Should I change this in
the pnm backend? The same is true for IS_SETTABLE.