1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/thread_float
Marian Buschsieweke 94ccc6c7dc
tests/thread_float: clean up and fix test script
Split out the regex that matches the output line into a dedicated
function (as it is used three times) and make it also accept nan and
inf as double values. Previously a nan didn't match and occasional
nans were not detected as a test failure.
2022-06-30 19:15:08 +02:00
..
tests tests/thread_float: clean up and fix test script 2022-06-30 19:15:08 +02:00
main.c tests/thread_float: uncrustify 2022-03-22 08:40:53 +01:00
Makefile tests/thread_float: use ztimer_usec 2022-03-22 08:31:58 +01:00
Makefile.ci boards/calliope-mini: add nrf51 common dependencies 2021-11-26 08:48:23 +01:00
README.md tests/thread_float: improve and add test script 2021-11-09 19:57:59 +01:00

Testing for Absence of Interactions between Floating Point Calculations and Context Switches

This tests launches three threads, t1, t2 and t3 that will perform a long and costly series of floating point calculations with different input data, while a software timer triggers context switches. The threads t1 and t3 will print the results. All threads will do this in an endless loop.

This allows for testing the following:

  1. When using the pseudo module printf_float, floating point numbers can be correctly printed
  2. THREAD_STACKSIZE_MAIN is large enough to print floats without stack overflows.
  3. Context switches while the (soft) FPU is busy does not result in precision loss.
    • This could happen if the FPU state is not properly saved / restored on context switch. This could be needed if the FPU internally uses a higher resolution that float / double (e.g. the x86 FPU uses 80 bits internally, instead of 64 bits for double)