Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73468 - in sandbox/variadic_macro_data: boost/variadic_macro_data libs/variadic_macro_data/doc libs/variadic_macro_data/test
From: eldiener_at_[hidden]
Date: 2011-07-31 18:34:27


Author: eldiener
Date: 2011-07-31 18:34:26 EDT (Sun, 31 Jul 2011)
New Revision: 73468
URL: http://svn.boost.org/trac/boost/changeset/73468

Log:
Updated tests and comments.
Added:
   sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_remove_parens.cpp (contents, props changed)
   sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_tuple_begin.cpp (contents, props changed)
Text files modified:
   sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp | 18 +++++++++++++++---
   sandbox/variadic_macro_data/libs/variadic_macro_data/doc/index.idx | 3 ++-
   sandbox/variadic_macro_data/libs/variadic_macro_data/doc/jamfile.v2 | 3 ++-
   sandbox/variadic_macro_data/libs/variadic_macro_data/test/Jamfile.v2 | 19 ++++++++++++++-----
   4 files changed, 33 insertions(+), 10 deletions(-)

Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp 2011-07-31 18:34:26 EDT (Sun, 31 Jul 2011)
@@ -18,14 +18,26 @@
 /** \file
 */
 
-# define BOOST_VMD_REMOVE_PARENS(x) \
+/// Removes the set of parens from the start of a parameter if it has any.
+/**
+
+ param = a macro parameter.
+
+ returns = the parameter with the beginning set of parens removed.
+ If the parameter has no beginning set of parameters, the
+ parameter is returned as is. If there are further sets of
+ parens after the beginning set of parameters, they are not
+ removed.
+
+*/
+# define BOOST_VMD_REMOVE_PARENS(param) \
     BOOST_PP_IIF \
       ( \
- BOOST_VMD_IS_TUPLE_BEGIN(x), \
+ BOOST_VMD_IS_TUPLE_BEGIN(param), \
       VMD_DETAIL_REMOVE_PARENS, \
       BOOST_PP_IDENTITY \
       ) \
- (x)() \
+ (param)() \
 /**/
 
 #endif // BOOST_VMD_VARIADICS

Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/doc/index.idx
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/doc/index.idx (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/doc/index.idx 2011-07-31 18:34:26 EDT (Sun, 31 Jul 2011)
@@ -1 +1,2 @@
-!scan boost/variadic_macro_data/vmd.hpp
+!scan boost/variadic_macro_data/vmd_native.hpp
+!scan boost/variadic_macro_data/vmd_common.hpp

Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/doc/jamfile.v2
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/doc/jamfile.v2 (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/doc/jamfile.v2 2011-07-31 18:34:26 EDT (Sun, 31 Jul 2011)
@@ -35,7 +35,8 @@
 
 doxygen vmd_reference
   :
- $(here)/../../../boost/variadic_macro_data/vmd.hpp
+ $(here)/../../../boost/variadic_macro_data/vmd_native.hpp
+ $(here)/../../../boost/variadic_macro_data/vmd_common.hpp
   :
     <doxygen:param>PROJECT_NAME="VMD"
     <doxygen:param>PROJECT_NUMBER=1

Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/test/Jamfile.v2
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/test/Jamfile.v2 (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/Jamfile.v2 2011-07-31 18:34:26 EDT (Sun, 31 Jul 2011)
@@ -10,16 +10,16 @@
                                                  <toolset>msvc:<warnings>all
                                                  <toolset>gcc:<warnings>all
                                                  <toolset>gcc-4.3.0:<cxxflags>-Wno-variadic-macros
- <toolset>gcc-4.3.0:<cxxflags>-std=c++0x
                                                  <toolset>gcc-4.4.0:<cxxflags>-Wno-variadic-macros
- <toolset>gcc-4.4.0:<cxxflags>-std=c++0x
                                                  <toolset>gcc-4.5.0:<cxxflags>-Wno-variadic-macros
- <toolset>gcc-4.5.0:<cxxflags>-std=c++0x
- <toolset>gcc-4.5.0:<linkflags>"-Wl,--enable-auto-import"
                                                  <toolset>gcc-4.5.2:<cxxflags>-Wno-variadic-macros
- <toolset>gcc-4.5.2:<cxxflags>-std=c++0x
                                                  <toolset>gcc-4.6.0:<cxxflags>-Wno-variadic-macros
+ <toolset>gcc-4.3.0:<cxxflags>-std=c++0x
+ <toolset>gcc-4.4.0:<cxxflags>-std=c++0x
+ <toolset>gcc-4.5.0:<cxxflags>-std=c++0x
+ <toolset>gcc-4.5.2:<cxxflags>-std=c++0x
                                                  <toolset>gcc-4.6.0:<cxxflags>-std=c++0x
+ <toolset>gcc-4.5.0:<linkflags>"-Wl,--enable-auto-import"
                                                  ;
 
 test-suite variadic_macro_data
@@ -29,6 +29,8 @@
         [ run test_data_as_array.cpp ]
         [ run test_data_as_list.cpp ]
         [ run test_data_as_sequence.cpp ]
+ [ run test_tuple_begin.cpp ]
+ [ run test_remove_parens.cpp ]
     ;
 
 test-suite variadic_macro_data_pplib
@@ -48,4 +50,11 @@
         [ run test_data_as_sequence.cpp : : :
           <define>BOOST_VMD_PPLIB=1 :
           test_data_as_sequence_pplib ]
+ [ run test_tuple_begin.cpp : : :
+ <define>BOOST_VMD_PPLIB=1 :
+ test_tuple_begin_pplib ]
+ [ run test_remove_parens.cpp : : :
+ <define>BOOST_VMD_PPLIB=1 :
+ test_remove_parens_pplib ]
+
     ;

Added: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_remove_parens.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_remove_parens.cpp 2011-07-31 18:34:26 EDT (Sun, 31 Jul 2011)
@@ -0,0 +1,23 @@
+#include <boost/variadic_macro_data/vmd.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+#if BOOST_VMD_VARIADICS
+
+ #define DATA (5 + 3) * 4
+ #define DATA2 4 * (5 + 3)
+ #define DATA3 4 * (5 + 3) * (2 + 1)
+ #define DATA4 (5 + 3) * (2 + 1) * 4
+
+ BOOST_TEST_EQ(BOOST_VMD_REMOVE_PARENS(DATA),17);
+ BOOST_TEST_EQ(BOOST_VMD_REMOVE_PARENS(DATA2),32);
+ BOOST_TEST_EQ(BOOST_VMD_REMOVE_PARENS(DATA3),96);
+ BOOST_TEST_EQ(BOOST_VMD_REMOVE_PARENS(DATA4),41);
+
+#endif
+
+ return boost::report_errors();
+
+ }

Added: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_tuple_begin.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_tuple_begin.cpp 2011-07-31 18:34:26 EDT (Sun, 31 Jul 2011)
@@ -0,0 +1,35 @@
+#include <boost/variadic_macro_data/vmd.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+#if BOOST_VMD_VARIADICS
+
+ #define A_TUPLE (*,#,zz)
+ #define A_TUPLE2 (*,#,(zz,44,(e7)))
+ #define A_TUPLE_PLUS (mmf,34,^^,!) 456
+ #define PLUS_ATUPLE yyt (j,ii%)
+ #define JDATA ggh
+ #define NOT_TUPLE y6()
+ #define NOT_TUPLE2 &(kkkgg,(e))
+ #define A_SEQ (r)($)(#)
+ #define AN_ARRAY (4,(5,7,f,x))
+ #define A_LIST (e,(g,(&,BOOST_PP_NIL)))
+
+ BOOST_TEST(BOOST_VMD_IS_TUPLE_BEGIN(A_TUPLE));
+ BOOST_TEST(BOOST_VMD_IS_TUPLE_BEGIN(A_TUPLE2));
+ BOOST_TEST(BOOST_VMD_IS_TUPLE_BEGIN(A_TUPLE_PLUS));
+ BOOST_TEST(!BOOST_VMD_IS_TUPLE_BEGIN(PLUS_ATUPLE));
+ BOOST_TEST(!BOOST_VMD_IS_TUPLE_BEGIN(JDATA));
+ BOOST_TEST(!BOOST_VMD_IS_TUPLE_BEGIN(NOT_TUPLE));
+ BOOST_TEST(!BOOST_VMD_IS_TUPLE_BEGIN(NOT_TUPLE2));
+ BOOST_TEST(BOOST_VMD_IS_TUPLE_BEGIN(A_SEQ));
+ BOOST_TEST(BOOST_VMD_IS_TUPLE_BEGIN(AN_ARRAY));
+ BOOST_TEST(BOOST_VMD_IS_TUPLE_BEGIN(A_LIST));
+
+#endif
+
+ return boost::report_errors();
+
+ }


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