Update of /cvsroot/cppunit/cppunit2/include/cpput
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv870/include/cpput
Modified Files:
testfixture.h typehelper.h
Log Message:
* added preprocessor macro to indicate if fixture suite name should be deduced through RTTI or macro expansion: CPPUT_USE_RTTI_TO_NAME_SUITE
* fixed typehelper to work on VC++ 6 (linker bug caused all the templated function to resolve into the same function).
Index: testfixture.h
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** testfixture.h 1 Feb 2004 16:12:51 -0000 1.3
--- testfixture.h 15 Nov 2004 08:28:51 -0000 1.4
***************
*** 152,155 ****
--- 152,168 ----
*/
+
+
+
+ # if CPPUT_USE_RTTI_TO_NAME_SUITE
+ # define CPPUT_TESTSUITE_NAME_FROM_TYPE( FixtureType ) \
+ ::CppUT::extractType( ::CppTL::Type<FixtureType>(), #FixtureType )
+ # else // if CPPUT_USE_RTTI_TO_NAME_SUITE
+ # define CPPUT_TESTSUITE_NAME_FROM_TYPE( FixtureType ) \
+ std::string( #FixtureType )
+ # endif // if CPPUT_USE_RTTI_TO_NAME_SUITE
+
+
+
# define CPPUT_TESTSUITE_BEGIN( FixtureType ) \
public: \
***************
*** 158,162 ****
static std::string defaultSuiteName() \
{ \
! return ::CppUT::extractType<CppUT_ThisType>( #FixtureType ); \
} \
\
--- 171,175 ----
static std::string defaultSuiteName() \
{ \
! return CPPUT_TESTSUITE_NAME_FROM_TYPE( FixtureType ); \
} \
\
Index: typehelper.h
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/include/cpput/typehelper.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** typehelper.h 27 Jan 2004 20:34:29 -0000 1.1.1.1
--- typehelper.h 15 Nov 2004 08:28:51 -0000 1.2
***************
*** 6,9 ****
--- 6,10 ----
# include <typeinfo>
+ /// @todo Some plateform such as embedded VC++ 4 do not provide std::type_info.
namespace CppUT {
***************
*** 24,28 ****
template<class AType>
! std::string extractType( const char *hint )
{
return Impl::extractTypeId( typeid( AType ), hint );
--- 25,30 ----
template<class AType>
! std::string extractType( CppTL::Type<AType>,
! const char *hint )
{
return Impl::extractTypeId( typeid( AType ), hint );
|