The idea is not only to find bugs in frontends but also to show all capabilities of SANE. Therefore sane-test implements functions and options that are not (or seldom) found in other backends.
The backend is commented out in /etc/sane.d/dll.conf, so either the comment character must be removed or the backend must be called explicitly. E.g. `scanimage -d test' or `xscanimage test'.
Option depth determines the number of bits per sample (1. 8, or 16). Keep in mind, that this value refers to the sample, not the pixel. So depth=16 results in 48 bits per pixel in color mode. The most usual combinations are mode=Gray, depth=1 for lineart, mode=Gray, depth=8 for gray and mode=Color, depth=8 for color mode. The combination of color and 1-bit mode is quite obscure (8 colors) but allowed in the SANE standard. However, the meaning of bits is not defined. Currently 1 = high intensity and 0 = low intensity is used.
Setting option hand-scanner results in the test-backend behaving like a hand-scanner. Hand-scanners do not know the image height a priori. Instead, they return a height of -1. Setting this option allows one to test whether a frontend can handle this correctly. This option also enables a fixed width of 11 cm.
Setting option three-pass simulates a three-pass scanner. Older color scanners needed to scan the image once per color (reg/green/blue) to get the full image. Therefore, in this mode three single frames are transmitted in color mode.
Option three-pass-order provides support for changing the order of the three frames (see option three-pass above). A frontend should support all orders.
Option resolution sets the resolution of the image in dots per inch.
Option source can be used to simulate an Automatic Document Feeder (ADF). After 10 scans, the ADF will be "empty".
If option invert-endianness is set, the upper and lower bytes of image data in 16 bit modes are exchanged. This option can be used to test the 16 bit modes of frontends, e.g. if the frontend uses the correct endianness.
If option read-limit is set, the maximum amount of data transferred with each call to sane_read() is limited.
Option read-limit-size sets the limit for option read-limit. A low limit slows down scanning. It can be used to detect errors in frontend that occur because of wrong assumptions on the size of the buffer or timing problems.
Option read-delay enables delaying data to the frontend.
Option read-delay-duration selects the number of microseconds the backends waits after each transfer of a buffer. This option is useful to find timing-related bugs, especially if used over the network.
If option read-return-value is different from "Default", the selected status will be returned by every call to sane_read(). This is useful to test the frontend's handling of the SANE statuses.
If option ppl-loss is different from 0, it determines the number of pixels that are "lost" at the end of each line. That means, lines are padded with unused data.
Option fuzzy-parameters selects that fuzzy (inexact) parameters are returned as long as the scan hasn't been started. This option can be used to test if the frontend uses the parameters it got before the start of the scan (which it shouldn't).
Option non-blocking determines if non-blocking IO for sane_read() should be used if supported by the frontend.
If option select-fd is set, the backend offers a select filedescriptor for detecting if sane_read() will return data.
If option enable-test-options is set, a fairly big list of options for testing the various SANE option types is enabled.
Option print-options can be used to print a list of all options to standard error.
Option tl-y determines the top-left y position of the scan area.
Option br-x determines the bottom-right x position of the scan area.
Option br-y determines the bottom-right y position of the scan area.
Option bool-soft-select-soft-detect (1/6) is a bool test option that has soft select and soft detect (and advanced) capabilities. That's just a normal bool option.
Option bool-hard-select-soft-detect (2/6) is a bool test option that has hard select and soft detect (and advanced) capabilities. That means the option can't be set by the frontend but by the user (e.g. by pressing a button at the device).
Option bool-hard-select (3/6) is a bool test option that has hard select (and advanced) capabilities. That means the option can't be set by the frontend but by the user (e.g. by pressing a button at the device) and can't be read by the frontend.
Option bool-soft-detect (4/6) is a bool test option that has soft detect (and advanced) capabilities. That means the option is read-only.
Option bool-soft-select-soft-detect-emulated (5/6) is a Bool test option that has soft select, soft detect, and emulated (and advanced) capabilities.
Option bool-soft-select-soft-detect-auto (6/6) is a Bool test option that has soft select, soft detect, and automatic (and advanced) capabilities. This option can be automatically set by the backend.
Option int (1/6) is an int test option with no unit and no constraint set.
Option int-constraint-range (2/6) is an int test option with unit pixel and constraint range set. Minimum is 4, maximum 192, and quant is 2.
Option int-constraint-word-list (3/6) is an int test option with unit bits and constraint word list set.
Option int-constraint-array (4/6) is an int test option with unit mm and using an array without constraints.
Option int-constraint-array-constraint-range (5/6) is an int test option with unit mm and using an array with a range constraint. Minimum is 4, maximum 192, and quant is 2.
Option int-constraint-array-constraint-word-list (6/6) is an int test option with unit percent and using an array a word list constraint.
Option fixed (1/3) is a fixed test option with no unit and no constraint set.
Option fixed-constraint-range (2/3) is a fixed test option with unit microsecond and constraint range set. Minimum is -42.17, maximum 32767.9999, and quant is 2.0.
Option fixed-constraint-word-list (3/3) is a Fixed test option with no unit and constraint word list set.
Option string (1/3) is a string test option without constraint.
Option string-constraint-string-list (2/3) is a string test option with string list constraint.
Option string-constraint-long-string-list (3/3) is a string test option with string list constraint. Contains some more entries...
Example: export SANE_DEBUG_TEST=4