Boost logo

Boost :

Subject: Re: [boost] [Test] Small issue with explicit function initialization
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-03-07 14:15:16


AMDG

Sylvain Bougerel wrote:
> BOOST_AUTO_TEST_CASE( test_details_key )
> {
> BOOST_CHECK(stupid_cast<float, int>(1.0) == 1);
> }
>
> It give the following error with g++ (GCC) 4.4.3:
> try.cpp:40:48: error: macro "BOOST_CHECK" passed 2 arguments, but takes just 1
> try.cpp: In member function 'void test_details_key::test_method()':
> try.cpp:40: error: 'BOOST_CHECK' was not declared in this scope
>
> <snip>
> BOOST_AUTO_TEST_CASE( test_details_key )
> {
> BOOST_CHECK((stupid_cast<float, int>(1.0) == 1)); // <----- I
> wrapped it in parenthesis
> }
>

All macros behave this way. The extra parentheses are needed.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk