Boost logo

Boost :

Subject: Re: [boost] [test] Automatic registration of tests created with BOOST_PARAM_TEST_CASE
From: Jan Stolarek (fremenzone_at_[hidden])
Date: 2009-05-10 12:08:56


> Here an example that works fine:
 Awsome, thanks.

By the way, I just run into another serious problem, his time with
BOOST_CHECK_EQUAL_COLLECTIONS macro that compares values in two collections.
When using STL it is very common that elements in the collection are not
objects, but pointers to objects. This leads to a serious problem, since
people would rather want to compare values of objects that are pointed to,
rather than pointer values (i.e. memory adresses). These will practically
always be different, except the situation when two collections actually point
to same addresses in memory. Now I'm trying to solve this problem. In
test_tools.cpp I found :

for( ; left_begin != left_end && right_begin != right_end; ++left_begin,
++right_begin, ++pos ) {
  if( *left_begin != *right_begin ) {
    res = false;
    res.message() << "\nMismatch in a position " << pos << ": " <<
*left_begin << " != " << *right_begin;
  }
 }

I don't have the time at the moment, but I assume that replacing (
*left_begin != *right_begin ) with (**left_begin != **right_begin) would
solve the problem?

Jan


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