]> sigrok.org Git - libsigrok.git/commit - tests/analog.c
tests/analog: add more tests for analog feed to float array conversion
authorGerhard Sittig <redacted>
Tue, 8 Sep 2020 19:07:33 +0000 (21:07 +0200)
committerGerhard Sittig <redacted>
Fri, 18 Sep 2020 14:42:37 +0000 (16:42 +0200)
commit6205515cc8bed6bc17c2facf9612a072facdfd3e
treea05370f969dca47c8844870935e8a6f9ea99cef3
parentf37f11ec6b3b0bc15de0a186dd9ba424635c117e
tests/analog: add more tests for analog feed to float array conversion

Extend test coverage for the sr_analog_to_float() conversion routine.
Pass data which is encoded in native, little and big endian format to
the routine. Pass single and double precision floating point data, and
integer data in different unit sizes and signedness. Cover scale/offset
calculations as well.

Also cover expected failed conversion for unsupported combinations of
input data format details (half/quad precision float, u64 integer).

Adjust the grouping of test cases in the sequence while we are here.
Move SI prefix, unit, and rational number related tests out of the
analog-to-float conversion group.
tests/analog.c