Playing with Boost.Test on VC++8, I encountered something odd. This
little program:
#define BOOST_AUTO_TEST_MAIN
#include
int factorial(int n) {
if(n < 1) return 1;
return n * factorial(n-1);
}
BOOST_AUTO_TEST_CASE( factorial_test ) {
BOOST_CHECK( factorial(10000) == 3 );
}
Produces this output:
------- begin output ------
Running 1 test case...
Press any key to continue . . .
-------- end output ------
(this is debug mode, linked against
libboost_unit_test_framework-vc80-mt-gd.lib):
Changing "10000" to "1000" effects the correct behavior (error report).
This might be related to some stack overflow issues, so if you can not
reproduce this, you may want to try even greater arguments to
"factorial".
Is this a bug, or am I using the library incorrectly?