[riot-notifications] [RIOT-OS/RIOT] tests/rng: replace printf_float with fmt/print_float (#10999)

Gaƫtan Harter notifications at github.com
Tue Feb 12 14:05:27 CET 2019


### Contribution description

When running the test on `arduino-mega2560` printing the float failed
and was printed as ` ?`.

    Calculated  ? bits of entropy from 10000 samples.

Replace using `printf` floating point printing by using `fmt/print_float`.
Now the test succeeds on `arduino-mega2560`.


I used `6` for the precision because that what was printed for `native` in the firmware output.

### Testing procedure

Run `tests/rng` on an `arduino-mega2560` the test should fail in master and work with this PR

Failure in master:

```
2019-02-12 14:00:58,909 - INFO # Calculated  ? bits of entropy from 10000 samples.
> Timeout in expect script at "child.expect(re.compile(r"Calculated 7\.994\d{3} bits of entropy from 10000 samples\."))" (tests/rng/tests/01-run.py:39)
```

Success with this PR.

```
BOARD=arduino-mega2560 make --no-print-directory -C tests/rng/ flash test
2019-02-12 14:03:30,060 - INFO # Running entropy test, with seed 1337 using constant value.
2019-02-12 14:03:30,061 - INFO #
2019-02-12 14:03:30,175 - INFO # Calculated 0.017260 bits of entropy from 10000 samples.
```

### Issues/PRs references

This was found during release tests: https://github.com/RIOT-OS/Release-Specs/issues/98

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/10999

-- Commit Summary --

  * tests/rng: replace printf_float with fmt/print_float

-- File Changes --

    M tests/rng/Makefile (1)
    M tests/rng/test.c (5)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/10999.patch
https://github.com/RIOT-OS/RIOT/pull/10999.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10999
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190212/85d4c15b/attachment.html>


More information about the notifications mailing list