summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/test-random-util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/test-random-util.c b/src/test/test-random-util.c
index 02a73ecdb2..c6d017ac11 100644
--- a/src/test/test-random-util.c
+++ b/src/test/test-random-util.c
@@ -7,11 +7,10 @@
static void test_genuine_random_bytes(RandomFlags flags) {
uint8_t buf[16] = {};
- unsigned i;
log_info("/* %s */", __func__);
- for (i = 1; i < sizeof buf; i++) {
+ for (size_t i = 1; i < sizeof buf; i++) {
assert_se(genuine_random_bytes(buf, i, flags) == 0);
if (i + 1 < sizeof buf)
assert_se(buf[i] == 0);
@@ -22,11 +21,10 @@ static void test_genuine_random_bytes(RandomFlags flags) {
static void test_pseudo_random_bytes(void) {
uint8_t buf[16] = {};
- unsigned i;
log_info("/* %s */", __func__);
- for (i = 1; i < sizeof buf; i++) {
+ for (size_t i = 1; i < sizeof buf; i++) {
pseudo_random_bytes(buf, i);
if (i + 1 < sizeof buf)
assert_se(buf[i] == 0);
@@ -36,9 +34,11 @@ static void test_pseudo_random_bytes(void) {
}
static void test_rdrand(void) {
- int r, i;
+ int r;
- for (i = 0; i < 10; i++) {
+ log_info("/* %s */", __func__);
+
+ for (unsigned i = 0; i < 10; i++) {
unsigned long x = 0;
r = rdrand(&x);