diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/syscalls/linux/clock_gettime.cc | 8 | ||||
-rw-r--r-- | test/syscalls/linux/vdso_clock_gettime.cc | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/test/syscalls/linux/clock_gettime.cc b/test/syscalls/linux/clock_gettime.cc index 335a38d41..9efd20b1a 100644 --- a/test/syscalls/linux/clock_gettime.cc +++ b/test/syscalls/linux/clock_gettime.cc @@ -132,6 +132,9 @@ std::string PrintClockId(::testing::TestParamInfo<clockid_t> info) { return "CLOCK_MONOTONIC_COARSE"; case CLOCK_MONOTONIC_RAW: return "CLOCK_MONOTONIC_RAW"; + case CLOCK_BOOTTIME: + // CLOCK_BOOTTIME is a monotonic clock. + return "CLOCK_BOOTTIME"; default: return absl::StrCat(info.param); } @@ -140,15 +143,14 @@ std::string PrintClockId(::testing::TestParamInfo<clockid_t> info) { INSTANTIATE_TEST_SUITE_P(ClockGettime, MonotonicClockTest, ::testing::Values(CLOCK_MONOTONIC, CLOCK_MONOTONIC_COARSE, - CLOCK_MONOTONIC_RAW), + CLOCK_MONOTONIC_RAW, + CLOCK_BOOTTIME), PrintClockId); TEST(ClockGettime, UnimplementedReturnsEINVAL) { SKIP_IF(!IsRunningOnGvisor()); struct timespec tp; - EXPECT_THAT(clock_gettime(CLOCK_BOOTTIME, &tp), - SyscallFailsWithErrno(EINVAL)); EXPECT_THAT(clock_gettime(CLOCK_REALTIME_ALARM, &tp), SyscallFailsWithErrno(EINVAL)); EXPECT_THAT(clock_gettime(CLOCK_BOOTTIME_ALARM, &tp), diff --git a/test/syscalls/linux/vdso_clock_gettime.cc b/test/syscalls/linux/vdso_clock_gettime.cc index 759a50569..7e56c3de0 100644 --- a/test/syscalls/linux/vdso_clock_gettime.cc +++ b/test/syscalls/linux/vdso_clock_gettime.cc @@ -39,6 +39,8 @@ std::string PrintClockId(::testing::TestParamInfo<clockid_t> info) { return "CLOCK_MONOTONIC"; case CLOCK_REALTIME: return "CLOCK_REALTIME"; + case CLOCK_BOOTTIME: + return "CLOCK_BOOTTIME"; default: return absl::StrCat(info.param); } @@ -95,7 +97,9 @@ TEST_P(CorrectVDSOClockTest, IsCorrect) { } INSTANTIATE_TEST_SUITE_P(ClockGettime, CorrectVDSOClockTest, - ::testing::Values(CLOCK_MONOTONIC, CLOCK_REALTIME), + ::testing::Values(CLOCK_MONOTONIC, + CLOCK_REALTIME, + CLOCK_BOOTTIME), PrintClockId); } // namespace |