summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-06 03:10:01 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-06 03:10:01 +0200
commit7f8ebbfd7f497dfcf903d9f79d0bfa2ccda305b2 (patch)
treeb96267785e301e3a0c1075dd116db57771fd1a9e /source
parent4438febd576046522cc7e4fd5d1a01eb3b6523ed (diff)
downloadkit-7f8ebbfd7f497dfcf903d9f79d0bfa2ccda305b2.zip
test
Diffstat (limited to 'source')
-rw-r--r--source/tests/secure_random.test.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/tests/secure_random.test.c b/source/tests/secure_random.test.c
index cb7b477..7ba78e6 100644
--- a/source/tests/secure_random.test.c
+++ b/source/tests/secure_random.test.c
@@ -4,9 +4,9 @@
#define KIT_TEST_FILE secure_random
#include "../kit_test/test.h"
-TEST("secure random") {
- int i, j;
+#include <stdio.h>
+TEST("secure random") {
int v[20];
memset(v, 0, sizeof v);
@@ -15,10 +15,13 @@ TEST("secure random") {
int repeats = 0;
- for (i = 1; i < sizeof v / sizeof *v; i++)
- for (j = 0; j < i; j++)
+ for (int i = 1; i < sizeof v / sizeof *v; i++)
+ printf(" %d \n", v[i]);
+
+ for (int i = 1; i < sizeof v / sizeof *v; i++)
+ for (int j = 0; j < i; j++)
if (v[i] == v[j])
repeats++;
- REQUIRE(repeats <= 1);
+ REQUIRE(repeats == 0);
}