[sane-devel] a backend test

Henning Meier-Geinitz henning at meier-geinitz.de
Tue Mar 19 00:06:55 GMT 2002


Hi,

On Sun, Mar 17, 2002 at 10:09:13PM -0600, Frank Zago wrote:
> 
> New version available.
> 
> - more tests
> - displays warnings and errors instead of coredumping
> - fixes

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?

mustek -l1:
warnings: 0  error: 0  checks: 2893092

It really does 3 million tests?

mustek -l2:
(some hours later :-):
warnings: 0  error: 0  checks: -1416384447

The test of pnm is still running...


More comments:

The name of option 0 should be empty ("").

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)."

So no array is allowed.

For the non-string options you could also test if they use wrong
constraints.

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.


The comment gor set_random_value() is wrong :-)

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.


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).
	     
				     

/* For that test, the requirements are:
 *   SANE_NAME_SCAN_MODE exists and is a SANE_CONSTRAINT_WORD_LIST

--> string list.

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.

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

Bye,
  Henning



More information about the sane-devel mailing list