File: testmisc.cpp

package info (click to toggle)
boost1.74 1.74.0%2Bds1-21
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 463,588 kB
  • sloc: cpp: 3,338,117; xml: 131,293; python: 33,088; ansic: 14,292; asm: 4,038; sh: 3,353; makefile: 1,193; perl: 1,036; yacc: 478; php: 212; ruby: 102; lisp: 24; sql: 13; csh: 6
file content (59 lines) | stat: -rw-r--r-- 1,561 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* Copyright (c) 2020 CrystalClear Software, Inc.
 * Use, modification and distribution is subject to the 
 * Boost Software License, Version 1.0. (See accompanying
 * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 * Author: Jeff Garland
 */

#include "boost/date_time/wrapping_int.hpp"

//#include <boost/date_time.hpp>
#include "boost/date_time/posix_time/posix_time_duration.hpp"

#include "testfrmwk.hpp"
#include <iostream>

using std::cout;
using std::endl;

int
main() 
{
  using namespace boost::date_time;
  using namespace boost::posix_time;

#ifdef BOOST_NO_CXX14_CONSTEXPR
  check("constexpr not configured", true);
#else
  constexpr wrapping_int<int, 3600> wi(3599);
  static_assert(wi == 3599, "constexpr construction/conversion");
  check("constexpr wrapping construct and equal", true);

  constexpr microseconds ms(1000);
  static_assert(ms.is_special()  == false, "constexpr duration is_special");
  static_assert(ms.is_positive() == true,  "constexpr duration is_positive");
  static_assert(ms.is_negative() == false, "constexpr duration is_negative");
  static_assert(ms.total_microseconds() == 1000, "constexpr total_microseconds");
  check("constexpr microseconds - total_microseconds", true);
  
#endif 
  
#ifdef BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
  cout << "Standard Config" << endl;
#else 
  cout << "NOT Standard Config" << endl;
#endif

#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
  cout << "Has NANO: " << endl;
#else
  cout << "NO NANO: " << endl;
#endif
  
  check("success", true);

  return printTestStats();

}