disable_boost_fpc_tolerance.hpp
Go to the documentation of this file.
1 #ifndef LARDATAALG_TEST_UTILITIES_DISABLE_BOOST_FPC_TOLERANCE_HPP
2 #define LARDATAALG_TEST_UTILITIES_DISABLE_BOOST_FPC_TOLERANCE_HPP
3 
4 #include <boost/test/tools/floating_point_comparison.hpp>
5 
8 
9 // Because util::quantites::seconds (etc.) has std::numeric_limits<>
10 // specializations, the Boost unit test suite assumes they are
11 // suitable for floating-point comparisons, particularly tolerance
12 // testing (due to the inexact nature of the representation). The
13 // following specializations disable such tolerance testing.
14 
15 namespace boost::math::fpc {
16  template <>
17  struct tolerance_based<util::quantities::seconds> : std::false_type {};
18  template <>
19  struct tolerance_based<util::quantities::milliseconds> : std::false_type {};
20  template <>
21  struct tolerance_based<util::quantities::microseconds> : std::false_type {};
22  template <>
23  struct tolerance_based<util::quantities::nanoseconds> : std::false_type {};
24 
25  // Intervals
26  template <>
27  struct tolerance_based<util::quantities::intervals::microseconds> : std::false_type {};
28 
29  // Points
30  template <>
31  struct tolerance_based<util::quantities::points::millisecond> : std::false_type {};
32  template <>
33  struct tolerance_based<util::quantities::points::microsecond> : std::false_type {};
34 
35  // Electronics
36  template <>
37  struct tolerance_based<util::quantities::tick_d> : std::false_type {};
38 }
39 
40 #endif /* LARDATAALG_TEST_UTILITIES_DISABLE_BOOST_FPC_TOLERANCE_HPP */
Namespace for general, non-LArSoft-specific utilities.
microsecond_as<> microsecond
Type of time stored in microseconds, in double precision.
Definition: spacetime.h:119
microsecond microseconds
Alias for common language habits.
Definition: spacetime.h:122
millisecond_as<> millisecond
Type of time stored in milliseconds, in double precision.
Definition: spacetime.h:102
tick_as< double > tick_d
Tick number, represented by double.
Definition: electronics.h:87
second seconds
Alias for common language habits.
Definition: spacetime.h:88
millisecond milliseconds
Alias for common language habits.
Definition: spacetime.h:105
Numeric variable proxies with embedded unit of measurement.
Dimensioned variables related to electronics.
nanosecond nanoseconds
Alias for common language habits.
Definition: spacetime.h:139