[boost test] is this a bug in Boost.Test?
Playing with Boost.Test on VC++8, I encountered something odd. This little program: #define BOOST_AUTO_TEST_MAIN #include <boost/test/auto_unit_test.hpp> 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?
<n.torrey.pines@gmail.com> wrote in message news:fcb24b50703030133l7ec09f1die8ddc1852a1f76af@mail.gmail.com...
Playing with Boost.Test on VC++8, I encountered something odd. This little program:
#define BOOST_AUTO_TEST_MAIN #include <boost/test/auto_unit_test.hpp>
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):
What version of Boost r u using? I couldn't reproduce the issue with my local verstion. But than I am running significantly revorked one even in comparizon with cvs. My version produce following output: Running 1 test case... unknown location(0): fatal error in "factorial_test": stack overflow unit_test_example_01.cpp(10): last checkpoint *** 1 failure detected in test suite "Master Test Suite" Does anyone could confirm the issue with either latest or RC version of Boost.Test? Gennadiy
participants (2)
-
Gennadiy Rozental
-
n.torrey.pines@gmail.com