diff --git a/tests/general/getentropy.c b/tests/general/getentropy.c new file mode 100644 index 000000000..3b7fe0e6c --- /dev/null +++ b/tests/general/getentropy.c @@ -0,0 +1,17 @@ +#include +#include + +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; +}