Skip to content

Commit

Permalink
Use C++ numeric_limits for testing constants in test file
Browse files Browse the repository at this point in the history
  • Loading branch information
saxbophone committed Sep 14, 2021
1 parent 3c75084 commit e526349
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/static_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ TEST_CASE("Fixed::FRACTIONAL_MIN == Fixed::DECIMAL_MIN - (1 - Fixed::FRACTIONAL_
}

TEST_CASE("Fixed::MAX() == Max 32-bit signed integer") {
STATIC_REQUIRE(Fixed::MAX() == Fixed(INT_MAX));
STATIC_REQUIRE(Fixed::MAX() == Fixed(std::numeric_limits<Fixed::UnderlyingType>::max()));
}

TEST_CASE("Fixed::MIN() == Min 32-bit signed integer") {
STATIC_REQUIRE(Fixed::MIN() == Fixed(INT_MIN));
STATIC_REQUIRE(Fixed::MIN() == Fixed(std::numeric_limits<Fixed::UnderlyingType>::min()));
}

TEST_CASE("typeof(Fixed::MAX()) == Fixed") {
Expand Down

0 comments on commit e526349

Please sign in to comment.