[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/16] tests/qtest/npcm7xx_rng-test: count runs properly
From: |
Peter Maydell |
Subject: |
[PULL 15/16] tests/qtest/npcm7xx_rng-test: count runs properly |
Date: |
Tue, 10 Nov 2020 11:19:16 +0000 |
From: Havard Skinnemoen <hskinnemoen@google.com>
The number of runs is equal to the number of 0-1 and 1-0 transitions,
plus one. Currently, it's counting the number of times these transitions
do _not_ happen, plus one.
Source:
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-22r1a.pdf
section 2.3.4 point (3).
Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
Message-id: 20201103011457.2959989-2-hskinnemoen@google.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
tests/qtest/npcm7xx_rng-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c
index e7cde85fbbc..c614968ffcd 100644
--- a/tests/qtest/npcm7xx_rng-test.c
+++ b/tests/qtest/npcm7xx_rng-test.c
@@ -126,7 +126,7 @@ static double calc_runs_p(const unsigned long *buf,
unsigned int nr_bits)
pi = (double)nr_ones / nr_bits;
for (k = 0; k < nr_bits - 1; k++) {
- vn_obs += !(test_bit(k, buf) ^ test_bit(k + 1, buf));
+ vn_obs += (test_bit(k, buf) ^ test_bit(k + 1, buf));
}
vn_obs += 1;
--
2.20.1
- [PULL 05/16] target/arm: add space before the open parenthesis '(', (continued)
- [PULL 05/16] target/arm: add space before the open parenthesis '(', Peter Maydell, 2020/11/10
- [PULL 06/16] docs: add some notes on the sbsa-ref machine, Peter Maydell, 2020/11/10
- [PULL 07/16] hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals, Peter Maydell, 2020/11/10
- [PULL 08/16] target/arm: Fix neon VTBL/VTBX for len > 1, Peter Maydell, 2020/11/10
- [PULL 10/16] hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ, Peter Maydell, 2020/11/10
- [PULL 11/16] hw/arm/nseries: Remove invalid/unnecessary n8x0_uart_setup(), Peter Maydell, 2020/11/10
- [PULL 09/16] hw/arm/armsse: Correct expansion MPC interrupt lines, Peter Maydell, 2020/11/10
- [PULL 14/16] hw/arm/nseries: Check return value from load_image_targphys(), Peter Maydell, 2020/11/10
- [PULL 13/16] hw/arm/musicpal: Only use qdev_get_gpio_in() when necessary, Peter Maydell, 2020/11/10
- [PULL 12/16] hw/arm/musicpal: Don't connect two qemu_irqs directly to the same input, Peter Maydell, 2020/11/10
- [PULL 15/16] tests/qtest/npcm7xx_rng-test: count runs properly,
Peter Maydell <=
- [PULL 16/16] target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check, Peter Maydell, 2020/11/10
- Re: [PULL 00/16] target-arm queue, Peter Maydell, 2020/11/10