|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67200 - sandbox/tti/libs/tti/test
From: eldiener_at_[hidden]
Date: 2010-12-12 22:45:09
Author: eldiener
Date: 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
New Revision: 67200
URL: http://svn.boost.org/trac/boost/changeset/67200
Log:
Updated tests
Added:
sandbox/tti/libs/tti/test/TestHasStaticMemberFail3.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasStaticMemberFail4.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasStaticMemberFail5.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail3.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail4.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasTemplateFail3.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasTemplateFail4.cpp (contents, props changed)
Text files modified:
sandbox/tti/libs/tti/test/Jamfile.v2 | 7 +++++++
sandbox/tti/libs/tti/test/TestHasMemberCompile.cpp | 8 ++++++++
sandbox/tti/libs/tti/test/TestHasStaticMemberCompile.cpp | 13 ++++++++++++-
sandbox/tti/libs/tti/test/TestHasStaticMemberFail.cpp | 4 +++-
sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp | 4 +++-
sandbox/tti/libs/tti/test/TestHasTemplate.cpp | 10 +++++++++-
sandbox/tti/libs/tti/test/TestHasTemplate.hpp | 9 +++++++++
sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.cpp | 9 +++++++++
sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.hpp | 11 +++++++++++
sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsCompile.cpp | 14 +++++++++++++-
sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail.cpp | 4 +++-
sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail2.cpp | 4 +++-
sandbox/tti/libs/tti/test/TestHasTemplateCompile.cpp | 13 ++++++++++++-
sandbox/tti/libs/tti/test/TestHasTemplateFail.cpp | 4 +++-
sandbox/tti/libs/tti/test/TestHasTemplateFail2.cpp | 4 +++-
15 files changed, 108 insertions(+), 10 deletions(-)
Modified: sandbox/tti/libs/tti/test/Jamfile.v2
==============================================================================
--- sandbox/tti/libs/tti/test/Jamfile.v2 (original)
+++ sandbox/tti/libs/tti/test/Jamfile.v2 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -28,14 +28,21 @@
[ compile TestHasStaticMemberCompile.cpp ]
[ compile-fail TestHasStaticMemberFail.cpp ]
[ compile-fail TestHasStaticMemberFail2.cpp ]
+ [ compile-fail TestHasStaticMemberFail3.cpp ]
+ [ compile-fail TestHasStaticMemberFail4.cpp ]
+ [ compile-fail TestHasStaticMemberFail5.cpp ]
[ run TestHasTemplate.cpp ]
[ compile TestHasTemplateCompile.cpp ]
[ compile-fail TestHasTemplateFail.cpp ]
[ compile-fail TestHasTemplateFail2.cpp ]
+ [ compile-fail TestHasTemplateFail3.cpp ]
+ [ compile-fail TestHasTemplateFail4.cpp ]
[ run TestHasTemplateCheckParams.cpp ]
[ compile TestHasTemplateCheckParamsCompile.cpp ]
[ compile-fail TestHasTemplateCheckParamsFail.cpp ]
[ compile-fail TestHasTemplateCheckParamsFail2.cpp ]
+ [ compile-fail TestHasTemplateCheckParamsFail3.cpp ]
+ [ compile-fail TestHasTemplateCheckParamsFail4.cpp ]
[ run TestHasType.cpp ]
[ compile TestHasTypeCompile.cpp ]
[ compile-fail TestHasTypeFail.cpp ]
Modified: sandbox/tti/libs/tti/test/TestHasMemberCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasMemberCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasMemberCompile.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,6 +4,14 @@
int main()
{
+ // You can always instantiate without compiler errors
+
+ tti::has_member_aMember<long AType::*> aVar;
+ tti::has_member_someDataMember<double AnotherType::*> aVar2;
+ tti::has_member_someFunctionMember<double (AnotherType::*)(short,short,long,int)> aVar3;
+
+ // Compile time asserts
+
BOOST_MPL_ASSERT((tti::has_member_AnInt<int AType::*>));
BOOST_MPL_ASSERT((tti::has_member_AnInt<long AnotherType::*>));
BOOST_MPL_ASSERT((tti::has_member_VoidFunction<void (AType::*)()>));
Modified: sandbox/tti/libs/tti/test/TestHasStaticMemberCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasStaticMemberCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberCompile.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,18 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::true_));
+ // You can always instantiate without compiler errors
+
+ tti::TheTIntFunction<AType,void (long,double)> aVar;
+ tti::has_static_member_SomeStaticData<AnotherType,long> aVar2;
+ tti::Pickedname<AnotherType,AType (long,long)> aVar3;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::has_static_member_DSMember<AType,short>));
+ BOOST_MPL_ASSERT((tti::HaveTheSIntFunction<AType,int (long,double)>));
+ BOOST_MPL_ASSERT((tti::TheTIntFunction<AnotherType,AType (long,double)>));
+ BOOST_MPL_ASSERT((tti::has_static_member_TSFunction<AnotherType,AType::AStructType (AType::AnIntType,double)>));
return 0;
Modified: sandbox/tti/libs/tti/test/TestHasStaticMemberFail.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasStaticMemberFail.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFail.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,9 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::false_));
+ // SomeStaticData does not exist at all
+
+ BOOST_MPL_ASSERT((tti::has_static_member_SomeStaticData<AnotherType,float>));
return 0;
Modified: sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,9 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::false_));
+ // Wrong enclosing type for DSMember
+
+ BOOST_MPL_ASSERT((AnotherType,short));
return 0;
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFail3.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFail3.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -0,0 +1,13 @@
+#include "TestHasStaticMember.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong function signature for SIntFunction
+
+ BOOST_MPL_ASSERT((tti::HaveTheSIntFunction<AType,int (float,double)>));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFail4.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFail4.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -0,0 +1,12 @@
+#include "TestHasStaticMember.hpp"
+
+int main()
+ {
+
+ // Data signature has type which does not exist
+
+ tti::has_static_member_DSMember<NoType,short> aVar;
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFail5.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFail5.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -0,0 +1,12 @@
+#include "TestHasStaticMember.hpp"
+
+int main()
+ {
+
+ // Function signature has type which does not exist
+
+ tti::has_static_member_TSFunction<AnotherType,AType::AClassType (AType::AnIntType,double)> aVar;
+
+ return 0;
+
+ }
Modified: sandbox/tti/libs/tti/test/TestHasTemplate.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplate.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplate.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,6 +4,14 @@
int main()
{
- return boost::report_errors();
+ BOOST_TEST(tti::has_template_ATPMemberTemplate<AType>::value);
+ BOOST_TEST(tti::HaveCL<AType>::value);
+ BOOST_TEST(!tti::has_template_AMemberTemplate<AType>::value);
+ BOOST_TEST(!tti::HaveAnotherMT<AType>::value);
+ BOOST_TEST(!tti::has_template_SomeMemberTemplate<AnotherType>::value);
+ BOOST_TEST(!tti::ATemplateWithParms<AnotherType>::value);
+ BOOST_TEST(tti::has_template_SimpleTMP<AnotherType>::value);
+ return boost::report_errors();
+
}
Modified: sandbox/tti/libs/tti/test/TestHasTemplate.hpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplate.hpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplate.hpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,4 +4,13 @@
#include "TestStructs.hpp"
#include <boost/tti/TTIntrospection.hpp>
+TTI_HAS_TEMPLATE(ATPMemberTemplate)
+TTI_TRAIT_HAS_TEMPLATE(HaveCL,CLMemberTemplate)
+TTI_HAS_TEMPLATE(AMemberTemplate)
+TTI_TRAIT_HAS_TEMPLATE(HaveAnotherMT,AnotherMemberTemplate)
+TTI_HAS_TEMPLATE(SomeMemberTemplate)
+TTI_TRAIT_HAS_TEMPLATE(ATemplateWithParms,ManyParameters)
+TTI_HAS_TEMPLATE(SimpleTMP)
+TTI_HAS_TEMPLATE(TemplateNotExist)
+
#endif // TEST_HAS_TEMPLATE_HPP
Modified: sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,6 +4,15 @@
int main()
{
+ BOOST_TEST(tti::has_template_check_params_ATPMemberTemplate<AType>::value);
+ BOOST_TEST(tti::HaveCL<AType>::value);
+ BOOST_TEST(tti::has_template_check_params_AMemberTemplate<AType>::value);
+ BOOST_TEST(tti::HaveAnotherMT<AType>::value);
+ BOOST_TEST(tti::has_template_check_params_SomeMemberTemplate<AnotherType>::value);
+ BOOST_TEST(tti::ATemplateWithParms<AnotherType>::value);
+ BOOST_TEST(tti::has_template_check_params_SimpleTMP<AnotherType>::value);
+ BOOST_TEST(!tti::has_template_check_params_TemplateNotExist<AnotherType>::value);
+
return boost::report_errors();
}
Modified: sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.hpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.hpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCheckParams.hpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,4 +4,15 @@
#include "TestStructs.hpp"
#include <boost/tti/TTIntrospection.hpp>
+TTI_HAS_TEMPLATE_CHECK_PARAMS(ATPMemberTemplate,(class))
+TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(HaveCL,CLMemberTemplate,(class)(class))
+TTI_HAS_TEMPLATE_CHECK_PARAMS(AMemberTemplate,(int))
+TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(HaveAnotherMT,AnotherMemberTemplate,(int)(int))
+TTI_HAS_TEMPLATE_CHECK_PARAMS(SomeMemberTemplate,(class)(class)(class)(class)(class)(class))
+TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(ATemplateWithParms,ManyParameters,(class)(class)(int)(class)(template <class> class InnerTemplate)(class)(long))
+TTI_HAS_TEMPLATE_CHECK_PARAMS(SimpleTMP,(class)(class)(class)(class))
+TTI_HAS_TEMPLATE_CHECK_PARAMS(TemplateNotExist,(int)(class)(template <class> class ATemplate))
+TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(WrongParametersForMP,ManyParameters,(class)(class)(int)(class)(template <class)(class> class InnerTemplate)(class)(long))
+TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(WrongParameters2ForMP,ManyParameters,(class)(long)(int)(class)(template <class> class InnerTemplate)(class)(long))
+
#endif // TEST_HAS_TEMPLATE_CHECK_PARAMS_HPP
Modified: sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsCompile.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,19 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::true_));
+ // You can always instantiate without compiler errors
+
+ tti::has_template_check_params_TemplateNotExist<AnotherType> aVar1;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::has_template_check_params_ATPMemberTemplate<AType>));
+ BOOST_MPL_ASSERT((tti::HaveCL<AType>));
+ BOOST_MPL_ASSERT((tti::has_template_check_params_AMemberTemplate<AType>));
+ BOOST_MPL_ASSERT((tti::HaveAnotherMT<AType>));
+ BOOST_MPL_ASSERT((tti::has_template_check_params_SomeMemberTemplate<AnotherType>));
+ BOOST_MPL_ASSERT((tti::ATemplateWithParms<AnotherType>));
+ BOOST_MPL_ASSERT((tti::has_template_check_params_SimpleTMP<AnotherType>));
return 0;
Modified: sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,9 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::false_));
+ // TemplateNotExist does not exist at all
+
+ BOOST_MPL_ASSERT((tti::has_template_check_params_TemplateNotExist<AType>));
return 0;
Modified: sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail2.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail2.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail2.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,9 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::false_));
+ // Wrong enclosing type
+
+ BOOST_MPL_ASSERT((tti::HaveCL<AnotherType>));
return 0;
Added: sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail3.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail3.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -0,0 +1,13 @@
+#include "TestHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong template parameters
+
+ BOOST_MPL_ASSERT((tti::WrongParametersForMP<AnotherType>));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail4.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCheckParamsFail4.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -0,0 +1,13 @@
+#include "TestHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong template parameters
+
+ BOOST_MPL_ASSERT((tti::WrongParameters2ForMP<AnotherType>));
+
+ return 0;
+
+ }
Modified: sandbox/tti/libs/tti/test/TestHasTemplateCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateCompile.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,18 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::true_));
+ // You can always instantiate without compiler errors
+
+ tti::has_template_AMemberTemplate<AnotherType> aVar;
+ tti::HaveAnotherMT<AnotherType> aVar2;
+ tti::has_template_SomeMemberTemplate<AType> aVar3;
+ tti::has_template_TemplateNotExist<AType> aVar4;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::has_template_ATPMemberTemplate<AType>));
+ BOOST_MPL_ASSERT((tti::HaveCL<AType>));
+ BOOST_MPL_ASSERT((tti::has_template_SimpleTMP<AnotherType>));
return 0;
Modified: sandbox/tti/libs/tti/test/TestHasTemplateFail.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateFail.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateFail.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,9 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::false_));
+ // TemplateNotExist does not exist at all
+
+ BOOST_MPL_ASSERT((tti::has_template_TemplateNotExist<AType>));
return 0;
Modified: sandbox/tti/libs/tti/test/TestHasTemplateFail2.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasTemplateFail2.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasTemplateFail2.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -4,7 +4,9 @@
int main()
{
- BOOST_MPL_ASSERT((boost::mpl::false_));
+ // Wrong enclosing type
+
+ BOOST_MPL_ASSERT((tti::has_template_ATPMemberTemplate<AnotherType>));
return 0;
Added: sandbox/tti/libs/tti/test/TestHasTemplateFail3.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasTemplateFail3.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -0,0 +1,13 @@
+#include "TestHasTemplate.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Too many 'typename' parameters
+
+ BOOST_MPL_ASSERT((tti::has_template_SomeMemberTemplate<AnotherType>));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasTemplateFail4.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasTemplateFail4.cpp 2010-12-12 22:45:05 EST (Sun, 12 Dec 2010)
@@ -0,0 +1,13 @@
+#include "TestHasTemplate.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Not all 'typename' parameters
+
+ BOOST_MPL_ASSERT((tti::HaveAnotherMT<AType>));
+
+ return 0;
+
+ }
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk