forked from mpusz/mp-units
@@ -22,11 +22,11 @@
|
||||
|
||||
#include <numeric>
|
||||
#include <units/random.h>
|
||||
#include <units/physical/si/length.h>
|
||||
#include <units/isq/si/length.h>
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::isq::si;
|
||||
|
||||
TEST_CASE("uniform_int_distribution")
|
||||
{
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
|
||||
#include <units/format.h>
|
||||
#include <units/math.h>
|
||||
#include <units/physical/si/si.h>
|
||||
#include <units/physical/si/cgs/cgs.h>
|
||||
#include <units/isq/si/si.h>
|
||||
#include <units/isq/si/cgs/cgs.h>
|
||||
#include <units/quantity_io.h>
|
||||
#include <catch2/catch.hpp>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::isq;
|
||||
using namespace units::isq::si;
|
||||
using namespace Catch::Matchers;
|
||||
|
||||
TEST_CASE("operator<< on a quantity", "[text][ostream][fmt]")
|
||||
|
||||
@@ -21,20 +21,20 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "units/format.h"
|
||||
#include "units/physical/si/si.h"
|
||||
#include "units/physical/si/iau/iau.h"
|
||||
#include "units/physical/si/imperial/imperial.h"
|
||||
#include "units/physical/si/international/international.h"
|
||||
#include "units/physical/si/typographic/typographic.h"
|
||||
#include "units/physical/si/us/us.h"
|
||||
#include "units/isq/si/si.h"
|
||||
#include "units/isq/si/iau/iau.h"
|
||||
#include "units/isq/si/imperial/imperial.h"
|
||||
#include "units/isq/si/international/international.h"
|
||||
#include "units/isq/si/typographic/typographic.h"
|
||||
#include "units/isq/si/us/us.h"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
using namespace units::physical::si;
|
||||
using namespace units::physical::si::international;
|
||||
using namespace units::physical::si::us;
|
||||
using namespace units::physical::si::iau;
|
||||
using namespace units::physical::si::imperial;
|
||||
using namespace units::physical::si::typographic;
|
||||
using namespace units::isq::si;
|
||||
using namespace units::isq::si::international;
|
||||
using namespace units::isq::si::us;
|
||||
using namespace units::isq::si::iau;
|
||||
using namespace units::isq::si::imperial;
|
||||
using namespace units::isq::si::typographic;
|
||||
|
||||
TEST_CASE("fmt::format on synthesized unit symbols", "[text][fmt]")
|
||||
{
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "units/math.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/volume.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/volume.h"
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::isq::si;
|
||||
|
||||
// classical
|
||||
|
||||
|
||||
@@ -20,22 +20,22 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <units/physical/si/cgs/cgs.h>
|
||||
#include <units/physical/si/acceleration.h>
|
||||
#include <units/physical/si/area.h>
|
||||
#include <units/physical/si/energy.h>
|
||||
#include <units/physical/si/force.h>
|
||||
#include <units/physical/si/length.h>
|
||||
#include <units/physical/si/mass.h>
|
||||
#include <units/physical/si/power.h>
|
||||
#include <units/physical/si/pressure.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/physical/si/time.h>
|
||||
#include <units/isq/si/cgs/cgs.h>
|
||||
#include <units/isq/si/acceleration.h>
|
||||
#include <units/isq/si/area.h>
|
||||
#include <units/isq/si/energy.h>
|
||||
#include <units/isq/si/force.h>
|
||||
#include <units/isq/si/length.h>
|
||||
#include <units/isq/si/mass.h>
|
||||
#include <units/isq/si/power.h>
|
||||
#include <units/isq/si/pressure.h>
|
||||
#include <units/isq/si/speed.h>
|
||||
#include <units/isq/si/time.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si::cgs;
|
||||
using namespace units::isq::si::cgs;
|
||||
|
||||
/* ************** BASE DIMENSIONS **************** */
|
||||
|
||||
@@ -65,8 +65,8 @@ static_assert(centimetre::ratio / dimension_unit<dim_length>::ratio == ratio(1))
|
||||
static_assert((1_q_cm * 1_q_cm).count() == 1);
|
||||
static_assert((1_q_cm2).count() == 1);
|
||||
static_assert(1_q_cm * 1_q_cm == 1_q_cm2);
|
||||
static_assert(100_q_cm * 100_q_cm == area<physical::si::square_metre>(1));
|
||||
static_assert(100_q_cm * 100_q_cm == length<physical::si::metre>(1) * length<physical::si::metre>(1));
|
||||
static_assert(100_q_cm * 100_q_cm == area<isq::si::square_metre>(1));
|
||||
static_assert(100_q_cm * 100_q_cm == length<isq::si::metre>(1) * length<isq::si::metre>(1));
|
||||
static_assert(100_q_cm2 / 10_q_cm == 10_q_cm);
|
||||
|
||||
static_assert(detail::unit_text<dim_area, square_centimetre>() == basic_symbol_text("cm²", "cm^2"));
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
|
||||
#include "test_tools.h"
|
||||
#include <units/chrono.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/isq/si/speed.h>
|
||||
#include <units/quantity_point.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical;
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::isq;
|
||||
using namespace units::isq::si::literals;
|
||||
using namespace std::chrono_literals;
|
||||
using sys_seconds = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
|
||||
using sys_days = std::chrono::time_point<std::chrono::system_clock,
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include "units/physical/si/cgs/speed.h"
|
||||
#include "units/physical/si/speed.h"
|
||||
#include "units/physical/si/fps/speed.h"
|
||||
#include "units/isq/si/cgs/speed.h"
|
||||
#include "units/isq/si/speed.h"
|
||||
#include "units/isq/si/fps/speed.h"
|
||||
#include "units/quantity_point.h"
|
||||
#include "units/chrono.h"
|
||||
#include <chrono>
|
||||
@@ -34,7 +34,7 @@
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical;
|
||||
using namespace units::isq;
|
||||
|
||||
// Prefix family
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include "units/physical/si/length.h"
|
||||
#include "units/isq/si/length.h"
|
||||
#include <ostream>
|
||||
|
||||
namespace {
|
||||
@@ -82,7 +82,7 @@ struct std::common_type<min_expl<Mode>, std::intmax_t> : std::type_identity<min_
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::isq::si;
|
||||
|
||||
// quantity explicitly constructible (not convertible) from the representation type
|
||||
static_assert(std::constructible_from<length<metre, min_expl<>>, min_expl<>>);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "units/math.h"
|
||||
#include "units/physical/si/length.h"
|
||||
#include "units/isq/si/length.h"
|
||||
#include <chrono>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
@@ -60,7 +60,7 @@ struct std::common_type<U, min_impl<T>> : std::common_type<T, U> {};
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::isq::si;
|
||||
|
||||
static_assert(QuantityValue<min_impl<int>>);
|
||||
static_assert(QuantityValue<min_impl<double>>);
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "test_tools.h"
|
||||
#include <units/physical/si/mass.h>
|
||||
#include <units/physical/si/voltage.h>
|
||||
#include <units/physical/si/time.h>
|
||||
#include <units/physical/si/frequency.h>
|
||||
#include <units/isq/si/mass.h>
|
||||
#include <units/isq/si/voltage.h>
|
||||
#include <units/isq/si/time.h>
|
||||
#include <units/isq/si/frequency.h>
|
||||
#include <units/math.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::isq::si;
|
||||
|
||||
// power spectral density
|
||||
struct sq_volt_per_hertz : unit<sq_volt_per_hertz> {};
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
// SOFTWARE.
|
||||
|
||||
|
||||
#include <units/physical/si/si.h>
|
||||
#include <units/isq/si/si.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical;
|
||||
using namespace units::isq;
|
||||
|
||||
static_assert(Length<si::length<si::metre>>);
|
||||
static_assert(!Length<si::time<si::second>>);
|
||||
|
||||
@@ -20,22 +20,22 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <units/physical/si/fps/fps.h>
|
||||
#include <units/physical/si/acceleration.h>
|
||||
#include <units/physical/si/area.h>
|
||||
#include <units/physical/si/energy.h>
|
||||
#include <units/physical/si/force.h>
|
||||
#include <units/physical/si/length.h>
|
||||
#include <units/physical/si/mass.h>
|
||||
#include <units/physical/si/power.h>
|
||||
#include <units/physical/si/pressure.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/physical/si/time.h>
|
||||
#include <units/isq/si/fps/fps.h>
|
||||
#include <units/isq/si/acceleration.h>
|
||||
#include <units/isq/si/area.h>
|
||||
#include <units/isq/si/energy.h>
|
||||
#include <units/isq/si/force.h>
|
||||
#include <units/isq/si/length.h>
|
||||
#include <units/isq/si/mass.h>
|
||||
#include <units/isq/si/power.h>
|
||||
#include <units/isq/si/pressure.h>
|
||||
#include <units/isq/si/speed.h>
|
||||
#include <units/isq/si/time.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si::fps;
|
||||
using namespace units::isq::si::fps;
|
||||
|
||||
/* ************** BASE DIMENSIONS **************** */
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
#include "test_tools.h"
|
||||
#include "units/generic/angle.h"
|
||||
#include "units/kind.h"
|
||||
#include "units/physical/si/length.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/speed.h"
|
||||
#include "units/isq/si/length.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/speed.h"
|
||||
|
||||
using namespace units;
|
||||
using namespace physical::si;
|
||||
using namespace isq::si;
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -106,7 +106,7 @@ static_assert(!equivalent<radius, radial_area>);
|
||||
static_assert(!equivalent<radius, radial_point>);
|
||||
|
||||
|
||||
struct width : kind<width, units::physical::si::dim_length> {};
|
||||
struct width : kind<width, units::isq::si::dim_length> {};
|
||||
using horizontal_speed = downcast_kind<width, dim_speed>;
|
||||
|
||||
struct abscissa : point_kind<abscissa, width> {}; // program-defined base point kind
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
|
||||
#include "units/math.h"
|
||||
#include "test_tools.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/volume.h"
|
||||
#include "units/physical/si/international/area.h"
|
||||
#include "units/physical/si/international/volume.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/volume.h"
|
||||
#include "units/isq/si/international/area.h"
|
||||
#include "units/isq/si/international/volume.h"
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::physical::si::international::literals;
|
||||
using namespace units::isq::si::literals;
|
||||
using namespace units::isq::si::international::literals;
|
||||
|
||||
static_assert(compare<decltype(pow<0>(2_q_m)), std::int64_t>);
|
||||
static_assert(compare<decltype(pow<1>(2_q_m)), decltype(2_q_m)>);
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
#include "test_tools.h"
|
||||
#include "units/chrono.h"
|
||||
#include "units/physical/si/cgs/speed.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/frequency.h"
|
||||
#include "units/physical/si/speed.h"
|
||||
#include "units/physical/si/fps/speed.h"
|
||||
#include "units/isq/si/cgs/speed.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/frequency.h"
|
||||
#include "units/isq/si/speed.h"
|
||||
#include "units/isq/si/fps/speed.h"
|
||||
#include "units/quantity_point.h"
|
||||
#include "units/quantity_kind.h"
|
||||
#include <cassert>
|
||||
@@ -36,7 +36,7 @@
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
namespace si = physical::si;
|
||||
namespace si = isq::si;
|
||||
using namespace si;
|
||||
using namespace unit_constants;
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
#include "test_tools.h"
|
||||
#include "units/chrono.h"
|
||||
#include "units/physical/si/cgs/speed.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/frequency.h"
|
||||
#include "units/physical/si/speed.h"
|
||||
#include "units/physical/si/fps/speed.h"
|
||||
#include "units/isq/si/cgs/speed.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/frequency.h"
|
||||
#include "units/isq/si/speed.h"
|
||||
#include "units/isq/si/fps/speed.h"
|
||||
#include "units/quantity_point.h"
|
||||
#include "units/quantity_point_kind.h"
|
||||
#include <cassert>
|
||||
@@ -36,7 +36,7 @@
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
namespace si = physical::si;
|
||||
namespace si = isq::si;
|
||||
using namespace si;
|
||||
using namespace unit_constants;
|
||||
using sys_seconds = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
|
||||
@@ -633,8 +633,8 @@ static_assert(invalid_cast<int>);
|
||||
|
||||
namespace mylib {
|
||||
|
||||
struct width_kind : kind<width_kind, units::physical::si::dim_length> {};
|
||||
struct height_kind : kind<height_kind, units::physical::si::dim_length> {};
|
||||
struct width_kind : kind<width_kind, units::isq::si::dim_length> {};
|
||||
struct height_kind : kind<height_kind, units::isq::si::dim_length> {};
|
||||
struct abscissa_kind : point_kind<abscissa_kind, width_kind> {};
|
||||
struct ordinate_kind : point_kind<ordinate_kind, height_kind> {};
|
||||
|
||||
|
||||
@@ -24,16 +24,16 @@
|
||||
#include "test_tools.h"
|
||||
#include "units/chrono.h"
|
||||
#include "units/math.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/speed.h"
|
||||
#include "units/physical/si/volume.h"
|
||||
#include "units/physical/si/us/length.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/speed.h"
|
||||
#include "units/isq/si/volume.h"
|
||||
#include "units/isq/si/us/length.h"
|
||||
#include <utility>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace physical::si;
|
||||
using namespace isq::si;
|
||||
using namespace unit_constants;
|
||||
using namespace std::chrono_literals;
|
||||
using sys_seconds = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
|
||||
@@ -212,7 +212,7 @@ static_assert(compare<common_quantity_point<quantity_point<dim_length, kilometre
|
||||
|
||||
// common_type
|
||||
|
||||
using namespace units::physical::si::us::literals;
|
||||
using namespace units::isq::si::us::literals;
|
||||
|
||||
static_assert(std::equality_comparable<decltype(quantity_point(1_q_m))>);
|
||||
static_assert(std::equality_comparable_with<decltype(quantity_point(1_q_m)), decltype(quantity_point(1_q_km))>);
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
#include "test_tools.h"
|
||||
#include "units/math.h"
|
||||
#include "units/physical/si/cgs/speed.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/frequency.h"
|
||||
#include "units/physical/si/speed.h"
|
||||
#include "units/physical/si/volume.h"
|
||||
#include "units/physical/si/fps/speed.h"
|
||||
#include "units/isq/si/cgs/speed.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/frequency.h"
|
||||
#include "units/isq/si/speed.h"
|
||||
#include "units/isq/si/volume.h"
|
||||
#include "units/isq/si/fps/speed.h"
|
||||
#include <chrono>
|
||||
#include <complex>
|
||||
#include <cstdint>
|
||||
@@ -38,7 +38,7 @@
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
namespace si = physical::si;
|
||||
namespace si = isq::si;
|
||||
using namespace si;
|
||||
using namespace unit_constants;
|
||||
|
||||
@@ -202,8 +202,8 @@ static_assert(std::constructible_from<fps::length<fps::foot>, cgs::length<cgs::c
|
||||
static_assert(std::convertible_to<cgs::length<cgs::centimetre>, fps::length<fps::foot>>);
|
||||
|
||||
// conversion between different dimensions not allowed
|
||||
static_assert(!std::constructible_from<length<metre>, physical::si::time<second>>);
|
||||
static_assert(!std::convertible_to<physical::si::time<second>, length<metre>>);
|
||||
static_assert(!std::constructible_from<length<metre>, isq::si::time<second>>);
|
||||
static_assert(!std::convertible_to<isq::si::time<second>, length<metre>>);
|
||||
static_assert(!std::constructible_from<length<metre>, speed<metre_per_second>>);
|
||||
static_assert(!std::convertible_to<speed<metre_per_second>, length<metre>>);
|
||||
|
||||
@@ -465,7 +465,7 @@ static_assert(compare<decltype(1_q_m_per_s * 1_q_h), length<scaled_unit<ratio(36
|
||||
static_assert(compare<decltype(1_q_m * 1_q_min), quantity<unknown_dimension<exponent<dim_length, 1>, exponent<dim_time, 1>>, scaled_unit<ratio(60), unknown_coherent_unit>, std::int64_t>>);
|
||||
static_assert(compare<decltype(1_q_s * 1_q_Hz), dimensionless<one, std::int64_t>>);
|
||||
static_assert(compare<decltype(1 / 1_q_min), frequency<scaled_unit<ratio(1, 60), hertz>, std::int64_t>>);
|
||||
static_assert(compare<decltype(1 / 1_q_Hz), physical::si::time<second, std::int64_t>>);
|
||||
static_assert(compare<decltype(1 / 1_q_Hz), isq::si::time<second, std::int64_t>>);
|
||||
static_assert(compare<decltype(1 / 1_q_km), quantity<unknown_dimension<exponent<dim_length, -1>>, scaled_unit<ratio(1, 1, -3), unknown_coherent_unit>, std::int64_t>>);
|
||||
static_assert(compare<decltype(1_q_km / 1_q_m), dimensionless<scaled_unit<ratio(1000), one>, std::int64_t>>);
|
||||
static_assert(compare<decltype(1_q_m / 1_q_s), speed<metre_per_second, std::int64_t>>);
|
||||
|
||||
@@ -20,30 +20,30 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <units/physical/si/acceleration.h>
|
||||
#include <units/physical/si/area.h>
|
||||
#include <units/physical/si/cgs/acceleration.h>
|
||||
#include <units/physical/si/cgs/area.h>
|
||||
#include <units/physical/si/cgs/energy.h>
|
||||
#include <units/physical/si/cgs/force.h>
|
||||
#include <units/physical/si/cgs/length.h>
|
||||
#include <units/physical/si/cgs/mass.h>
|
||||
#include <units/physical/si/cgs/power.h>
|
||||
#include <units/physical/si/cgs/pressure.h>
|
||||
#include <units/physical/si/cgs/speed.h>
|
||||
#include <units/physical/si/cgs/time.h>
|
||||
#include <units/physical/si/energy.h>
|
||||
#include <units/physical/si/force.h>
|
||||
#include <units/physical/si/length.h>
|
||||
#include <units/physical/si/mass.h>
|
||||
#include <units/physical/si/power.h>
|
||||
#include <units/physical/si/pressure.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/physical/si/time.h>
|
||||
#include <units/isq/si/acceleration.h>
|
||||
#include <units/isq/si/area.h>
|
||||
#include <units/isq/si/cgs/acceleration.h>
|
||||
#include <units/isq/si/cgs/area.h>
|
||||
#include <units/isq/si/cgs/energy.h>
|
||||
#include <units/isq/si/cgs/force.h>
|
||||
#include <units/isq/si/cgs/length.h>
|
||||
#include <units/isq/si/cgs/mass.h>
|
||||
#include <units/isq/si/cgs/power.h>
|
||||
#include <units/isq/si/cgs/pressure.h>
|
||||
#include <units/isq/si/cgs/speed.h>
|
||||
#include <units/isq/si/cgs/time.h>
|
||||
#include <units/isq/si/energy.h>
|
||||
#include <units/isq/si/force.h>
|
||||
#include <units/isq/si/length.h>
|
||||
#include <units/isq/si/mass.h>
|
||||
#include <units/isq/si/power.h>
|
||||
#include <units/isq/si/pressure.h>
|
||||
#include <units/isq/si/speed.h>
|
||||
#include <units/isq/si/time.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units::physical;
|
||||
using namespace units::isq;
|
||||
|
||||
static_assert(units::detail::quantity_ratio<si::length<si::metre>> == units::ratio(1));
|
||||
static_assert(units::detail::quantity_ratio<si::cgs::length<si::cgs::centimetre>> == units::ratio(1, 100));
|
||||
@@ -65,7 +65,7 @@ static_assert(si::cgs::pressure<si::cgs::barye>(10) == si::pressure<si::pascal>(
|
||||
|
||||
namespace si_test {
|
||||
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::isq::si::literals;
|
||||
|
||||
static_assert(si::cgs::length<si::cgs::centimetre>(100) == 1_q_m);
|
||||
static_assert(si::cgs::mass<si::cgs::gram>(1'000) == 1_q_kg);
|
||||
@@ -81,7 +81,7 @@ static_assert(si::cgs::pressure<si::cgs::barye>(10) == 1_q_Pa);
|
||||
|
||||
namespace cgs_test {
|
||||
|
||||
using namespace units::physical::si::cgs::literals;
|
||||
using namespace units::isq::si::cgs::literals;
|
||||
|
||||
static_assert(100_q_cm == si::length<si::metre>(1));
|
||||
static_assert(1'000_q_g == si::mass<si::kilogram>(1));
|
||||
@@ -97,8 +97,8 @@ static_assert(10_q_Ba == si::pressure<si::pascal>(1));
|
||||
|
||||
namespace both_test {
|
||||
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::physical::si::cgs::literals;
|
||||
using namespace units::isq::si::literals;
|
||||
using namespace units::isq::si::cgs::literals;
|
||||
|
||||
// static_assert(100_q_cm == 1_q_m); // ambiguous
|
||||
// static_assert(1'000_q_g == 1_q_kg); // ambiguous
|
||||
|
||||
@@ -20,30 +20,30 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <units/physical/si/acceleration.h>
|
||||
#include <units/physical/si/area.h>
|
||||
#include <units/physical/si/energy.h>
|
||||
#include <units/physical/si/force.h>
|
||||
#include <units/physical/si/fps/acceleration.h>
|
||||
#include <units/physical/si/fps/area.h>
|
||||
#include <units/physical/si/fps/energy.h>
|
||||
#include <units/physical/si/fps/force.h>
|
||||
#include <units/physical/si/fps/length.h>
|
||||
#include <units/physical/si/fps/mass.h>
|
||||
#include <units/physical/si/fps/power.h>
|
||||
#include <units/physical/si/fps/pressure.h>
|
||||
#include <units/physical/si/fps/speed.h>
|
||||
#include <units/physical/si/fps/time.h>
|
||||
#include <units/physical/si/length.h>
|
||||
#include <units/physical/si/mass.h>
|
||||
#include <units/physical/si/power.h>
|
||||
#include <units/physical/si/pressure.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/physical/si/time.h>
|
||||
#include <units/isq/si/acceleration.h>
|
||||
#include <units/isq/si/area.h>
|
||||
#include <units/isq/si/energy.h>
|
||||
#include <units/isq/si/force.h>
|
||||
#include <units/isq/si/fps/acceleration.h>
|
||||
#include <units/isq/si/fps/area.h>
|
||||
#include <units/isq/si/fps/energy.h>
|
||||
#include <units/isq/si/fps/force.h>
|
||||
#include <units/isq/si/fps/length.h>
|
||||
#include <units/isq/si/fps/mass.h>
|
||||
#include <units/isq/si/fps/power.h>
|
||||
#include <units/isq/si/fps/pressure.h>
|
||||
#include <units/isq/si/fps/speed.h>
|
||||
#include <units/isq/si/fps/time.h>
|
||||
#include <units/isq/si/length.h>
|
||||
#include <units/isq/si/mass.h>
|
||||
#include <units/isq/si/power.h>
|
||||
#include <units/isq/si/pressure.h>
|
||||
#include <units/isq/si/speed.h>
|
||||
#include <units/isq/si/time.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units::physical;
|
||||
using namespace units::isq;
|
||||
|
||||
static_assert(si::fps::length<si::fps::foot>(1) == si::length<si::metre>(0.3048));
|
||||
static_assert(si::fps::mass<si::fps::pound>(1) == si::mass<si::kilogram>(0.45359237));
|
||||
@@ -62,7 +62,7 @@ static_assert(si::fps::pressure<si::fps::poundal_per_foot_sq>(1) > si::pressure<
|
||||
|
||||
namespace si_literals {
|
||||
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::isq::si::literals;
|
||||
|
||||
static_assert(si::fps::length<si::fps::foot>(1) == 0.3048_q_m);
|
||||
static_assert(si::fps::mass<si::fps::pound>(1) == 0.45359237_q_kg);
|
||||
@@ -82,7 +82,7 @@ static_assert(si::fps::pressure<si::fps::poundal_per_foot_sq>(1) > 1.4881639435
|
||||
|
||||
namespace fps_literals {
|
||||
|
||||
using namespace units::physical::si::fps::literals;
|
||||
using namespace units::isq::si::fps::literals;
|
||||
|
||||
static_assert(1_q_ft == si::length<si::metre>(0.3048));
|
||||
static_assert(1_q_lb == si::mass<si::kilogram>(0.45359237));
|
||||
@@ -102,8 +102,8 @@ static_assert(1_q_pdl_per_ft2> si::pressure<si::pascal>(1.4881639435) &&
|
||||
|
||||
namespace fps_plus_si_literals {
|
||||
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::physical::si::fps::literals;
|
||||
using namespace units::isq::si::literals;
|
||||
using namespace units::isq::si::fps::literals;
|
||||
|
||||
// static_assert(100_q_cm == 1_q_m); // ambiguous
|
||||
// static_assert(1'000_q_g == 1_q_kg); // ambiguous
|
||||
@@ -126,7 +126,7 @@ static_assert(1_q_pdl_per_ft2> 1.4881639435_q_Pa &&
|
||||
|
||||
namespace fps_test {
|
||||
|
||||
using namespace units::physical::si::fps::literals;
|
||||
using namespace units::isq::si::fps::literals;
|
||||
|
||||
// addition
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
#include "test_tools.h"
|
||||
#include <units/math.h>
|
||||
#include <units/physical/si/si.h>
|
||||
#include <units/isq/si/si.h>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::isq::si;
|
||||
|
||||
/* ************** BASE DIMENSIONS **************** */
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "units/bits/external/hacks.h"
|
||||
#include "units/physical/dimensions/length.h"
|
||||
#include "units/physical/dimensions/speed.h"
|
||||
#include "units/physical/si/length.h"
|
||||
#include "units/physical/si/mass.h"
|
||||
#include "units/physical/si/time.h"
|
||||
#include "units/physical/si/area.h"
|
||||
#include "units/physical/si/speed.h"
|
||||
#include "units/isq/dimensions/length.h"
|
||||
#include "units/isq/dimensions/speed.h"
|
||||
#include "units/isq/si/length.h"
|
||||
#include "units/isq/si/mass.h"
|
||||
#include "units/isq/si/time.h"
|
||||
#include "units/isq/si/area.h"
|
||||
#include "units/isq/si/speed.h"
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
@@ -37,9 +37,9 @@
|
||||
#endif
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::physical::si::unit_constants;
|
||||
using namespace units::isq;
|
||||
using namespace units::isq::si;
|
||||
using namespace units::isq::si::unit_constants;
|
||||
|
||||
static_assert(2 * m == 2_q_m);
|
||||
static_assert(2 * s == 2_q_s);
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
#include "test_tools.h"
|
||||
#include "units/unit.h"
|
||||
#include "units/bits/equivalent.h"
|
||||
#include "units/physical/si/prefixes.h"
|
||||
#include "units/isq/si/prefixes.h"
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical;
|
||||
using namespace units::isq;
|
||||
|
||||
struct metre : named_unit<metre, "m", si::prefix> {};
|
||||
struct centimetre : prefixed_unit<centimetre, si::centi, metre> {};
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/physical/si/international/speed.h>
|
||||
#include <units/isq/si/speed.h>
|
||||
#include <units/isq/si/international/speed.h>
|
||||
#include <utility>
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
using namespace units::physical::si;
|
||||
using namespace units::physical::si::international;
|
||||
using namespace units::isq::si;
|
||||
using namespace units::isq::si::international;
|
||||
|
||||
/* ************** BASE DIMENSIONS **************** */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user