Skip to content

Commit

Permalink
test(utils): remove exception throw test for math functions
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5844 authored Sep 4, 2024
1 parent c2b1ff2 commit 953714c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions tests/utils/MathTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ TEST(MathTest, TestRoundDivideSigned)
EXPECT_EQ(round_divide_signed(10, -3), -3) << "10 / -3 rounded should be -3.";
EXPECT_EQ(round_divide_signed(-10, 3), -3) << "-10 / 3 rounded should be -3.";
EXPECT_EQ(round_divide_signed(-10, -3), 3) << "-10 / -3 rounded should be 3.";

EXPECT_THROW(round_divide_signed(10, 0), std::invalid_argument) << "Division by zero should throw an exception.";
}

// Test cases for the ceil_divide_signed function
Expand All @@ -38,8 +36,6 @@ TEST(MathTest, TestCeilDivideSigned)
EXPECT_EQ(ceil_divide_signed(10, -3), -3) << "10 / -3 rounded up should be -3.";
EXPECT_EQ(ceil_divide_signed(-10, 3), -3) << "-10 / 3 rounded up should be -3.";
EXPECT_EQ(ceil_divide_signed(-10, -3), 4) << "-10 / -3 rounded up should be 4.";

EXPECT_THROW(ceil_divide_signed(10, 0), std::invalid_argument) << "Division by zero should throw an exception.";
}

// Test cases for the floor_divide_signed function
Expand All @@ -49,8 +45,6 @@ TEST(MathTest, TestFloorDivideSigned)
EXPECT_EQ(floor_divide_signed(10, -3), -4) << "10 / -3 rounded down should be -4.";
EXPECT_EQ(floor_divide_signed(-10, 3), -4) << "-10 / 3 rounded down should be -4.";
EXPECT_EQ(floor_divide_signed(-10, -3), 3) << "-10 / -3 rounded down should be 3.";

EXPECT_THROW(floor_divide_signed(10, 0), std::invalid_argument) << "Division by zero should throw an exception.";
}

// Test cases for the round_divide function
Expand All @@ -60,7 +54,6 @@ TEST(MathTest, TestRoundDivide)
EXPECT_EQ(round_divide(11, 3), 4) << "11 / 3 rounded should be 4.";
EXPECT_EQ(round_divide(9, 3), 3) << "9 / 3 rounded should be 3.";

EXPECT_THROW(round_divide(10, 0), std::invalid_argument) << "Division by zero should throw an exception.";
}

// Test cases for the round_up_divide function
Expand All @@ -69,8 +62,6 @@ TEST(MathTest, TestRoundUpDivide)
EXPECT_EQ(round_up_divide(10, 3), 4) << "10 / 3 rounded up should be 4.";
EXPECT_EQ(round_up_divide(9, 3), 3) << "9 / 3 rounded up should be 3.";
EXPECT_EQ(round_up_divide(1, 1), 1) << "1 / 1 rounded up should be 1.";

EXPECT_THROW(round_up_divide(10, 0), std::invalid_argument) << "Division by zero should throw an exception.";
}

// NOLINTEND(*-magic-numbers)
Expand Down

0 comments on commit 953714c

Please sign in to comment.