summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/sanitizer_common/TestCases/Posix/arc4random.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/Posix/arc4random.cc b/test/sanitizer_common/TestCases/Posix/arc4random.cc
index a34930973..0a983b58f 100644
--- a/test/sanitizer_common/TestCases/Posix/arc4random.cc
+++ b/test/sanitizer_common/TestCases/Posix/arc4random.cc
@@ -15,8 +15,10 @@ void print_buf(unsigned char *buf, size_t buflen) {
}
void test_seed() {
+#ifdef __NetBSD__
time_t now = ::time(nullptr);
arc4random_addrandom((unsigned char *)&now, sizeof(now));
+#endif
}
void test_arc4random() {
@@ -34,7 +36,9 @@ void test_arc4random_uniform() {
void test_arc4random_buf10() {
printf("test_arc4random_buf10\n");
char buf[10];
+#ifdef __NetBSD__
arc4random_stir();
+#endif
arc4random_buf(buf, sizeof(buf));
print_buf((unsigned char *)buf, sizeof(buf));
}
@@ -42,7 +46,9 @@ void test_arc4random_buf10() {
void test_arc4random_buf256() {
printf("test_arc4random_buf256\n");
char buf[256];
+#ifdef __NetBSD__
arc4random_stir();
+#endif
arc4random_buf(buf, sizeof(buf));
print_buf((unsigned char *)buf, sizeof(buf));
}