mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 19:04:27 +02:00
test: quantity
tests updated
This commit is contained in:
@@ -83,12 +83,16 @@ static_assert(std::three_way_comparable<quantity<isq::length[m]>>);
|
|||||||
// member values
|
// member values
|
||||||
//////////////////
|
//////////////////
|
||||||
|
|
||||||
|
static_assert(quantity<si::metre>::reference == si::metre);
|
||||||
|
static_assert(quantity<si::metre>::quantity_spec == kind_of<isq::length>);
|
||||||
|
static_assert(quantity<si::metre>::dimension == isq::dim_length);
|
||||||
|
static_assert(quantity<si::metre>::unit == si::metre);
|
||||||
|
|
||||||
static_assert(quantity<isq::length[m]>::reference == isq::length[m]);
|
static_assert(quantity<isq::length[m]>::reference == isq::length[m]);
|
||||||
static_assert(quantity<isq::length[m]>::quantity_spec == isq::length);
|
static_assert(quantity<isq::length[m]>::quantity_spec == isq::length);
|
||||||
static_assert(quantity<isq::length[m]>::dimension == isq::dim_length);
|
static_assert(quantity<isq::length[m]>::dimension == isq::dim_length);
|
||||||
static_assert(quantity<isq::length[m]>::unit == si::metre);
|
static_assert(quantity<isq::length[m]>::unit == si::metre);
|
||||||
|
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
// member types
|
// member types
|
||||||
//////////////////
|
//////////////////
|
||||||
@@ -155,8 +159,7 @@ static_assert(!std::convertible_to<int, quantity<dimensionless[percent]>>);
|
|||||||
static_assert(!std::constructible_from<quantity<dimensionless[percent]>, short>);
|
static_assert(!std::constructible_from<quantity<dimensionless[percent]>, short>);
|
||||||
static_assert(!std::convertible_to<short, quantity<dimensionless[percent]>>);
|
static_assert(!std::convertible_to<short, quantity<dimensionless[percent]>>);
|
||||||
|
|
||||||
static_assert(!std::constructible_from<quantity<dimensionless[percent], short>,
|
static_assert(!std::constructible_from<quantity<dimensionless[percent], short>, int>);
|
||||||
int>); // truncating implicit conversions int -> short allowed
|
|
||||||
static_assert(!std::convertible_to<int, quantity<dimensionless[percent], short>>);
|
static_assert(!std::convertible_to<int, quantity<dimensionless[percent], short>>);
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user