]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp
Vendor import of libc++ trunk r351319 (just before the release_80
[FreeBSD/FreeBSD.git] / test / std / utilities / time / time.clock / time.clock.file / now.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
11
12 // TODO: Remove this when filesystem gets integrated into the dylib
13 // REQUIRES: c++filesystem
14
15 // <chrono>
16
17 // file_clock
18
19 // static time_point now() noexcept;
20
21 #include <chrono>
22 #include <cassert>
23
24 #include "test_macros.h"
25
26 int main()
27 {
28     typedef std::chrono::file_clock C;
29     ASSERT_NOEXCEPT(C::now());
30
31     C::time_point t1 = C::now();
32     assert(t1.time_since_epoch().count() != 0);
33     assert(C::time_point::min() < t1);
34     assert(C::time_point::max() > t1);
35 }