Hi, Sorry I forgot to add that I am using RC_1_34_0 version updated from this morning. Thanks, Peter
Message: 6 Date: Sun, 7 Jan 2007 18:25:34 +1100 From: "Peter"
Subject: [Boost-users] [BOOST.TEST] [BOOST.WARN] Output weirdness To: Message-ID: <000701c7322d$04f85850$1100a8c0@Billswan.local> Content-Type: text/plain; charset="utf-8" Hi,
I am new to Boost.Test so not sure if this is expected behaviour or not.
Based on this minimal test:
|----------------------------8?------------------------------------| #include
using boost::unit_test::test_suite; // most frequently you implement test cases as a free functions void my_test() {
int i=2; BOOST_WARN( sizeof(int) == sizeof(short) ); BOOST_CHECK( i == 1 ); BOOST_REQUIRE( i > 5 ); BOOST_CHECK( i == 6 ); // will never reach this check }
test_suite* init_unit_test_suite( int, char* [] ) { test_suite* test= BOOST_TEST_SUITE( " Test Suite!" );
// this example will pass cause we know ahead of time number of expected failures test->add( BOOST_TEST_CASE( & my_test ), 0 /* expected one error */ );
return test; } |----------------------------8?------------------------------------|
Taken from this url: http://tinyurl.com/t54th (Click on BOOST_WARN).
I expect to see this output (as mentioned at the above link):
c:/development/code/practice/ test/mytest.cpp (14) : warning in test_main: condition sizeof(int) == sizeof(short) is not satisfied c:/development/code/practice/ test/mytest.cpp (15) : error in test_main: test i==1 failed c:/development/code/practice/ test/mytest.cpp (16) : fatal error in test_main: test i>5 failed
But I see this output
Running 1 test case... c:/development/code/practice/ test/mytest.cpp(15): error in " my_test ": check i == 1 failed c:/development/code/practice/ test/mytest.cpp (16): fatal error in " my_test ": critical check i > 5 failed
*** 2 failures detected (2 failures expected) in test suite "Master Test Suite"
It seems that the BOOST_WARN is not outputting a message. Is this expected behaviour?
Also another minor point in the code I have named the BOOST_TEST_SUITE ?Test Suite!? but in the output it is calling it ?Master Test Suite?. Is this something I am not setting right?
Thanks,
Peter.