We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
math::iterativeFactorial
1 parent 5be56ee commit 4fe4cf4Copy full SHA for 4fe4cf4
math/iterative_factorial.cpp
@@ -101,12 +101,14 @@ static void test() {
101
std::cout << "Exception test \n"
102
"Input: 21 \n"
103
"Expected output: Exception thrown \n";
104
+
105
+ bool wasExceptionThrown = false;
106
try {
107
math::iterativeFactorial(21);
- } catch (const std::invalid_argument& e) {
- std::cout << "Exception thrown successfully \nContent: " << e.what()
108
- << '\n';
+ } catch (const std::invalid_argument&) {
109
+ wasExceptionThrown = true;
110
}
111
+ assert(wasExceptionThrown);
112
113
std::cout << "All tests have passed successfully.\n";
114
0 commit comments