[sane-devel] a backend test

Frank Zago fzago@greshamstorage.com
Mon, 18 Mar 2002 21:37:22 -0600 (CST)


Thanks for your testing Henning.

> Very interesting. Found some more oddities in my backends.
>
> For mustek_usb the -l1 test lokks like this:
> warnings: 0  error: 0  checks: 20837
> -l2:
> warnings: 0  error: 0  checks: -553292640
>
> Overflow somewhere?

Yes. Now it is a long long.

>
> mustek -l1:
> warnings: 0  error: 0  checks: 2893092
>
> It really does 3 million tests?

I guess so. There are not unique tests, but often they occur under
slightly different conditions.
The byte per byte scans are probably most of that count, though.

> mustek -l2:
> (some hours later :-):
> warnings: 0  error: 0  checks: -1416384447
>
> The test of pnm is still running...

??? Weird. It is a software backend, so it should be lighning fast. I'll
check that.

>
>
> More comments:
>
> The name of option 0 should be empty ("").

Check fixed.

> Concerning:
> /* This test is not a SANE requirement, but does it make
>  * sense to have an array of booleans? */
>
> SANE standard says: "SANE_TYPE_BOOL: The size must be set to
>                      sizeof(SANE_Word)."

Fixed.

> So no array is allowed.
>
> For the non-string options you could also test if they use wrong
> constraints.

Test added.

>
> In the default:  part of the type check for options I wouldn't just
> abort but print an error message indicating the number of the unknown
> option and type.

Which test are you refering to?

>
>
> The comment gor set_random_value() is wrong :-)

Fixed.

>
> In test_scan() you set tzhe geometry options and print "no option [%s]
> - skipping test" if they are no available. But rc is not checked
> before the actual scan so the "skipping test" is misleading.

Well spotted. Fixed.

>
> Concerning:
> /* Check that it is not possible to set an option. I'm not sure it
>  * is a SANE requirement, but it sounds sane, and most backend
>  * check that.*/
>
> In my opinion, it's a requirement and stated indirectly in 4.4 (code
> flow).

Comment fixed.

>
>
>
> /* For that test, the requirements are:
>  *   SANE_NAME_SCAN_MODE exists and is a SANE_CONSTRAINT_WORD_LIST
>
> --> string list.

comment fixed.

>
> test_scans()
>
> If option scan mode is not available you could do the test without
> setting it. The same is true for option resolution. Just use the
> satndard settings in this case.

I changed the checks. Untested.


> main()
> You should test for SANE_VERSION_MAJOR(version_code) == 1. Just to
> make sure noone links to sane version 0 or 2...

Test added.

New tstbackend available.

Frank.