[sane-devel] tstbackend

Frank Zago fzago@austin.rr.com
Sat, 14 Aug 2004 11:45:30 -0500

Hi Jim,

> 1.  There is a check on the descriptor returned by sane_get_select_fd() 
> which always fails even when my backend has returned a valid small 
> integer file descriptor.     The check is implemented like 
> "check(ERR,(fd <0), ......".    I think it should be 
> "check(ERR,(fd>=0),...."

That's a tstbackend bug. Your backend seems to be the first tested one to 
support sane_get_select_fd.

> 2.   In the scanning tests   tstbackend  starts a scan and then toggles 
> the state of the io_mode  eventually leaving the fd in non-blocking 
> mode.     It then attempts to do a 1 byte read.   Due to being very slow 
> scanner,  my DS3000 backend has no data ready on the first call to 
> sane_read() and therefore returns SANE_STATUS_GOOD and sets the length 
> to 0 as suggested by the SANE API doc.    tstbackend  thinks this is an 
> error and aborts the rest of the scan.     I would expect that either 
> tstbackend should use the descriptor in blocking mode or should accept 
> return value of SANE_STATUS_GOOD with a returned length of 0 bytes?

Ditto with sane_set_io_mode.

I'll fix that.