Boost logo

Boost Users :

From: Tim Allison (tallison_at_[hidden])
Date: 2008-02-28 18:16:30


>
> Message: 2
> Date: Thu, 28 Feb 2008 18:44:34 +0000 (UTC)
> From: Gennadiy Rozental <rogeeff_at_[hidden]>
> Subject: Re: [Boost-users] A request for help using the Boost Unit
> Test Library
> To: boost-users_at_[hidden]
> Message-ID: <loom.20080228T184232-270_at_[hidden]>
> Content-Type: text/plain; charset=us-ascii
>
> Tim Allison <tallison <at> meicompany.com> writes:
>>> What compiler are u using? Can you post compilation command? These errors
> may
>>> only mean that you doing something funny during compilation and compiler
> do
>>> not see BOOST_AUTO_TEST_CASE macro.
>> I am using Gnu compiler 4.1.3-29. I have reduced the number of
>> switches, so that the actual line used to build is:
>> g++ -g -I../lib -I/usr/X11R6/include -I../../../source/ecs/shared
>> -DOS_IS_LINUX -c FuserTests.cc
>
> Where is boost include? Can you generate preprocessed code? Do you see boost
> test code? what do u see in place of BOOST_AUTO_TEST_CASE( test1 )?
>
> Gennadiy
>

I ran the -E option on the Gnu compiler. Here is what I hope is the
relevant output (at the end of the 38K resulting file!):

inline test_case*
make_test_case( callback0<> const& test_func, const_string tc_name )
{
     return new test_case( ut_detail::normalize_test_case_name( tc_name
), test_func );
}

template<typename UserTestCase>
inline test_case*
make_test_case( void (UserTestCase::*test_method )(),
                   const_string tc_name,
                   boost::shared_ptr<UserTestCase> const& user_test_case )
{
     return new test_case( ut_detail::normalize_test_case_name( tc_name ),
 
ut_detail::user_tc_method_invoker<UserTestCase>( user_test_case,
test_method ) );
}

}

}

# 1 "/usr/include/boost/test/detail/enable_warnings.hpp" 1 3 4
# 246 "/usr/include/boost/test/unit_test_suite.hpp" 2 3 4
# 20 "/usr/include/boost/test/unit_test.hpp" 2 3 4
# 5 "FuserTests.cc" 2

BOOST_AUTO_TEST_CASE( test1 )
{

    boost::test_tools::tt_detail::check_impl( (2 == 1),
boost::wrap_stringstream().ref() << boost::unit_test::literal_string( "2
== 1", sizeof( "2 == 1" ) - 1 ), boost::unit_test::literal_string(
"FuserTests.cc", sizeof( "FuserTests.cc" ) - 1 ), (std::size_t)12,
boost::test_tools::tt_detail::CHECK,
boost::test_tools::tt_detail::CHECK_PRED, 0 );
}

BOOST_AUTO_TEST_CASE( test2 )
{
    int i = 0;

    boost::test_tools::tt_detail::check_frwd(
boost::test_tools::tt_detail::equal_impl_frwd(),
boost::wrap_stringstream().ref() << "",
boost::unit_test::literal_string( "FuserTests.cc", sizeof(
"FuserTests.cc" ) - 1 ), (std::size_t)23,
boost::test_tools::tt_detail::CHECK,
boost::test_tools::tt_detail::CHECK_EQUAL , i, "i" , 2, "2" );

    boost::test_tools::tt_detail::check_frwd(
boost::test_tools::tt_detail::equal_impl_frwd(),
boost::wrap_stringstream().ref() << "",
boost::unit_test::literal_string( "FuserTests.cc", sizeof(
"FuserTests.cc" ) - 1 ), (std::size_t)25,
boost::test_tools::tt_detail::CHECK,
boost::test_tools::tt_detail::CHECK_EQUAL , i, "i" , 0, "0" );
}

Tim


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net