[sane-devel] a backend test

Frank Zago fzago at greshamstorage.com
Tue Mar 19 22:39:34 GMT 2002


Hi Oliver,

> when for Option 0 the name is not defined (opt->name == NULL) then this code
> prints the warning about empty name. e.g. the additional "if (opt->name != NULL)"
> solves the Problem, but then the opt->name != NULL of the check command also
> can be removed:
>
> if (opt->name != NULL)
> {
>                                 check(WRN, (*opt->name ==0),
>                                           "option %d must have an empty name (ie. \"\")",
> option_num);
> }

What would be the correct value for opt->name:
  - NULL or ""
  - only ""


> The testbackend prints a warning:
> warning : invalid size for option halftone-pattern
[...]
> I think a constraint_range can have a size of 0 if there is nothing to set.
> In this case the option also is set inactive.

I've broaden the scope of that: if an option is inactive, it can
contains anything and thus cannot be tested.
But if the option is active, the constraint_range must be != 0.

Frank.





More information about the sane-devel mailing list