Add a testcase for getentropy

pull/169/head
Casper Beyer 5 years ago committed by Andrew Brown
parent 00cb3b2e5f
commit 4efaa5fc28

@ -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