You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproduction steps
Code example (same one in tutorial)
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"
unsigned int Factorial( unsigned int number ) {
return number <= 1 ? number : Factorial(number-1)*number;
}
The error means that your stdlib is non-conforming and INFINITY is a double instead of the float it is supposed to be. Luckily it is not too hard to work around.
When compiling using MinGW following error message shows
Tried compiling earlier release, v2.10.0, smooth sailing.
Reproduction steps
Code example (same one in tutorial)
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"
unsigned int Factorial( unsigned int number ) {
return number <= 1 ? number : Factorial(number-1)*number;
}
TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( Factorial(1) == 1 );
REQUIRE( Factorial(2) == 2 );
REQUIRE( Factorial(3) == 6 );
REQUIRE( Factorial(10) == 3628800 );
}
in CLI -->>> g++ trial.cpp
Platform information:
The text was updated successfully, but these errors were encountered: