Boost logo

Boost :

From: Hubert Holin (Hubert.Holin_at_[hidden])
Date: 2005-02-17 08:39:38


Somewhere in the E.U., le 17/02/2005

   Bonjour

      It looks as though the Boost.Test doc has a slight sync issue.

      The BOOST_CHECK_PREDICATE macro is described (in file
boost/libs/test/doc/components/test_tools/reference/index.html) as
having to be used thus:

   8>< ------------------------------------------- ><8

int test.cpp( int, char* [] ) {
    int i = 17;

    BOOST_CHECK_PREDICATE( std::not_equal_to<int>(), 2, (i,17) );
// ^^^^^^^^^^

    return 0;
}

   8>< ------------------------------------------- ><8

whereas Boost.Test's test uses (in file
boost/libs/test/test/test_tools_test.cpp) the following form:

   8>< ------------------------------------------- ><8

    using std::not_equal_to;

    CHECK_TOOL_USAGE(
        BOOST_CHECK_PREDICATE( not_equal_to<int>(), (i)(17) ),
// ^^^^^^^^^
        output.is_equal( CHECK_PATTERN( "error in " TEST_CASE_NAME ":
test not_equal_to<int>()( i, 17 ) failed for ( 17, 17 )\n", 2 ) )

   8>< ------------------------------------------- ><8

      Of course the later compiles while the former does not.

   Merci

         Hubert Holin


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