[test][msvc-6.0/7.0] problem with rev. 40035 of boost/test/impl/unit_test_suite.ipp

The aforementioned rev includes the following new member function: test_unit_id test_suite::get( const_string tu_name ) const { BOOST_TEST_FOREACH( test_unit_id, id, m_members ) { if( const_string(framework::get( id, test_id_2_unit_type( id ) ).p_name) == tu_name ) return id; } return INV_TEST_UNIT_ID; } which unfortunately results in the following code: #include <boost/test/included/test_exec_monitor.hpp> int test_main(int,char *[]) { return 0; } failing in MSVC++ 6.0 (and possibly also 7.0) with: ...\boost\test\impl\unit_test_suite.ipp(158) : error C2676: binary '==' : 'class boost::unit_test::readwrite_property<class std::basic_string<char,struct std::char_traits<char>, class std::allocator<char> > >' does not define this operator or a conversion to a type acceptable to the predefined operator Looks like the compiler is having a hard time with ADLing the appropriate overload of operator== in this particular dependent context. By changing the offending line like this, however, if( const_string( framework::get( id, test_id_2_unit_type( id ) ).p_name ) == tu_name ) everything works fine (checked in MSVC++ 6.0 and GCC 3.2). As this is a rather innocent change and definitely helps poor old MSVC++ 6.0, is it OK to commit the attached patch? Thank you, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Index: unit_test_suite.ipp =================================================================== --- unit_test_suite.ipp (revision 40053) +++ unit_test_suite.ipp (working copy) @@ -155,7 +155,7 @@ test_suite::get( const_string tu_name ) const { BOOST_TEST_FOREACH( test_unit_id, id, m_members ) { - if( framework::get( id, test_id_2_unit_type( id ) ).p_name == tu_name ) + if( const_string( framework::get( id, test_id_2_unit_type( id ) ).p_name ) == tu_name ) return id; }

Joaquín Mª López Muñoz <joaquin <at> tid.es> writes:
Looks like the compiler is having a hard time with ADLing the appropriate overload of operator== in this particular dependent context. By changing the offending line like this, however,
if( const_string( framework::get( id, test_id_2_unit_type( id ) ).p_name ) == tu_name )
everything works fine (checked in MSVC++ 6.0 and GCC 3.2). As this is a rather innocent change and definitely helps poor old MSVC++ 6.0, is it OK to commit the attached patch?
Better use if( framework::get( id, test_id_2_unit_type( id ) ).p_name.get() == tu_name ) Gennadiy

----- Mensaje original ----- De: Gennadiy Rozental <rogeeff@gmail.com> Fecha: Lunes, Octubre 15, 2007 11:05 pm Asunto: Re: [boost][test][msvc-6.0/7.0] problem with rev. 40035 of boost/test/impl/unit_test_suite.ipp Para: boost@lists.boost.org
Joaquín Mª López Muñoz <joaquin <at> tid.es> writes: [...]
if( const_string( framework::get( id, test_id_2_unit_type( id ) ).p_name ) == tu_name )
everything works fine (checked in MSVC++ 6.0 and GCC 3.2). [...] Better use
if( framework::get( id, test_id_2_unit_type( id ) ).p_name.get() == tu_name )
That was my first attempt and it does not solve the problem for MSVC++ 6.0, strangely enough :( Do I have your permission to go with plan B? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

""JOAQUIN LOPEZ MU?Z"" <joaquin@tid.es> wrote in message news:f98e9eeb4a02.4a02f98e9eeb@tid.es... Fixed in svn. Gennadiy

Gennadiy Rozental ha escrito:
""JOAQUIN LOPEZ MU?Z"" <joaquin@tid.es> wrote in message news:f98e9eeb4a02.4a02f98e9eeb@tid.es...
Fixed in svn.
Gennadiy
Thank you, Gennadiy! Best, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (3)
-
"JOAQUIN LOPEZ MU?Z"
-
Gennadiy Rozental
-
Joaquín Mª López Muñoz