Skip to content

Commit

Permalink
fix: narrowing conversion in util::compare tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrit committed Jul 4, 2024
1 parent a71f63f commit 43d89af
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions libmamba/tests/src/util/test_compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ TEST_SUITE("util::compare")
{
CHECK(cmp_equal(char{ 0 }, char{ 0 }));
CHECK(cmp_equal(char{ 1 }, char{ 1 }));
CHECK(cmp_equal(char{ -1 }, char{ -1 }));
CHECK(cmp_equal(int{ 0 }, int{ 0 }));
CHECK(cmp_equal(int{ 1 }, int{ 1 }));
CHECK(cmp_equal(int{ -1 }, int{ -1 }));
Expand All @@ -28,21 +27,18 @@ TEST_SUITE("util::compare")

CHECK(cmp_equal(char{ 0 }, int{ 0 }));
CHECK(cmp_equal(char{ 1 }, int{ 1 }));
CHECK(cmp_equal(char{ -1 }, int{ -1 }));
CHECK(cmp_equal(std::size_t{ 0 }, char{ 0 }));
CHECK(cmp_equal(std::size_t{ 1 }, char{ 1 }));
CHECK(cmp_equal(std::size_t{ 0 }, int{ 0 }));
CHECK(cmp_equal(std::size_t{ 1 }, int{ 1 }));

CHECK_FALSE(cmp_equal(char{ 0 }, char{ 1 }));
CHECK_FALSE(cmp_equal(char{ 1 }, char{ -1 }));
CHECK_FALSE(cmp_equal(int{ 0 }, int{ 1 }));
CHECK_FALSE(cmp_equal(int{ -1 }, int{ 1 }));
CHECK_FALSE(cmp_equal(std::size_t{ 0 }, std::size_t{ 1 }));

CHECK_FALSE(cmp_equal(char{ 0 }, int{ 1 }));
CHECK_FALSE(cmp_equal(char{ 1 }, int{ -1 }));
CHECK_FALSE(cmp_equal(char{ -1 }, int{ 1 }));
CHECK_FALSE(cmp_equal(std::size_t{ 1 }, int{ -1 }));
CHECK_FALSE(cmp_equal(static_cast<std::size_t>(-1), int{ -1 }));
CHECK_FALSE(cmp_equal(std::size_t{ 1 }, int{ 0 }));
Expand All @@ -52,15 +48,11 @@ TEST_SUITE("util::compare")
TEST_CASE("less")
{
CHECK(cmp_less(char{ 0 }, char{ 1 }));
CHECK(cmp_less(char{ -1 }, char{ 0 }));
CHECK(cmp_less(int{ 0 }, int{ 1 }));
CHECK(cmp_less(int{ -1 }, int{ 1 }));
CHECK(cmp_less(std::size_t{ 0 }, std::size_t{ 1 }));

CHECK(cmp_less(char{ 0 }, int{ 1 }));
CHECK(cmp_less(char{ -1 }, int{ 0 }));
CHECK(cmp_less(char{ -1 }, int{ 1 }));
CHECK(cmp_less(char{ -1 }, std::size_t{ 1 }));
CHECK(cmp_less(std::size_t{ 0 }, int{ 1 }));
CHECK(cmp_less(std::numeric_limits<int>::min(), char{ 0 }));
CHECK(cmp_less(std::numeric_limits<int>::min(), std::size_t{ 0 }));
Expand All @@ -69,7 +61,6 @@ TEST_SUITE("util::compare")

CHECK_FALSE(cmp_less(char{ 1 }, char{ 0 }));
CHECK_FALSE(cmp_less(char{ 1 }, char{ 1 }));
CHECK_FALSE(cmp_less(char{ 0 }, char{ -1 }));
CHECK_FALSE(cmp_less(int{ 1 }, int{ 0 }));
CHECK_FALSE(cmp_less(int{ 1 }, int{ -1 }));
CHECK_FALSE(cmp_less(std::size_t{ 1 }, std::size_t{ 0 }));
Expand All @@ -78,7 +69,6 @@ TEST_SUITE("util::compare")
CHECK_FALSE(cmp_less(char{ 1 }, int{ 0 }));
CHECK_FALSE(cmp_less(char{ 0 }, int{ -1 }));
CHECK_FALSE(cmp_less(char{ 1 }, int{ -11 }));
CHECK_FALSE(cmp_less(std::size_t{ 1 }, char{ -1 }));
CHECK_FALSE(cmp_less(int{ 1 }, std::size_t{ 0 }));
CHECK_FALSE(cmp_less(char{ 0 }, std::numeric_limits<int>::min()));
CHECK_FALSE(cmp_less(std::size_t{ 0 }, std::numeric_limits<int>::min()));
Expand Down

0 comments on commit 43d89af

Please sign in to comment.