brintos

brintos / llvm-project-archived public Read only

0
0
Text · 763 B · d593c5d Raw
21 lines · cpp
1//===-- unit tests for darwin's time utilities --------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "src/__support/time/clock_gettime.h"10#include "src/__support/CPP/expected.h"11#include "test/UnitTest/Test.h"12 13template <class T, class E>14using expected = LIBC_NAMESPACE::cpp::expected<T, E>;15 16TEST(LlvmLibcSupportDarwinClockGetTime, BasicGetTime) {17  struct timespec ts;18  auto result = LIBC_NAMESPACE::internal::clock_gettime(CLOCK_REALTIME, &ts);19  ASSERT_TRUE(result.has_value());20}21