Merge "Require getrandom(2)." am: b93f2631e4

am: 3e6a64901a

Change-Id: If0be719f542101bacf32c6ff0c3700de4bf438cf
This commit is contained in:
Elliott Hughes 2017-09-29 18:02:10 +00:00 committed by android-build-merger
commit b1fbb46d00

View file

@ -72,11 +72,6 @@ TEST(sys_random, getentropy_EIO) {
TEST(sys_random, getrandom) {
#if defined(HAVE_SYS_RANDOM)
if (getrandom(nullptr, 0, 0) == -1 && errno == ENOSYS) {
GTEST_LOG_(INFO) << "This test requires a >= 3.17 kernel with getrandom(2).\n";
return;
}
char buf1[64];
char buf2[64];
@ -90,11 +85,6 @@ TEST(sys_random, getrandom) {
TEST(sys_random, getrandom_EFAULT) {
#if defined(HAVE_SYS_RANDOM)
if (getrandom(nullptr, 0, 0) == -1 && errno == ENOSYS) {
GTEST_LOG_(INFO) << "This test requires a >= 3.17 kernel with getrandom(2).\n";
return;
}
errno = 0;
ASSERT_EQ(-1, getrandom(nullptr, 256, 0));
ASSERT_EQ(EFAULT, errno);
@ -105,11 +95,6 @@ TEST(sys_random, getrandom_EFAULT) {
TEST(sys_random, getrandom_EINVAL) {
#if defined(HAVE_SYS_RANDOM)
if (getrandom(nullptr, 0, 0) == -1 && errno == ENOSYS) {
GTEST_LOG_(INFO) << "This test requires a >= 3.17 kernel with getrandom(2).\n";
return;
}
errno = 0;
char buf[64];
ASSERT_EQ(-1, getrandom(buf, sizeof(buf), ~0));