Re: [boost] [test] Automatic registration of tests created with BOOST_PARAM_TEST_CASE

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

Jan Stolarek wrote:
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.
...
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?
I guess it will. I recommend using boost::indirect_iterator instead. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Jan Stolarek