Skip to content

Commit

Permalink
style: clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Jun 6, 2024
1 parent e382435 commit 3c97f2e
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions test/static/reference_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,27 +189,27 @@ static_assert(
constexpr auto m_per_s = speed[metre / second];
static_assert(is_of_type<2 * m_per_s, quantity<reference<speed_, derived_unit<metre_, per<second_>>>{}, int>>);

static_assert(
is_of_type<
120 * length[kilometre] / (2 * time[hour]),
quantity<reference<derived_quantity_spec<length_, per<time_>>, derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{}, int>>);
static_assert(is_of_type<120 * length[kilometre] / (2 * time[hour]),
quantity<reference<derived_quantity_spec<length_, per<time_>>,
derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{},
int>>);
static_assert(120 * length[kilometre] / (2 * time[hour]) == 60 * speed[kilometre / hour]);
static_assert(
is_of_type<
[] {
const auto distance = 120;
const auto duration = 2;
return distance * length[kilometre] / (duration * time[hour]);
}(),
quantity<reference<derived_quantity_spec<length_, per<time_>>, derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{}, int>>);
static_assert(
is_of_type<std::int64_t{120} * length[kilometre] / (2 * time[hour]),
quantity<reference<derived_quantity_spec<length_, per<time_>>, derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{},
std::int64_t>>);
static_assert(
is_of_type<120.L * length[kilometre] / (2 * time[hour]),
quantity<reference<derived_quantity_spec<length_, per<time_>>, derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{},
long double>>);
static_assert(is_of_type<[] {
const auto distance = 120;
const auto duration = 2;
return distance * length[kilometre] / (duration * time[hour]);
}(),
quantity<reference<derived_quantity_spec<length_, per<time_>>,
derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{},
int>>);
static_assert(is_of_type<std::int64_t{120} * length[kilometre] / (2 * time[hour]),
quantity<reference<derived_quantity_spec<length_, per<time_>>,
derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{},
std::int64_t>>);
static_assert(is_of_type<120.L * length[kilometre] / (2 * time[hour]),
quantity<reference<derived_quantity_spec<length_, per<time_>>,
derived_unit<std::remove_const_t<decltype(si::kilo<metre>)>, per<hour_>>>{},
long double>>);

static_assert(is_of_type<1. / 4 * area[square(metre)], decltype(1. * area[square(metre)] / 4)>);
static_assert(1. / 4 * area[square(metre)] == 1. * area[square(metre)] / 4);
Expand All @@ -226,7 +226,9 @@ static_assert(is_of_type<42 * nu::length[nu::second] / (42 * nu::time[nu::second
static_assert(is_of_type<42 * nu::speed[nu::second / nu::second], quantity<reference<speed_, one_>{}, int>>);
static_assert(is_of_type<42 * nu::speed[one], quantity<reference<speed_, one_>{}, int>>);
static_assert(is_of_type<42 * mass[kilogram] * (1 * nu::length[nu::second]) / (1 * nu::time[nu::second]),
quantity<reference<derived_quantity_spec<length_, mass_, per<time_>>, std::remove_const_t<decltype(si::kilo<gram>)>>{}, int>>);
quantity<reference<derived_quantity_spec<length_, mass_, per<time_>>,
std::remove_const_t<decltype(si::kilo<gram>)>>{},
int>>);

template<auto dim, auto unit>
concept invalid_nu_unit = !requires { dim[unit]; };
Expand Down

0 comments on commit 3c97f2e

Please sign in to comment.