* tests/test-getentropy.c (main): Add one more test.
* tests/test-unistd-c++.cc: Check the signature of getentropy.
+2020-05-31 Bruno Haible <bruno@clisp.org>
+
+ getentropy: Enhance tests.
+ * tests/test-getentropy.c (main): Add one more test.
+ * tests/test-unistd-c++.cc: Check the signature of getentropy.
+
2020-05-31 Bruno Haible <bruno@clisp.org>
getentropy: Work around a macOS and Solaris problem.
/* This test fails with probability 2**-2048. (Run it again if so. :-) */
ASSERT (memcmp (buf, empty_buf, sizeof buf) != 0);
+ /* It is very unlikely that two calls to getentropy produce the same
+ results. */
+ {
+ char buf1[8];
+ char buf2[8];
+
+ ASSERT (getentropy (buf1, sizeof (buf1)) == 0);
+ ASSERT (getentropy (buf2, sizeof (buf2)) == 0);
+ ASSERT (memcmp (buf1, buf2, sizeof (buf1)) != 0);
+ }
+
return 0;
}
SIGNATURE_CHECK (GNULIB_NAMESPACE::getdtablesize, int, (void));
#endif
+#if GNULIB_TEST_GETENTROPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getentropy, int, (void *, size_t));
+#endif
+
#if GNULIB_TEST_GETGROUPS
SIGNATURE_CHECK (GNULIB_NAMESPACE::getgroups, int, (int, gid_t *));
#endif