Skip to content
Snippets Groups Projects
Unverified Commit 654fd4fb authored by Peter Kietzmann's avatar Peter Kietzmann Committed by GitHub
Browse files

Merge pull request #10999 from cladmi/pr/tests/rng/print_float

tests/rng: replace printf_float with fmt/print_float
parents d4f08646 27b42d34
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,6 @@ BOARD_INSUFFICIENT_MEMORY += arduino-duemilanove arduino-uno
# USEMODULE += prng_minstd
USEMODULE += fmt
USEMODULE += printf_float
USEMODULE += random
USEMODULE += shell
USEMODULE += xtimer
......
......@@ -154,7 +154,7 @@ void test_distributions(uint32_t samples)
/* count bits */
for (int i = 0; i < 32; i++) {
if (value & (1 << i)) {
if (value & (UINT32_C(1) << i)) {
distributions[i]++;
}
}
......@@ -382,7 +382,15 @@ void test_entropy(uint32_t samples)
}
/* print results */
printf("Calculated %02f bits of entropy from %" PRIu32 " samples.\n", (double) entropy, samples);
/* Use 'fmt/print_float' to work on all platforms (atmega)
* Stdout should be flushed before to prevent garbled output. */
printf("Calculated ");
#ifdef MODULE_NEWLIB
/* no fflush on msp430 */
fflush(stdout);
#endif
print_float(entropy, 6);
printf(" bits of entropy from %" PRIu32 " samples.\n", samples);
}
void cb_speed_timeout(void *arg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment