Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68125 - in sandbox/tti: . libs/tti/doc libs/tti/test
From: eldiener_at_[hidden]
Date: 2011-01-13 16:27:33


Author: eldiener
Date: 2011-01-13 16:27:31 EST (Thu, 13 Jan 2011)
New Revision: 68125
URL: http://svn.boost.org/trac/boost/changeset/68125

Log:
Updated readme files and tests to member_type::valid
Added:
   sandbox/tti/readme.txt (contents, props changed)
Text files modified:
   sandbox/tti/libs/tti/doc/readme.txt | 12 ++
   sandbox/tti/libs/tti/test/TestMFMemberType.cpp | 107 ++++++---------------
   sandbox/tti/libs/tti/test/TestMFMemberTypeCompile.cpp | 191 +++++++++++++++++++--------------------
   sandbox/tti/libs/tti/test/TestMemberType.cpp | 17 +-
   sandbox/tti/libs/tti/test/TestMemberTypeCompile.cpp | 17 +-
   5 files changed, 154 insertions(+), 190 deletions(-)

Modified: sandbox/tti/libs/tti/doc/readme.txt
==============================================================================
--- sandbox/tti/libs/tti/doc/readme.txt (original)
+++ sandbox/tti/libs/tti/doc/readme.txt 2011-01-13 16:27:31 EST (Thu, 13 Jan 2011)
@@ -4,6 +4,18 @@
 You can use the jamfile in the test directory to
 run the tests for this library.
 
+When running the tests you can use either of the
+two targets if you like. The 'tti' target runs all
+the tests except for those involving variadic macro
+support in the library. The 'ttiVM' target runs
+the tests involving variadic macro support in the
+library. If you do n9ot specify a target all tests
+are run.
+
+For variadic macro support in the library
+you will ned to download the variadic_macro_data
+library from the sandbox.
+
 You can execute these jamfiles while keeping this
 library in its own separate directory from a
 Boost distribution by:

Modified: sandbox/tti/libs/tti/test/TestMFMemberType.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFMemberType.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFMemberType.cpp 2011-01-13 16:27:31 EST (Thu, 13 Jan 2011)
@@ -1,116 +1,75 @@
 #include "TestMFMemberType.hpp"
 #include <boost/detail/lightweight_test.hpp>
-#include <boost/type_traits/is_same.hpp>
 
 int main()
   {
   
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
- tti::mf_member_type
- <
- tti::member_type_AnIntType,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::AnIntType
+ tti::member_type_AnIntType,
+ boost::mpl::identity<AType>
>
- ::value
+ ::valid
             ));
             
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
- tti::mf_member_type
- <
- tti::NameStruct,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::AStructType
+ tti::NameStruct,
+ boost::mpl::identity<AType>
>
- ::value
+ ::valid
             ));
             
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
- tti::mf_member_type
- <
- tti::member_type_AnIntTypeReference,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::AnIntTypeReference
+ tti::member_type_AnIntTypeReference,
+ boost::mpl::identity<AType>
>
- ::value
+ ::valid
             ));
             
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
- tti::mf_member_type
- <
- tti::member_type_BType,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::BType
+ tti::member_type_BType,
+ boost::mpl::identity<AType>
>
- ::value
+ ::valid
             ));
             
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
- tti::mf_member_type
- <
- tti::TheInteger,
- tti::member_type_BType<AType>
- >
- ::type,
- AType::BType::AnIntegerType
+ tti::TheInteger,
+ tti::member_type_BType<AType>
>
- ::value
+ ::valid
             ));
             
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
- tti::mf_member_type
- <
- tti::member_type_CType,
- tti::member_type_BType<AType>
- >
- ::type,
- AType::BType::CType
+ tti::member_type_CType,
+ tti::member_type_BType<AType>
>
- ::value
+ ::valid
             ));
             
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
+ tti::member_type_AnotherIntegerType,
                 tti::mf_member_type
                   <
- tti::member_type_AnotherIntegerType,
- tti::mf_member_type
- <
- tti::member_type_CType,
- tti::member_type_BType<AType>
- >
+ tti::member_type_CType,
+ tti::member_type_BType<AType>
>
- ::type,
- AType::BType::CType::AnotherIntegerType
>
- ::value
+ ::valid
             ));
             
- BOOST_TEST((boost::is_same
+ BOOST_TEST((tti::mf_member_type
                 <
- tti::mf_member_type
- <
- tti::SomethingElse,
- boost::mpl::identity<AnotherType>
- >
- ::type,
- AnotherType::someOtherType
+ tti::SomethingElse,
+ boost::mpl::identity<AnotherType>
>
- ::value
+ ::valid
             ));
   
   return boost::report_errors();

Modified: sandbox/tti/libs/tti/test/TestMFMemberTypeCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFMemberTypeCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFMemberTypeCompile.cpp 2011-01-13 16:27:31 EST (Thu, 13 Jan 2011)
@@ -1,108 +1,101 @@
 #include "TestMFMemberType.hpp"
 #include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
 
 int main()
   {
   
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::member_type_AnIntType,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::AnIntType
- >
- ));
-
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::NameStruct,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::AStructType
- >
- ));
-
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::member_type_AnIntTypeReference,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::AnIntTypeReference
- >
- ));
-
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::member_type_BType,
- boost::mpl::identity<AType>
- >
- ::type,
- AType::BType
- >
- ));
-
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::TheInteger,
- tti::member_type_BType<AType>
- >
- ::type,
- AType::BType::AnIntegerType
- >
- ));
-
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::member_type_CType,
- tti::member_type_BType<AType>
- >
- ::type,
- AType::BType::CType
- >
- ));
-
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::member_type_AnotherIntegerType,
- tti::mf_member_type
- <
- tti::member_type_CType,
- tti::member_type_BType<AType>
- >
- >
- ::type,
- AType::BType::CType::AnotherIntegerType
- >
- ));
-
- BOOST_MPL_ASSERT((boost::is_same
- <
- tti::mf_member_type
- <
- tti::SomethingElse,
- boost::mpl::identity<AnotherType>
- >
- ::type,
- AnotherType::someOtherType
- >
- ));
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::member_type_AnIntType,
+ boost::mpl::identity<AType>
+ >
+ ::valid
+ >
+ ));
+
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::NameStruct,
+ boost::mpl::identity<AType>
+ >
+ ::valid
+ >
+ ));
+
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::member_type_AnIntTypeReference,
+ boost::mpl::identity<AType>
+ >
+ ::valid
+ >
+ ));
+
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::member_type_BType,
+ boost::mpl::identity<AType>
+ >
+ ::valid
+ >
+ ));
+
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::TheInteger,
+ tti::member_type_BType<AType>
+ >
+ ::valid
+ >
+ ));
+
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::member_type_BType<AType>
+ >
+ ::valid
+ >
+ ));
+
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::member_type_AnotherIntegerType,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::member_type_BType<AType>
+ >
+ >
+ ::valid
+ >
+ ));
+
+ BOOST_MPL_ASSERT((boost::mpl::bool_
+ <
+ tti::mf_member_type
+ <
+ tti::SomethingElse,
+ boost::mpl::identity<AnotherType>
+ >
+ ::valid
+ >
+ ));
   
   return 0;
 

Modified: sandbox/tti/libs/tti/test/TestMemberType.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMemberType.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMemberType.cpp 2011-01-13 16:27:31 EST (Thu, 13 Jan 2011)
@@ -1,18 +1,17 @@
 #include "TestMemberType.hpp"
 #include <boost/detail/lightweight_test.hpp>
-#include <boost/type_traits/is_same.hpp>
 
 int main()
   {
   
- BOOST_TEST((boost::is_same<tti::member_type_AnIntType<AType>::type,AType::AnIntType>::value));
- BOOST_TEST((boost::is_same<tti::NameStruct<AType>::type,AType::AStructType>::value));
- BOOST_TEST((boost::is_same<tti::member_type_AnIntTypeReference<AType>::type,AType::AnIntTypeReference>::value));
- BOOST_TEST((boost::is_same<tti::member_type_BType<AType>::type,AType::BType>::value));
- BOOST_TEST((boost::is_same<tti::TheInteger<AType::BType>::type,AType::BType::AnIntegerType>::value));
- BOOST_TEST((boost::is_same<tti::member_type_CType<AType::BType>::type,AType::BType::CType>::value));
- BOOST_TEST((boost::is_same<tti::member_type_AnotherIntegerType<AType::BType::CType>::type,AType::BType::CType::AnotherIntegerType>::value));
- BOOST_TEST((boost::is_same<tti::SomethingElse<AnotherType>::type,AnotherType::someOtherType>::value));
+ BOOST_TEST(tti::member_type_AnIntType<AType>::valid);
+ BOOST_TEST(tti::NameStruct<AType>::valid);
+ BOOST_TEST(tti::member_type_AnIntTypeReference<AType>::valid);
+ BOOST_TEST(tti::member_type_BType<AType>::valid);
+ BOOST_TEST(tti::TheInteger<AType::BType>::valid);
+ BOOST_TEST(tti::member_type_CType<AType::BType>::valid);
+ BOOST_TEST(tti::member_type_AnotherIntegerType<AType::BType::CType>::valid);
+ BOOST_TEST(tti::SomethingElse<AnotherType>::valid);
   
   return boost::report_errors();
 

Modified: sandbox/tti/libs/tti/test/TestMemberTypeCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMemberTypeCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMemberTypeCompile.cpp 2011-01-13 16:27:31 EST (Thu, 13 Jan 2011)
@@ -1,17 +1,18 @@
 #include "TestMemberType.hpp"
 #include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
 
 int main()
   {
   
- BOOST_MPL_ASSERT((boost::is_same<tti::member_type_AnIntType<AType>::type,AType::AnIntType>));
- BOOST_MPL_ASSERT((boost::is_same<tti::NameStruct<AType>::type,AType::AStructType>));
- BOOST_MPL_ASSERT((boost::is_same<tti::member_type_AnIntTypeReference<AType>::type,AType::AnIntTypeReference>));
- BOOST_MPL_ASSERT((boost::is_same<tti::member_type_BType<AType>::type,AType::BType>));
- BOOST_MPL_ASSERT((boost::is_same<tti::TheInteger<AType::BType>::type,AType::BType::AnIntegerType>));
- BOOST_MPL_ASSERT((boost::is_same<tti::member_type_CType<AType::BType>::type,AType::BType::CType>));
- BOOST_MPL_ASSERT((boost::is_same<tti::member_type_AnotherIntegerType<AType::BType::CType>::type,AType::BType::CType::AnotherIntegerType>));
- BOOST_MPL_ASSERT((boost::is_same<tti::SomethingElse<AnotherType>::type,AnotherType::someOtherType>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::member_type_AnIntType<AType>::valid>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::NameStruct<AType>::valid>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::member_type_AnIntTypeReference<AType>::valid>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::member_type_BType<AType>::valid>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::TheInteger<AType::BType>::valid>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::member_type_CType<AType::BType>::valid>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::member_type_AnotherIntegerType<AType::BType::CType>::valid>));
+ BOOST_MPL_ASSERT((boost::mpl::bool_<tti::SomethingElse<AnotherType>::valid>));
   
   return 0;
 

Added: sandbox/tti/readme.txt
==============================================================================
--- (empty file)
+++ sandbox/tti/readme.txt 2011-01-13 16:27:31 EST (Thu, 13 Jan 2011)
@@ -0,0 +1,18 @@
+This is the TTI library, which is an abbreviation
+for the Type Traits Introspection library. The TTI
+library allows a programmer to introspect at compile
+time the inner elements of a C++ type. The introspection
+process depends on specifying the name of the inner
+element by macros for different types of elements, and
+then using a generated metafunction to determine whether
+that element exists within the enclosing type. The
+inner elements which can be introspected are type,
+class template, member data, member function, static
+member data, and static member function.
+
+If you want to contact me directly, my name is
+Edward Diener and you can reach me at
+eld_at_tropicsoft.com. You can also of course
+use the Boost newsgroups to ask questions
+and make comments or suggestions about the
+library.


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