|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73538 - in sandbox/variadic_macro_data: boost/variadic_macro_data boost/variadic_macro_data/detail libs/variadic_macro_data/doc libs/variadic_macro_data/test
From: eldiener_at_[hidden]
Date: 2011-08-04 18:16:59
Author: eldiener
Date: 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
New Revision: 73538
URL: http://svn.boost.org/trac/boost/changeset/73538
Log:
Added assert_is_tuple with tests.
Added:
sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple.hpp (contents, props changed)
sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple_common.hpp (contents, props changed)
sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_assert_is_tuple.hpp (contents, props changed)
sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_assert_is_tuple_common.hpp (contents, props changed)
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple.cpp (contents, props changed)
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail.cpp (contents, props changed)
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail2.cpp (contents, props changed)
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail3.cpp (contents, props changed)
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail4.cpp (contents, props changed)
Text files modified:
sandbox/variadic_macro_data/boost/variadic_macro_data/vmd.hpp | 1 +
sandbox/variadic_macro_data/libs/variadic_macro_data/doc/index.idx | 1 +
sandbox/variadic_macro_data/libs/variadic_macro_data/doc/jamfile.v2 | 1 +
sandbox/variadic_macro_data/libs/variadic_macro_data/test/Jamfile.v2 | 30 ++++++++++++++++++++++++++++++
4 files changed, 33 insertions(+), 0 deletions(-)
Added: sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple.hpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,11 @@
+#if !defined(VMD_DETAIL_ASSERT_IS_TUPLE_HPP)
+#define VMD_DETAIL_ASSERT_IS_TUPLE_HPP
+
+#include <boost/variadic_macro_data/detail/vmd_detail_setup.hpp>
+
+#if BOOST_VMD_VARIADICS
+
+#include <boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple_common.hpp>
+
+#endif /* BOOST_VMD_VARIADICS */
+#endif /* VMD_DETAIL_ASSERT_IS_TUPLE_HPP */
Added: sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple_common.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple_common.hpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,47 @@
+#if !defined(VMD_DETAIL_ASSERT_IS_TUPLE_COMMON_HPP)
+#define VMD_DETAIL_ASSERT_IS_TUPLE_COMMON_HPP
+
+#include <boost/variadic_macro_data/detail/vmd_detail_setup.hpp>
+
+#if BOOST_VMD_VARIADICS
+
+#if BOOST_VMD_ASSERT_DATA
+
+#include <boost/variadic_macro_data/vmd_is_empty.hpp>
+
+#if BOOST_VMD_MSVC
+
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/debug/assert.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+
+#define VMD_DETAIL_ASSERT_IS_TUPLE_VC_CHECK_RETURN_FAILURE(x) \
+ BOOST_PP_ASSERT \
+ ( \
+ x \
+ ) \
+ BOOST_PP_IIF \
+ ( \
+ x, \
+ BOOST_PP_EMPTY, \
+ VMD_DETAIL_ASSERT_IS_TUPLE_VC_GEN_ERROR_OUTPUT \
+ ) \
+ () \
+/**/
+
+#define VMD_DETAIL_ASSERT_IS_TUPLE_VC_GEN_ERROR_OUTPUT() \
+ typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; \
+/**/
+
+#endif /* BOOST_VMD_MSVC */
+
+#define VMD_DETAIL_ASSERT_IS_TUPLE_IS_NOT_AFTER(x) \
+ BOOST_VMD_IS_EMPTY(VMD_DETAIL_ASSERT_IS_TUPLE_EXPAND_AFTER x) \
+/**/
+
+#define VMD_DETAIL_ASSERT_IS_TUPLE_EXPAND_AFTER(...) \
+/**/
+
+#endif /* BOOST_VMD_ASSERT_DATA */
+#endif /* BOOST_VMD_VARIADICS */
+#endif /* VMD_DETAIL_ASSERT_IS_TUPLE_COMMON_HPP */
Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/vmd.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/vmd.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/vmd.hpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -11,6 +11,7 @@
#include <boost/variadic_macro_data/vmd_is_empty.hpp>
#include <boost/variadic_macro_data/vmd_is_tuple_begin.hpp>
#include <boost/variadic_macro_data/vmd_remove_parens.hpp>
+#include <boost/variadic_macro_data/vmd_assert_is_tuple.hpp>
#endif /* BOOST_VMD_VARIADICS */
#endif /* VARIADIC_MACRO_DATA_HPP */
Added: sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_assert_is_tuple.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_assert_is_tuple.hpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,11 @@
+#if !defined(VMD_ASSERT_IS_TUPLE_HPP)
+#define VMD_ASSERT_IS_TUPLE_HPP
+
+#include <boost/variadic_macro_data/detail/vmd_detail_setup.hpp>
+
+#if BOOST_VMD_VARIADICS
+
+#include <boost/variadic_macro_data/vmd_assert_is_tuple_common.hpp>
+
+#endif /* BOOST_VMD_VARIADICS */
+#endif /* VMD_ASSERT_IS_TUPLE_HPP */
Added: sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_assert_is_tuple_common.hpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_assert_is_tuple_common.hpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,71 @@
+#if !defined(VMD_ASSERT_IS_TUPLE_COMMON_HPP)
+#define VMD_ASSERT_IS_TUPLE_COMMON_HPP
+
+#include <boost/variadic_macro_data/detail/vmd_detail_setup.hpp>
+
+#if BOOST_VMD_VARIADICS
+
+/*
+
+ The succeeding comments in this file are in doxygen format.
+
+*/
+
+/** \file
+*/
+
+#if !BOOST_VMD_ASSERT_DATA
+
+#define BOOST_VMD_ASSERT_IS_TUPLE(x)
+
+#else
+
+#include <boost/preprocessor/control/iif.hpp>
+
+#if !BOOST_VMD_MSVC
+
+#include <boost/preprocessor/debug/assert.hpp>
+
+#endif
+
+#include <boost/variadic_macro_data/vmd_is_tuple_begin.hpp>
+#include <boost/variadic_macro_data/detail/vmd_detail.hpp>
+#include <boost/variadic_macro_data/detail/vmd_detail_assert_is_tuple.hpp>
+
+#if BOOST_VMD_MSVC
+
+#include <boost/preprocessor/facilities/empty.hpp>
+
+#define BOOST_VMD_ASSERT_IS_TUPLE(x) \
+ VMD_DETAIL_ASSERT_IS_TUPLE_VC_CHECK_RETURN_FAILURE \
+ ( \
+ BOOST_PP_IIF \
+ ( \
+ BOOST_VMD_IS_TUPLE_BEGIN(x), \
+ VMD_DETAIL_ASSERT_IS_TUPLE_IS_NOT_AFTER, \
+ VMD_DETAIL_GEN_ZERO \
+ ) \
+ (x) \
+ ) \
+/**/
+
+#else
+
+#define BOOST_VMD_ASSERT_IS_TUPLE(x) \
+ BOOST_PP_ASSERT \
+ ( \
+ BOOST_PP_IIF \
+ ( \
+ BOOST_VMD_IS_TUPLE_BEGIN(x), \
+ VMD_DETAIL_ASSERT_IS_TUPLE_IS_NOT_AFTER, \
+ VMD_DETAIL_GEN_ZERO \
+ ) \
+ (x) \
+ ) \
+/**/
+
+#endif
+
+#endif /* BOOST_VMD_ASSERT_DATA */
+#endif /* BOOST_VMD_VARIADICS */
+#endif /* VMD_ASSERT_IS_TUPLE_COMMON_HPP */
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-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -4,3 +4,4 @@
!scan boost/variadic_macro_data/vmd_is_empty_common.hpp
!scan boost/variadic_macro_data/vmd_is_tuple_begin_common.hpp
!scan boost/variadic_macro_data/vmd_remove_parens_common.hpp
+!scan boost/variadic_macro_data/vmd_assert_is_tuple_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-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -41,6 +41,7 @@
$(here)/../../../boost/variadic_macro_data/vmd_is_empty_common.hpp
$(here)/../../../boost/variadic_macro_data/vmd_is_tuple_begin_common.hpp
$(here)/../../../boost/variadic_macro_data/vmd_remove_parens_common.hpp
+ $(here)/../../../boost/variadic_macro_data/vmd_assert_is_tuple_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-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -32,6 +32,16 @@
[ run test_tuple_begin.cpp ]
[ run test_remove_parens.cpp ]
[ run test_is_empty.cpp ]
+ [ compile test_assert_is_tuple.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1 ]
+ [ compile-fail test_assert_is_tuple_fail.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1 ]
+ [ compile-fail test_assert_is_tuple_fail2.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1 ]
+ [ compile-fail test_assert_is_tuple_fail3.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1 ]
+ [ compile-fail test_assert_is_tuple_fail4.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1 ]
;
test-suite variadic_macro_data_pplib
@@ -60,4 +70,24 @@
[ run test_is_empty.cpp : : :
<define>BOOST_VMD_PPLIB=1 :
test_is_empty_pplib ]
+ [ compile test_assert_is_tuple.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1
+ <define>BOOST_VMD_PPLIB=1 :
+ test_assert_is_tuple_pplib ]
+ [ compile-fail test_assert_is_tuple_fail.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1
+ <define>BOOST_VMD_PPLIB=1 :
+ test_assert_is_tuple_fail_pplib ]
+ [ compile-fail test_assert_is_tuple_fail2.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1
+ <define>BOOST_VMD_PPLIB=1 :
+ test_assert_is_tuple_fail2_pplib.cpp ]
+ [ compile-fail test_assert_is_tuple_fail3.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1
+ <define>BOOST_VMD_PPLIB=1 :
+ test_assert_is_tuple_fail3_pplib ]
+ [ compile-fail test_assert_is_tuple_fail4.cpp :
+ <define>BOOST_VMD_ASSERT_DATA=1
+ <define>BOOST_VMD_PPLIB=1 :
+ test_assert_is_tuple_fail4_pplib ]
;
Added: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple.cpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,26 @@
+#include <boost/variadic_macro_data/vmd_assert_is_tuple.hpp>
+// #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 AN_ARRAY (4,(5,7,f,x))
+ #define A_LIST (e,(g,(&,BOOST_PP_NIL)))
+
+ BOOST_VMD_ASSERT_IS_TUPLE((t,3,e,2))
+ BOOST_VMD_ASSERT_IS_TUPLE(((y,s,w),3,e,2))
+ BOOST_VMD_ASSERT_IS_TUPLE(A_TUPLE)
+ BOOST_VMD_ASSERT_IS_TUPLE(A_TUPLE2)
+ BOOST_VMD_ASSERT_IS_TUPLE(AN_ARRAY)
+ BOOST_VMD_ASSERT_IS_TUPLE(A_LIST)
+
+#endif
+
+ return boost::report_errors();
+
+ }
Added: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail.cpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,21 @@
+#include <boost/variadic_macro_data/vmd_assert_is_tuple.hpp>
+// #include <boost/variadic_macro_data/vmd.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+int main()
+ {
+
+#if BOOST_VMD_VARIADICS && BOOST_VMD_ASSERT_DATA
+
+ BOOST_VMD_ASSERT_IS_TUPLE((x,3,e,2)ty)
+
+#else
+
+ typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; \
+
+#endif
+
+ return boost::report_errors();
+
+ }
Added: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail2.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail2.cpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,20 @@
+#include <boost/variadic_macro_data/vmd_assert_is_tuple.hpp>
+// #include <boost/variadic_macro_data/vmd.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+#if BOOST_VMD_VARIADICS && BOOST_VMD_ASSERT_DATA
+
+ BOOST_VMD_ASSERT_IS_TUPLE(op(x,3,e,2))
+
+#else
+
+ typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; \
+
+#endif
+
+ return boost::report_errors();
+
+ }
Added: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail3.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail3.cpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,20 @@
+#include <boost/variadic_macro_data/vmd_assert_is_tuple.hpp>
+// #include <boost/variadic_macro_data/vmd.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+#if BOOST_VMD_VARIADICS && BOOST_VMD_ASSERT_DATA
+
+ BOOST_VMD_ASSERT_IS_TUPLE(x,3,e,2)
+
+#else
+
+ typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; \
+
+#endif
+
+ return boost::report_errors();
+
+ }
Added: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail4.cpp
==============================================================================
--- (empty file)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_assert_is_tuple_fail4.cpp 2011-08-04 18:16:53 EDT (Thu, 04 Aug 2011)
@@ -0,0 +1,20 @@
+#include <boost/variadic_macro_data/vmd_assert_is_tuple.hpp>
+// #include <boost/variadic_macro_data/vmd.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+#if BOOST_VMD_VARIADICS && BOOST_VMD_ASSERT_DATA
+
+ BOOST_VMD_ASSERT_IS_TUPLE((x,3,e,2)(y,rr))
+
+#else
+
+ typedef char BOOST_VMD_ASSERT_IS_TUPLE_ERROR[-1]; \
+
+#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