Bug 420 - Input API needs test suite
Summary: Input API needs test suite
Status: CONFIRMED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Other (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-22 21:24 CEST by Bert Vermeulen
Modified: 2014-09-22 21:24 CEST (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.

THROUGHPUT

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