Add a testcase for getentropy (#169)

pull/337/head
Casper Beyer 1 year ago committed by GitHub
parent 00cb3b2e5f
commit 7c0558ba41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,17 @@
#include <assert.h>
#include <unistd.h>
int main() {
char buf[256] = {0};
int ret = getentropy(buf, 256);
assert(ret == 0);
int sum = 0;
for (int i = 0; i < 256; i++) {
sum += buf[i];
}
assert(sum != 0);
return 0;
}
Loading…
Cancel
Save