test: a few quantity_spec tests added

This commit is contained in:
Mateusz Pusz
2024-02-20 19:59:46 +01:00
parent 8e2a3c6340
commit cd61e077b7

View File

@ -198,6 +198,8 @@ static_assert(is_of_type<pow<2>(length) / pow<2>(length), dimensionless_>);
static_assert(is_of_type<pow<2>(length) / length, length_>); static_assert(is_of_type<pow<2>(length) / length, length_>);
static_assert(is_of_type<length / pow<2>(length), derived_quantity_spec<dimensionless_, per<length_>>>); static_assert(is_of_type<length / pow<2>(length), derived_quantity_spec<dimensionless_, per<length_>>>);
static_assert(is_of_type<length / height, derived_quantity_spec<length_, per<height_>>>);
static_assert(is_of_type<length * time, derived_quantity_spec<length_, time_>>); static_assert(is_of_type<length * time, derived_quantity_spec<length_, time_>>);
static_assert(is_of_type<length * length, derived_quantity_spec<mp_units::power<length_, 2>>>); static_assert(is_of_type<length * length, derived_quantity_spec<mp_units::power<length_, 2>>>);
@ -625,6 +627,10 @@ static_assert(convertible_impl(power / power, efficiency) == explicit_conversion
static_assert(convertible_impl(stress / stress, strain) == explicit_conversion); static_assert(convertible_impl(stress / stress, strain) == explicit_conversion);
static_assert(convertible_impl(stress / stress, efficiency) == explicit_conversion); static_assert(convertible_impl(stress / stress, efficiency) == explicit_conversion);
// specialized dimensionless to dimensionless and back
static_assert(convertible_impl(height / width, dimensionless) == yes);
static_assert(convertible_impl(dimensionless, height / width) == explicit_conversion);
// derived with dimensionless remainder after explosion // derived with dimensionless remainder after explosion
// TODO revise that // TODO revise that
static_assert(convertible_impl(distance / speed, time) == yes); static_assert(convertible_impl(distance / speed, time) == yes);