1 | /* Copyright (c) 2020 CrystalClear Software, Inc. |
2 | * Use, modification and distribution is subject to the |
3 | * Boost Software License, Version 1.0. (See accompanying |
4 | * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
5 | * Author: Jeff Garland |
6 | */ |
7 | |
8 | #include "boost/date_time/wrapping_int.hpp" |
9 | |
10 | //#include <boost/date_time.hpp> |
11 | #include "boost/date_time/posix_time/posix_time_duration.hpp" |
12 | |
13 | #include "testfrmwk.hpp" |
14 | #include <iostream> |
15 | |
16 | using std::cout; |
17 | using std::endl; |
18 | |
19 | int |
20 | main() |
21 | { |
22 | using namespace boost::date_time; |
23 | using namespace boost::posix_time; |
24 | |
25 | #ifdef BOOST_NO_CXX14_CONSTEXPR |
26 | check("constexpr not configured" , true); |
27 | #else |
28 | constexpr wrapping_int<int, 3600> wi(3599); |
29 | static_assert(wi == 3599, "constexpr construction/conversion" ); |
30 | check(testname: "constexpr wrapping construct and equal" , testcond: true); |
31 | |
32 | constexpr microseconds ms(1000); |
33 | static_assert(ms.is_special() == false, "constexpr duration is_special" ); |
34 | static_assert(ms.is_positive() == true, "constexpr duration is_positive" ); |
35 | static_assert(ms.is_negative() == false, "constexpr duration is_negative" ); |
36 | static_assert(ms.total_microseconds() == 1000, "constexpr total_microseconds" ); |
37 | check(testname: "constexpr microseconds - total_microseconds" , testcond: true); |
38 | |
39 | #endif |
40 | |
41 | #ifdef BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG |
42 | cout << "Standard Config" << endl; |
43 | #else |
44 | cout << "NOT Standard Config" << endl; |
45 | #endif |
46 | |
47 | #ifdef BOOST_DATE_TIME_HAS_NANOSECONDS |
48 | cout << "Has NANO: " << endl; |
49 | #else |
50 | cout << "NO NANO: " << endl; |
51 | #endif |
52 | |
53 | check(testname: "success" , testcond: true); |
54 | |
55 | return printTestStats(); |
56 | |
57 | } |
58 | |
59 | |
60 | |