zephyr/tests/lib
Gerard Marull-Paretas e086738b88 sys: linear_range: allow out-of-range values/windows
The existing linear_range API did not allow values or windows outside of
the linear range (returned -EINVAL). With this change values are allowed
outside of the range, being adjusted to the edge values (min/max)
instead. In the case of windows, it is allowed to have partial
intersection. In both cases, the API assigns a valid index (nearest) and
returns -ERANGE. This change is useful because the main client of the
linear range API, regulators, needs such behavior. For example, If an
application specifies a voltage range from 1.0V to 1.5V and the
regulator supports from 1.2V to 2.7V, the regulator can configure a
voltage that satisfies the condition: 1.2V.  With the current API, the
input would be refused because 1.0V lies outside of the 1.2V-2.7V range.

Also, for constant ranges, the minimum index is returned.

Tests have been updated/extended accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-01-16 16:52:35 +01:00
..
c_lib tests: libc: Fix "unused" type of warnings 2023-01-05 08:00:09 -05:00
cbprintf_fp tests: Add picolibc tests 2022-06-22 13:15:55 +02:00
cbprintf_package treewide: Use CONFIG_CPP instead of CONFIG_CPLUSPLUS 2023-01-13 17:42:55 -05:00
cmsis_dsp yamllint: fix all yamllint line-length errors 2023-01-04 01:16:45 +09:00
cmsis_nn includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
cpp treewide: Update deprecated CONFIG_LIB_CPLUSPLUS usages 2023-01-13 17:42:55 -05:00
devicetree tests: devicetree: device: Add mimxrt595_evk_cm33 exclusion 2022-12-05 11:03:14 +01:00
fdtable ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
gui/lvgl tests: lib: gui: lvgl: Switch to FIXED_PARTITION_ macros 2022-09-06 09:56:37 +02:00
heap includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
heap_align tests: lib: add a tag to uniquely identify mem_blocks test 2022-09-26 08:11:13 +00:00
json test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
linear_range sys: linear_range: allow out-of-range values/windows 2023-01-16 16:52:35 +01:00
mem_alloc tests: Remove explicit newlib nano override 2022-10-19 16:02:51 +02:00
mem_blocks tests: mem_blocks: remove board configs using dma logging 2022-09-26 10:53:43 +00:00
mem_blocks_stats tests: lib: add a tag to uniquely identify mem_blocks test 2022-09-26 08:11:13 +00:00
mpsc_pbuf tests: lib: mpsc_pbuf: Add qemu_x86_64 2022-12-29 10:33:29 +01:00
newlib tests: Remove explicit newlib nano override 2022-10-19 16:02:51 +02:00
notify lib: notify: build sys-notify conditionally. 2022-10-03 10:18:15 +02:00
onoff lib: onoff: add a config for on-off and build conditionally 2022-10-03 10:18:15 +02:00
p4workq yamllint: indentation: fix files in tests/ 2023-01-04 14:23:53 +01:00
ringbuffer yamllint: indentation: fix files in tests/ 2023-01-04 14:23:53 +01:00
smf yamllint: indentation: fix files in tests/ 2023-01-04 14:23:53 +01:00
sprintf tests: use ignore_fault field instead of tags 2022-11-25 06:38:05 -05:00
spsc_pbuf ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
sys_util tests: lib: sysutil: migrating lib tests to new ZTEST API 2022-08-19 20:45:19 +00:00
time test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
uoscore includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00