Skip to content

Commit

Permalink
fix: math tests for inverse fixed after change in make_reference
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Nov 12, 2024
1 parent dc6fb93 commit 0e7314e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/static/math_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,17 @@ static_assert(compare(round<si::second>(-1999. * isq::time[ms]), -2. * isq::time
#endif

// non-truncating
static_assert(compare(inverse<us>(250 * Hz), 4000 * us));
static_assert(compare(inverse<us>(250 * kHz), 4 * us));
static_assert(compare(inverse<ks>(250 * uHz), 4 * ks));
static_assert(compare(kind_of<isq::time>(inverse<us>(250 * Hz)), 4000 * us));
static_assert(compare(kind_of<isq::time>(inverse<us>(250 * kHz)), 4 * us));
static_assert(compare(kind_of<isq::time>(inverse<ks>(250 * uHz)), 4 * ks));

// truncating
static_assert(compare(inverse<s>(1 * kHz), 0 * s));
static_assert(compare(kind_of<isq::time>(inverse<s>(1 * kHz)), 0 * s));

// floating-point representation does not truncate
static_assert(compare(inverse<s>(1. * kHz), 0.001 * s));
static_assert(compare(kind_of<isq::time>(inverse<s>(1. * kHz)), 0.001 * s));

// check if constraints work properly for a derived unit of a narrowed kind
static_assert(compare(inverse<Hz>(1 * s), 1 * Hz));
static_assert(compare(kind_of<isq::frequency>(inverse<Hz>(1 * s)), 1 * Hz));

} // namespace

0 comments on commit 0e7314e

Please sign in to comment.