Update of /cvsroot/cppunit/cppunit2/src/cpputtest
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18007/src/cpputtest
Modified Files:
enumeratortest.cpp
Log Message:
* removed include/cpput/enumerator.h which has been replaced by include/cpptl/enumerator.h
* added explicit type passing to any*() generator functions.
Index: enumeratortest.cpp
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/enumeratortest.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** enumeratortest.cpp 15 Nov 2004 08:52:40 -0000 1.5
--- enumeratortest.cpp 23 Feb 2005 08:54:05 -0000 1.6
***************
*** 3,7 ****
#include <iterator>
! // todo: add test for custom equality predicates
#define ENUMERATORTEST_ASSERT_ENUM_EMPTY \
--- 3,8 ----
#include <iterator>
! // @todo: add test for custom equality predicates
! // @todo add test for different enumerated type
#define ENUMERATORTEST_ASSERT_ENUM_EMPTY \
***************
*** 298,301 ****
--- 299,306 ----
#if !defined(CPPTL_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ // NOTES: to be portable, the compiler need to be able to remove the optional 'const'
+ // before the deduced enumerator type. This can only be done using partial
+ // specialilzation. For portability, it is strongly recommanded to use the portable
+ // syntax by passing the return type explicitely.
checkContent( CppTL::Enum::range( set1_.begin(), set1_.end() ) );
#endif
***************
*** 310,313 ****
--- 315,319 ----
checkContent( CppTL::Enum::range( set1_.begin(), set1_.end(), CppTL::Type<int>() ) );
checkContent( CppTL::Enum::range( list1_.begin(), list1_.end(), CppTL::Type<int>() ) );
+ checkContent( CppTL::Enum::anyRange( list1_.begin(), list1_.end(), CppTL::Type<int>() ) );
}
***************
*** 351,354 ****
--- 357,361 ----
checkContent( CppTL::Enum::container( set1_, CppTL::Type<int>() ) );
checkContent( CppTL::Enum::container( list1_, CppTL::Type<int>() ) );
+ checkContent( CppTL::Enum::anyContainer( list1_, CppTL::Type<int>() ) );
}
***************
*** 363,371 ****
checkContent( CppTL::Enum::keysRange( map1_.begin(), map1_.end() ) );
- checkContent( CppTL::Enum::keysRange( map1_.begin(), map1_.end(), CppTL::Type<int>() ) );
-
checkContent( CppTL::Enum::anyKeys( map1_ ) );
checkContent( CppTL::Enum::anyKeysRange( map1_.begin(), map1_.end() ) );
}
--- 370,382 ----
checkContent( CppTL::Enum::keysRange( map1_.begin(), map1_.end() ) );
checkContent( CppTL::Enum::anyKeys( map1_ ) );
checkContent( CppTL::Enum::anyKeysRange( map1_.begin(), map1_.end() ) );
+
+ checkContent( CppTL::Enum::keysRange( map1_.begin(), map1_.end(), CppTL::Type<int>() ) );
+
+ checkContent( CppTL::Enum::anyKeys( map1_, CppTL::Type<int>() ) );
+
+ checkContent( CppTL::Enum::anyKeysRange( map1_.begin(), map1_.end(), CppTL::Type<int>() ) );
}
***************
*** 387,390 ****
--- 398,406 ----
checkStringContent( CppTL::Enum::anyValuesRange( map1_.begin(), map1_.end() ) );
+
+ checkStringContent( CppTL::Enum::anyValuesRange( map1_.begin(), map1_.end(),
+ CppTL::Type<std::string>() ) );
+
+ checkStringContent( CppTL::Enum::anyValues( map1_, CppTL::Type<std::string>() ) );
}
|