Bug 420

Summary: Input API needs test suite
Product: libsigrok Reporter: Bert Vermeulen <bert>
Component: OtherAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Bert Vermeulen 2014-09-22 21:24:51 CEST
Needs one input file per module to test general throughput. If the module has options, more input files should be added to work these options.

Every one of these input file/option permutations should have a known-good output file associated with it, against which the test result will be matched.


- Set client bufsize to more than the file size. This causes the sdi to become ready immediately on the first chunk being fed in, but the client will have no more input to feed in and push instance-buffered through. Thus this is a test of the module's correct implementation of the input_module.end() method.

- Set client bufsize to less than the file size. This makes sure the first test doesn't happen, and thus tests throughput in the inverse case -- data being fed into the module in between the sdi being ready and the end of the data.

- Set client bufsize to 1. This should flush out modules that chomp too much of an input stream's header if they have it -- off-by-ones and similar.

- The above three tests, should be done once for sr_input_scan_buffer(), and once for sr_input_scan_file() to flush out any differences between them -- there shouldn't be any.