|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52421 - in sandbox/mirror: boost/mirror boost/mirror/algorithm boost/mirror/algorithm/detail boost/mirror/detail boost/mirror/meta_path libs/mirror/test
From: chochlik_at_[hidden]
Date: 2009-04-16 11:25:47
Author: matus.chochlik
Date: 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
New Revision: 52421
URL: http://svn.boost.org/trac/boost/changeset/52421
Log:
[mirror 0.4.x]
- contains several minor bugfixes
- update of the testsuite to use c++0x static_asserts where available
Text files modified:
sandbox/mirror/boost/mirror/algorithm/detail/iterative.hpp | 34 +++---
sandbox/mirror/boost/mirror/algorithm/for_each.hpp | 28 +++---
sandbox/mirror/boost/mirror/algorithm/reverse_for_each.hpp | 26 ++--
sandbox/mirror/boost/mirror/detail/traversal.hpp | 108 +++++++++++-----------
sandbox/mirror/boost/mirror/meta_path/for_each.hpp | 2
sandbox/mirror/boost/mirror/traversal.hpp | 34 +++---
sandbox/mirror/libs/mirror/test/classes_ct_01.cpp | 43 ++++++--
sandbox/mirror/libs/mirror/test/classes_ct_02.cpp | 17 ++-
sandbox/mirror/libs/mirror/test/classes_ct_03.cpp | 169 +++++++++++++-----------------------
sandbox/mirror/libs/mirror/test/classes_ct_04.cpp | 9 +
sandbox/mirror/libs/mirror/test/classes_ct_05.cpp | 9 +
sandbox/mirror/libs/mirror/test/classes_ct_06.cpp | 8 +
sandbox/mirror/libs/mirror/test/classes_ct_07.cpp | 18 ++-
sandbox/mirror/libs/mirror/test/classes_ct_09.cpp | 183 +++++++++++++++++++++++++++++----------
sandbox/mirror/libs/mirror/test/classes_ct_10.cpp | 33 ++++---
sandbox/mirror/libs/mirror/test/classes_ct_11.cpp | 31 +++--
sandbox/mirror/libs/mirror/test/classes_rt_09.cpp | 1
sandbox/mirror/libs/mirror/test/classes_rt_10.cpp | 1
sandbox/mirror/libs/mirror/test/concepts_ct_01.cpp | 6 +
sandbox/mirror/libs/mirror/test/concepts_ct_02.cpp | 6 +
sandbox/mirror/libs/mirror/test/concepts_ct_03.cpp | 6 +
sandbox/mirror/libs/mirror/test/namespaces_ct_01.cpp | 28 +++++-
sandbox/mirror/libs/mirror/test/namespaces_ct_02.cpp | 34 +++++-
sandbox/mirror/libs/mirror/test/namespaces_ct_04.cpp | 95 ++++++++++++--------
sandbox/mirror/libs/mirror/test/namespaces_ct_05.cpp | 164 ++++++++++++++++++++++++-----------
sandbox/mirror/libs/mirror/test/other_ct_01.cpp | 1
sandbox/mirror/libs/mirror/test/test.hpp | 29 ++++++
sandbox/mirror/libs/mirror/test/types_ct_01.cpp | 72 +++++++++++----
sandbox/mirror/libs/mirror/test/types_ct_03.cpp | 86 ++++++++++-------
29 files changed, 787 insertions(+), 494 deletions(-)
Modified: sandbox/mirror/boost/mirror/algorithm/detail/iterative.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/detail/iterative.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/detail/iterative.hpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -46,8 +46,8 @@
private:
template <class MetaObjectOp, class TransformOp, class Iterator>
static inline void do_apply_to(
- reference_wrapper<MetaObjectOp> op_ref,
- reference_wrapper<TransformOp> transf_ref,
+ ::boost::reference_wrapper<MetaObjectOp> op_ref,
+ ::boost::reference_wrapper<TransformOp> transf_ref,
Iterator
)
{
@@ -67,8 +67,8 @@
template <class MetaObjectOp, class TransformOp, class Iterator>
static inline void pre_apply_to(
- reference_wrapper<MetaObjectOp> op,
- reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<MetaObjectOp> op,
+ ::boost::reference_wrapper<TransformOp> transf,
Iterator,
forward
)
@@ -78,24 +78,24 @@
template <class MetaObjectOp, class TransformOp, class Iterator>
static inline void pre_apply_to(
- reference_wrapper<MetaObjectOp> op,
- reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<MetaObjectOp> op,
+ ::boost::reference_wrapper<TransformOp> transf,
Iterator,
reverse
){ }
template <class MetaObjectOp, class TransformOp, class Iterator>
static inline void post_apply_to(
- reference_wrapper<MetaObjectOp> op,
- reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<MetaObjectOp> op,
+ ::boost::reference_wrapper<TransformOp> transf,
Iterator,
forward
){ }
template <class MetaObjectOp, class TransformOp, class Iterator>
static inline void post_apply_to(
- reference_wrapper<MetaObjectOp> op,
- reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<MetaObjectOp> op,
+ ::boost::reference_wrapper<TransformOp> transf,
Iterator,
reverse
)
@@ -106,16 +106,16 @@
template <class MetaObjectOp, class TransformOp, class Iterator>
static inline void apply_to(
- reference_wrapper<MetaObjectOp> op,
- reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<MetaObjectOp> op,
+ ::boost::reference_wrapper<TransformOp> transf,
Iterator,
mpl::true_
){ }
template <class MetaObjectOp, class TransformOp, class Iterator>
static inline void apply_to(
- reference_wrapper<MetaObjectOp> op,
- reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<MetaObjectOp> op,
+ ::boost::reference_wrapper<TransformOp> transf,
Iterator i,
mpl::false_
)
@@ -129,9 +129,9 @@
}
public:
template <class MetaObjectOp, class TransformOp>
- static inline reference_wrapper<MetaObjectOp> perform(
- reference_wrapper<MetaObjectOp> op,
- reference_wrapper<TransformOp> transf
+ static inline ::boost::reference_wrapper<MetaObjectOp> perform(
+ ::boost::reference_wrapper<MetaObjectOp> op,
+ ::boost::reference_wrapper<TransformOp> transf
)
{
typename iterator_equal<begin, end>::type done;
Modified: sandbox/mirror/boost/mirror/algorithm/for_each.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/for_each.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/for_each.hpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -36,14 +36,14 @@
class MetaObjectSequence,
class Functor
>
-static inline reference_wrapper<Functor> for_each(
- reference_wrapper<Functor> fn
+static inline ::boost::reference_wrapper<Functor> for_each(
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::for_each_impl<
typename mirror::begin<MetaObjectSequence>::type,
typename mirror::end<MetaObjectSequence>::type
- > ::perform(fn, cref(detail::no_op()));
+ > ::perform(fn, ::boost::cref(detail::no_op()));
}
template <
@@ -55,7 +55,7 @@
return detail::for_each_impl<
typename mirror::begin<MetaObjectSequence>::type,
typename mirror::end<MetaObjectSequence>::type
- > ::perform(ref(fn), cref(detail::no_op()));
+ > ::perform(::boost::ref(fn), ::boost::cref(detail::no_op()));
}
template <
@@ -63,9 +63,9 @@
class TransformOp,
class Functor
>
-static inline reference_wrapper<Functor> for_each(
- reference_wrapper<TransformOp> transf,
- reference_wrapper<Functor> fn
+static inline ::boost::reference_wrapper<Functor> for_each(
+ ::boost::reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::for_each_impl<
@@ -87,21 +87,21 @@
return detail::for_each_impl<
typename mirror::begin<MetaObjectSequence>::type,
typename mirror::end<MetaObjectSequence>::type
- > ::perform(ref(fn), ref(transf));
+ > ::perform(::boost::ref(fn), ::boost::ref(transf));
}
template <
class IteratorBegin,
class IteratorEnd,
class Functor
>
-static inline reference_wrapper<Functor> for_each(
- reference_wrapper<Functor> fn
+static inline ::boost::reference_wrapper<Functor> for_each(
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::for_each_impl<
IteratorBegin,
IteratorEnd
- > ::perform(fn, cref(detail::no_op()));
+ > ::perform(fn, ::boost::cref(detail::no_op()));
}
template <
@@ -110,9 +110,9 @@
class TransformOp,
class Functor
>
-static inline reference_wrapper<Functor> for_each(
- reference_wrapper<TransformOp> transf,
- reference_wrapper<Functor> fn
+static inline ::boost::reference_wrapper<Functor> for_each(
+ ::boost::reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::for_each_impl<
Modified: sandbox/mirror/boost/mirror/algorithm/reverse_for_each.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/algorithm/reverse_for_each.hpp (original)
+++ sandbox/mirror/boost/mirror/algorithm/reverse_for_each.hpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -36,14 +36,14 @@
class MetaObjectSequence,
class Functor
>
-static reference_wrapper<Functor> reverse_for_each(
- reference_wrapper<Functor> fn
+static ::boost::reference_wrapper<Functor> reverse_for_each(
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::reverse_for_each_impl<
typename mirror::begin<MetaObjectSequence>::type,
typename mirror::end<MetaObjectSequence>::type
- > ::perform(fn, cref(detail::no_op()));
+ > ::perform(fn, ::boost::cref(detail::no_op()));
}
template <
@@ -55,7 +55,7 @@
return detail::reverse_for_each_impl<
typename mirror::begin<MetaObjectSequence>::type,
typename mirror::end<MetaObjectSequence>::type
- > ::perform(ref(fn), cref(detail::no_op()));
+ > ::perform(::boost::ref(fn), ::boost::cref(detail::no_op()));
}
template <
@@ -63,9 +63,9 @@
class TransformOp,
class Functor
>
-static reference_wrapper<Functor> reverse_for_each(
- reference_wrapper<TransformOp> transf,
- reference_wrapper<Functor> fn
+static ::boost::reference_wrapper<Functor> reverse_for_each(
+ ::boost::reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::reverse_for_each_impl<
@@ -87,7 +87,7 @@
return detail::reverse_for_each_impl<
typename mirror::begin<MetaObjectSequence>::type,
typename mirror::end<MetaObjectSequence>::type
- > ::perform(ref(fn), ref(transf));
+ > ::perform(::boost::ref(fn), ::boost::ref(transf));
}
template <
@@ -95,14 +95,14 @@
class IteratorEnd,
class Functor
>
-static reference_wrapper<Functor> reverse_for_each(
- reference_wrapper<Functor> fn
+static ::boost::reference_wrapper<Functor> reverse_for_each(
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::reverse_for_each_impl<
IteratorBegin,
IteratorEnd
- > ::perform(fn, cref(detail::no_op()));
+ > ::perform(fn, ::boost::cref(detail::no_op()));
}
template <
@@ -112,8 +112,8 @@
class Functor
>
static Functor reverse_for_each(
- reference_wrapper<TransformOp> transf,
- reference_wrapper<Functor> fn
+ ::boost::reference_wrapper<TransformOp> transf,
+ ::boost::reference_wrapper<Functor> fn
)
{
return detail::reverse_for_each_impl<
Modified: sandbox/mirror/boost/mirror/detail/traversal.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/traversal.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/traversal.hpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -54,7 +54,7 @@
{
public:
inline attribute_traversal(
- reference_wrapper<VisitorType> _visitor,
+ ::boost::reference_wrapper<VisitorType> _visitor,
InstancePtr _ptr_to_inst
)
: visitor(_visitor)
@@ -81,7 +81,7 @@
process_single(ma, path);
}
private:
- reference_wrapper<VisitorType> visitor;
+ ::boost::reference_wrapper<VisitorType> visitor;
InstancePtr ptr_to_inst;
// process single attribute WITH an instance
@@ -157,7 +157,7 @@
template < class MetaAttribute, class AttribsNodePath>
static inline void lead_into_attribute(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaAttribute ma,
AttribsNodePath path
)
@@ -177,7 +177,7 @@
template < class MetaAttribute, class AttribsNodePath>
static inline void lead_into_attribute_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaAttribute ma,
AttribsNodePath path
)
@@ -194,14 +194,14 @@
template <class MetaAttribute, class AttribsNodePath>
static inline void lead_into_attribute_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaAttribute ma,
AttribsNodePath path
){ }
template < class MetaAttribute, class AttribsNodePath>
static inline void lead_out_of_attribute(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaAttribute ma,
AttribsNodePath path
)
@@ -221,7 +221,7 @@
template <class MetaAttribute, class AttribsNodePath>
static inline void lead_out_of_attribute_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaAttribute ma,
AttribsNodePath path
)
@@ -238,13 +238,13 @@
template <class MetaAttribute, class AttribsNodePath>
static inline void lead_out_of_attribute_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaAttribute ma,
AttribsNodePath path
){ }
static inline void lead_into_attribute_list(
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
lead_into_attribute_list_if(
@@ -260,7 +260,7 @@
static inline void lead_into_attribute_list_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
visitor.get().enter_attributes(
@@ -275,11 +275,11 @@
static inline void lead_into_attribute_list_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
){ }
static inline void lead_out_of_attribute_list(
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
lead_out_of_attribute_list_if(
@@ -295,7 +295,7 @@
static inline void lead_out_of_attribute_list_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
visitor.get().leave_attributes(
@@ -310,7 +310,7 @@
static inline void lead_out_of_attribute_list_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
){ }
};
@@ -319,7 +319,7 @@
template <class VisitorType, class InstancePtr>
static inline attribute_traversal<VisitorType, InstancePtr>
show_attribs_to(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst
)
{
@@ -335,7 +335,7 @@
{
public:
inline base_class_traversal(
- reference_wrapper<VisitorType> _visitor,
+ ::boost::reference_wrapper<VisitorType> _visitor,
InstancePtr _ptr_to_inst
)
: visitor(_visitor)
@@ -377,12 +377,12 @@
typename MetaClass::base_classes
>::type BaseClassesNodePath;
- reference_wrapper<VisitorType> visitor;
+ ::boost::reference_wrapper<VisitorType> visitor;
InstancePtr ptr_to_inst;
template <class MetaInheritance>
static inline void lead_into_base_class(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaInheritance mbc,
BaseClassesNodePath path
)
@@ -402,7 +402,7 @@
template <class MetaInheritance>
static inline void lead_into_base_class_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaInheritance mbc,
BaseClassesNodePath path
)
@@ -419,14 +419,14 @@
template <class MetaInheritance>
static inline void lead_into_base_class_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaInheritance mbc,
BaseClassesNodePath path
){ }
template <class MetaInheritance>
static inline void lead_out_of_base_class(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaInheritance mbc,
BaseClassesNodePath path
)
@@ -446,7 +446,7 @@
template <class MetaInheritance>
static inline void lead_out_of_base_class_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaInheritance mbc,
BaseClassesNodePath path
)
@@ -463,13 +463,13 @@
template <class MetaInheritance>
static inline void lead_out_of_base_class_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaInheritance mbc,
BaseClassesNodePath path
){ }
static inline void lead_into_base_class_list(
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
lead_into_base_class_list_if(
@@ -488,7 +488,7 @@
static inline void lead_into_base_class_list_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
visitor.get().enter_base_classes(
@@ -503,11 +503,11 @@
static inline void lead_into_base_class_list_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
){ }
static inline void lead_out_of_base_class_list(
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
lead_out_of_base_class_list_if(
@@ -526,7 +526,7 @@
static inline void lead_out_of_base_class_list_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
)
{
visitor.get().leave_base_classes(
@@ -541,7 +541,7 @@
static inline void lead_out_of_base_class_list_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor
+ ::boost::reference_wrapper<VisitorType> visitor
){ }
@@ -551,7 +551,7 @@
template <class VisitorType, class InstancePtr>
static inline base_class_traversal<VisitorType, InstancePtr>
show_bases_to(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst
)
{
@@ -566,7 +566,7 @@
class InstanceType
>
inline static void lead_to_instance(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path,
InstanceType* ptr_to_inst
@@ -587,7 +587,7 @@
>
inline static void lead_to_instance_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path,
InstanceType* ptr_to_inst
@@ -609,7 +609,7 @@
>
inline static void lead_to_instance_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path,
InstanceType* ptr_to_inst
@@ -617,7 +617,7 @@
template <class VisitorType>
static inline void lead_into_type(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path
)
@@ -637,7 +637,7 @@
template < class VisitorType>
static inline void lead_into_type_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path
)
@@ -654,14 +654,14 @@
template < class VisitorType>
static inline void lead_into_type_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path
){ }
template <class VisitorType>
static inline void lead_out_of_type(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path
)
@@ -681,7 +681,7 @@
template < class VisitorType>
static inline void lead_out_of_type_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path
)
@@ -698,7 +698,7 @@
template < class VisitorType>
static inline void lead_out_of_type_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaClass mc,
NodePath path
){ }
@@ -722,7 +722,7 @@
template <class VisitorType, class Members>
struct namespace_member_traversal
{
- reference_wrapper<VisitorType> visitor;
+ ::boost::reference_wrapper<VisitorType> visitor;
typedef typename mpl::push_back<
NamespaceNodePath,
@@ -730,7 +730,7 @@
>::type MembersNodePath;
inline namespace_member_traversal(
- reference_wrapper<VisitorType> _visitor
+ ::boost::reference_wrapper<VisitorType> _visitor
): visitor(_visitor)
{
lead_into_namespace_member_list(
@@ -759,7 +759,7 @@
}
static inline void lead_into_namespace_member_list(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
Members m,
NamespaceNodePath path
)
@@ -778,7 +778,7 @@
static inline void lead_into_namespace_member_list_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
Members m,
NamespaceNodePath path
)
@@ -794,13 +794,13 @@
static inline void lead_into_namespace_member_list_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
Members m,
NamespaceNodePath path
){ }
static inline void lead_out_of_namespace_member_list(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
Members m,
NamespaceNodePath path
)
@@ -819,7 +819,7 @@
static inline void lead_out_of_namespace_member_list_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
Members m,
NamespaceNodePath path
)
@@ -835,7 +835,7 @@
static inline void lead_out_of_namespace_member_list_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
Members m,
NamespaceNodePath path
){ }
@@ -843,7 +843,7 @@
template <class Members, class VisitorType>
static inline namespace_member_traversal<VisitorType, Members>
- show_namespace_members_to(reference_wrapper<VisitorType> _visitor, Members)
+ show_namespace_members_to(::boost::reference_wrapper<VisitorType> _visitor, Members)
{
return namespace_member_traversal<VisitorType, Members>(_visitor);
}
@@ -851,7 +851,7 @@
template <class VisitorType>
static inline void lead_into_namespace(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaNamespace mn,
NodePath path
)
@@ -871,7 +871,7 @@
template <class VisitorType>
static inline void lead_into_namespace_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaNamespace mn,
NodePath path
)
@@ -888,14 +888,14 @@
template < class VisitorType>
static inline void lead_into_namespace_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaNamespace mn,
NodePath path
){ }
template <class VisitorType>
static inline void lead_out_of_namespace(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaNamespace mn,
NodePath path
)
@@ -915,7 +915,7 @@
template < class VisitorType>
static inline void lead_out_of_namespace_if(
mpl::true_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaNamespace mn,
NodePath path
)
@@ -932,7 +932,7 @@
template < class VisitorType>
static inline void lead_out_of_namespace_if(
mpl::false_,
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
MetaNamespace mn,
NodePath path
){ }
Modified: sandbox/mirror/boost/mirror/meta_path/for_each.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_path/for_each.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_path/for_each.hpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -53,7 +53,7 @@
class NodeSet,
class Functor
>
-void for_each(boost::reference_wrapper<Functor> f_ref)
+void for_each(::boost::reference_wrapper<Functor> f_ref)
{
mpl::for_each<
typename NodeSet::paths_and_nodes
Modified: sandbox/mirror/boost/mirror/traversal.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/traversal.hpp (original)
+++ sandbox/mirror/boost/mirror/traversal.hpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -41,12 +41,12 @@
InstancePtr ptr_to_inst = 0
)
{
- do_accept(ref<VisitorType>(visitor), ptr_to_inst);
+ do_accept(::boost::ref<VisitorType>(visitor), ptr_to_inst);
}
template <class VisitorType>
static inline void accept(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst = 0
)
{
@@ -59,12 +59,12 @@
ConstInstancePtr ptr_to_inst
)
{
- do_accept(ref<VisitorType>(visitor), ptr_to_inst);
+ do_accept(::boost::ref<VisitorType>(visitor), ptr_to_inst);
}
template <class VisitorType>
static inline void accept(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
ConstInstancePtr ptr_to_inst
)
{
@@ -73,7 +73,7 @@
private:
template <class VisitorType, class InstanceType>
static inline void do_accept(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
InstanceType* ptr_to_inst
)
{
@@ -85,11 +85,11 @@
lead_to_instance(visitor, mc, path, ptr_to_inst);
// go through the base classes
for_each<typename MetaClass::base_classes>(
- cref(show_bases_to(visitor, ptr_to_inst))
+ ::boost::cref(show_bases_to(visitor, ptr_to_inst))
);
// go through the own class' attributes
for_each<typename MetaClass::attributes>(
- cref(show_attribs_to(visitor, ptr_to_inst))
+ ::boost::cref(show_attribs_to(visitor, ptr_to_inst))
);
// leave the type
lead_out_of_type(visitor, mc, path);
@@ -121,12 +121,12 @@
InstancePtr ptr_to_inst = 0
)
{
- do_accept(ref<VisitorType>(visitor), ptr_to_inst);
+ do_accept(::boost::ref<VisitorType>(visitor), ptr_to_inst);
}
template <class VisitorType>
static inline void accept(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
InstancePtr ptr_to_inst = 0
)
{
@@ -139,12 +139,12 @@
ConstInstancePtr ptr_to_inst
)
{
- do_accept(ref<VisitorType>(visitor), ptr_to_inst);
+ do_accept(::boost::ref<VisitorType>(visitor), ptr_to_inst);
}
template <class VisitorType>
static inline void accept(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
ConstInstancePtr ptr_to_inst
)
{
@@ -153,7 +153,7 @@
private:
template <class VisitorType, class InstanceType>
static inline void do_accept(
- reference_wrapper<VisitorType> visitor,
+ ::boost::reference_wrapper<VisitorType> visitor,
InstanceType* ptr_to_inst
)
{
@@ -165,7 +165,7 @@
lead_to_instance(visitor, mc, path, ptr_to_inst);
// go through all of the class' attributes
for_each<typename MetaClass::all_attributes>(
- cref(show_attribs_to(visitor, ptr_to_inst))
+ ::boost::cref(show_attribs_to(visitor, ptr_to_inst))
);
// leave the type
lead_out_of_type(visitor, mc, path);
@@ -205,18 +205,18 @@
template <class VisitorType>
static inline void accept(VisitorType visitor)
{
- do_accept(ref<VisitorType>(visitor));
+ do_accept(::boost::ref<VisitorType>(visitor));
}
template <class VisitorType>
- static void accept(reference_wrapper<VisitorType> visitor)
+ static void accept(::boost::reference_wrapper<VisitorType> visitor)
{
do_accept(visitor);
}
private:
template <class VisitorType>
- static void do_accept(reference_wrapper<VisitorType> visitor)
+ static void do_accept(::boost::reference_wrapper<VisitorType> visitor)
{
MetaNamespace mn;
NodePath path;
@@ -227,7 +227,7 @@
// show the visitor through all the members of
// the namespace
for_each<members>(
- cref(show_namespace_members_to(
+ ::boost::cref(show_namespace_members_to(
visitor,
members()
))
Modified: sandbox/mirror/libs/mirror/test/classes_ct_01.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_01.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_01.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -66,7 +66,7 @@
> some_classes;
// none of the classes is defined in the global scope
- BOOST_MPL_ASSERT_NOT(( mpl::accumulate<
+ typedef mpl::accumulate<
some_classes,
mpl::false_,
mpl::or_<
@@ -77,11 +77,15 @@
>
>
>
- >::type ));
+ >::type result_01;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_01,
+ "No class in list should be from the global scope"
+ );
// all off the classes are defined in a namespace defined
// (directly) under the global scope
- BOOST_MPL_ASSERT(( mpl::accumulate<
+ typedef mpl::accumulate<
some_classes,
mpl::true_,
mpl::and_<
@@ -92,8 +96,13 @@
>
>
>
- >::type ));
- BOOST_MPL_ASSERT(( mpl::accumulate<
+ >::type result_02;
+ BOOST_MIRROR_ASSERT(
+ result_02,
+ "All classes in list should be from a named namespace"
+ );
+
+ typedef mpl::accumulate<
some_classes,
mpl::true_,
mpl::and_<
@@ -104,9 +113,13 @@
> >
>
>
- >::type ));
+ >::type result_03;
+ BOOST_MIRROR_ASSERT(
+ result_03,
+ "All classes in list should be from a not-nested namespace"
+ );
- BOOST_MPL_ASSERT(( mpl::accumulate<
+ typedef mpl::accumulate<
some_classes,
mpl::true_,
mpl::and_<
@@ -115,19 +128,27 @@
BOOST_MIRRORED_CLASS(mpl::_2)
>
>
- >::type ));
+ >::type result_04;
+ BOOST_MIRROR_ASSERT(
+ result_04,
+ "Meta-classes for classes in list should be recognized"
+ );
- BOOST_MPL_ASSERT(( mpl::accumulate<
+ typedef mpl::accumulate<
some_classes,
mpl::true_,
mpl::and_<
mpl::_1,
- is_same<
+ ::boost::is_same<
get_reflected_type<BOOST_MIRRORED_CLASS(mpl::_2)>,
mpl::_2
>
>
- >::type ));
+ >::type result_05;
+ BOOST_MIRROR_ASSERT(
+ result_05,
+ "Base-level type and reflected type must be the same"
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/classes_ct_02.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_02.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_02.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -46,7 +46,6 @@
void test_main()
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
@@ -66,7 +65,7 @@
> some_classes;
// check the counts of own attributes
- BOOST_MPL_ASSERT(( mpl::accumulate<
+ typedef mpl::accumulate<
some_classes,
mpl::true_,
mpl::and_<
@@ -80,10 +79,14 @@
mpl::at<mpl::_2, mpl::int_<1> >
>
>
- >::type ));
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "The count of attributes must match the hardcoded values"
+ );
// check the counts of all attributes
- BOOST_MPL_ASSERT(( mpl::accumulate<
+ typedef mpl::accumulate<
some_classes,
mpl::true_,
mpl::and_<
@@ -97,7 +100,11 @@
mpl::at<mpl::_2, mpl::int_<2> >
>
>
- >::type ));
+ >::type result_02;
+ BOOST_MIRROR_ASSERT(
+ result_02,
+ "The count of attributes must match the hardcoded values"
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/classes_ct_03.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_03.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_03.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -17,6 +17,7 @@
// MPL_ASSERT
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/add_pointer.hpp>
//
#include <boost/mirror/meta_class.hpp>
#include <boost/mirror/intrinsic/at.hpp>
@@ -26,9 +27,41 @@
#include "./test.hpp"
+#define BOOST_MIRROR_TEST_CLASSES_CT_03_MSG \
+ "Reflected and real attribute type must match"
+
+namespace boost {
+namespace mirror {
+
+template <class MetaAttributes, class Position>
+struct add_pointer_to_type_at
+{
+ typedef typename add_pointer<
+ typename at<
+ MetaAttributes,
+ Position
+ >::type::type::reflected_type
+ >::type type;
+};
+
+} // mirror
+} // boost
+
+#define BOOST_MIRROR_TEST_CLASSES_CT_03(POSITION, ADDRESS) \
+ typedef is_same< \
+ add_pointer_to_type_at< \
+ meta_H::all_attributes, \
+ mpl::int_< POSITION > \
+ >::type, \
+ BOOST_TYPEOF(ADDRESS) \
+ >::type result_##POSITION; \
+ BOOST_MIRROR_ASSERT( \
+ result_##POSITION, \
+ BOOST_MIRROR_TEST_CLASSES_CT_03_MSG \
+ );
+
void test_main()
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
@@ -36,114 +69,32 @@
typedef BOOST_MIRRORED_CLASS(::test::H) meta_H;
//
//
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<0>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.a1)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<1>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.a2)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<2>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.a3)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<3>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.b1)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<4>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.b2)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<5>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.c1)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<6>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.c2)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<7>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.d1)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<8>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.d2)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<9>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.e)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<10>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.f1)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<11>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.f2)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<12>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.g1)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<13>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.g2)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<14>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.g3)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<15>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.h1)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<16>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.h2)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- at<
- meta_H::all_attributes, mpl::int_<17>
- >::type::type::reflected_type *,
- BOOST_TYPEOF(&h.h3)
- > ));
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 0, &h.a1)
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 1, &h.a2)
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 2, &h.a3)
+
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 3, &h.b1)
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 4, &h.b2)
+
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 5, &h.c1)
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 6, &h.c2)
+
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 7, &h.d1)
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 8, &h.d2)
+
+ BOOST_MIRROR_TEST_CLASSES_CT_03( 9, &h.e)
+
+ BOOST_MIRROR_TEST_CLASSES_CT_03(10, &h.f1)
+ BOOST_MIRROR_TEST_CLASSES_CT_03(11, &h.f2)
+
+ BOOST_MIRROR_TEST_CLASSES_CT_03(12, &h.g1)
+ BOOST_MIRROR_TEST_CLASSES_CT_03(13, &h.g2)
+ BOOST_MIRROR_TEST_CLASSES_CT_03(14, &h.g3)
+
+ BOOST_MIRROR_TEST_CLASSES_CT_03(15, &h.h1)
+ BOOST_MIRROR_TEST_CLASSES_CT_03(16, &h.h2)
+ BOOST_MIRROR_TEST_CLASSES_CT_03(17, &h.h3)
+
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/classes_ct_04.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_04.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_04.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -90,9 +90,12 @@
> attrib_types_3;
//
// and compare them
- BOOST_MPL_ASSERT(( mpl::equal<attrib_types_1, attrib_types_2> ));
- BOOST_MPL_ASSERT(( mpl::equal<attrib_types_2, attrib_types_3> ));
- BOOST_MPL_ASSERT(( mpl::equal<attrib_types_1, attrib_types_3> ));
+ typedef mpl::equal<attrib_types_1, attrib_types_2>::type result_01;
+ typedef mpl::equal<attrib_types_2, attrib_types_3>::type result_02;
+ typedef mpl::equal<attrib_types_1, attrib_types_3>::type result_03;
+ BOOST_MIRROR_ASSERT(result_01, "Sequences 1 and 2 must be equal");
+ BOOST_MIRROR_ASSERT(result_02, "Sequences 2 and 3 must be equal");
+ BOOST_MIRROR_ASSERT(result_03, "Sequences 1 and 3 must be equal");
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/classes_ct_05.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_05.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_05.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -77,9 +77,12 @@
> attrib_types_3;
//
// and compare them
- BOOST_MPL_ASSERT(( mpl::equal<attrib_types_1, attrib_types_2> ));
- BOOST_MPL_ASSERT(( mpl::equal<attrib_types_2, attrib_types_3> ));
- BOOST_MPL_ASSERT(( mpl::equal<attrib_types_1, attrib_types_3> ));
+ typedef mpl::equal<attrib_types_1, attrib_types_2>::type result_01;
+ typedef mpl::equal<attrib_types_2, attrib_types_3>::type result_02;
+ typedef mpl::equal<attrib_types_1, attrib_types_3>::type result_03;
+ BOOST_MIRROR_ASSERT(result_01, "Sequences 1 and 2 must be equal");
+ BOOST_MIRROR_ASSERT(result_02, "Sequences 2 and 3 must be equal");
+ BOOST_MIRROR_ASSERT(result_03, "Sequences 1 and 3 must be equal");
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/classes_ct_06.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_06.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_06.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -60,7 +60,7 @@
> some_classes;
// check the counts of base classes
- BOOST_MPL_ASSERT(( mpl::accumulate<
+ typedef mpl::accumulate<
some_classes,
mpl::true_,
mpl::and_<
@@ -74,7 +74,11 @@
mpl::at<mpl::_2, mpl::int_<1> >
>
>
- >::type ));
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "The count of base classes must match the hardcoded values"
+ );
}
Modified: sandbox/mirror/libs/mirror/test/classes_ct_07.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_07.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_07.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -311,13 +311,17 @@
//
// go through the list and execute
// the tests on each tuple <type, attribs, base_classes>
- BOOST_MPL_ASSERT((
- mpl::accumulate<
- classes_attribs_and_base_classes,
- mpl::true_,
- test_op
- >
- ));
+ typedef typename mpl::accumulate<
+ classes_attribs_and_base_classes,
+ mpl::true_,
+ test_op
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "The types of attributes and base classes must match "\
+ "the hardcoded values"
+ );
+
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/classes_ct_09.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_09.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_09.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -1,5 +1,5 @@
/**
- * \file test/namespaces_ct_05.cpp
+ * \file test/classes_ct_09.cpp
*
* This file is part of the Mirror library testsuite.
*
@@ -77,107 +77,196 @@
// if the global lists are not available, then mirror does not
// reflect namespace members
//
- BOOST_MPL_ASSERT( empty< meta_test::members<>::type > );
- BOOST_MPL_ASSERT_RELATION( size< meta_test::members<>::type >::value, ==, 0);
- BOOST_MPL_ASSERT((iterator_equal<
+ BOOST_MIRROR_ASSERT(
+ empty< meta_test::members<>::type >,
+ "The list of members of the test namespace should be empty"
+ );
+ BOOST_MIRROR_ASSERT_RELATION(
+ size< meta_test::members<>::type >::value,
+ ==,
+ 0,
+ "The count of members of the test namespace should be 0"
+ );
+ // check whether the imember terators returned by begin and end
+ // for the test namespace should be equal
+ typedef iterator_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT_NOT((iterator_not_equal<
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "Member iterators returned by begin<> and end<> "\
+ "for the test namespace should be equal"
+ );
+ // same as the previous check done in a different way
+ typedef iterator_not_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT((iterator_equal<
+ >::type result_02;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_02,
+ "Member iterators returned by begin<> and end<> "\
+ "for the test namespace should be equal"
+ );
+ //
+ // there should be no namespace among the members of test
+ typedef iterator_equal<
find_if<
meta_test::members<>::type,
mpl::lambda<reflects_namespace<mpl::_1> >::type
>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT((iterator_equal<
+ >::type result_03;
+ BOOST_MIRROR_ASSERT(
+ result_03,
+ "There should be no namespace among the members of test"
+ );
+ //
+ typedef iterator_equal<
find_if<
meta_test::members<>::type,
mpl::lambda<reflects_global_scope<mpl::_1> >::type
>::type,
end<meta_test::members<>::type>::type
- >));
+ >::type result_04;
+ BOOST_MIRROR_ASSERT(
+ result_04,
+ "There should be no member of test namespace identified "\
+ "as the global scope"
+ );
#else
- BOOST_MPL_ASSERT_NOT( empty< meta_test::members<>::type > );
- BOOST_MPL_ASSERT_RELATION(
+ BOOST_MIRROR_ASSERT_NOT(
+ empty< meta_test::members<>::type >,
+ "List of members of the test namespace should not be empty"
+ );
+ BOOST_MIRROR_ASSERT_RELATION(
size< meta_test::members<>::type >::value,
==,
- 10
+ 10,
+ "There should be 10 members in the test namespace"
);
typedef mpl::lambda<reflects_global_scope<mpl::_1> >::type filter_global_scope;
typedef mpl::lambda<reflects_namespace<mpl::_1> >::type filter_namespaces;
typedef mpl::lambda<reflects_type<mpl::_1> >::type filter_types;
//
- BOOST_MPL_ASSERT_RELATION(
+ BOOST_MIRROR_ASSERT_RELATION(
size< meta_test::members< filter_global_scope >::type >::value,
==,
- 0
+ 0,
+ "There should be 0 members identified as the global scope"
);
- BOOST_MPL_ASSERT_RELATION(
+ BOOST_MIRROR_ASSERT_RELATION(
size< meta_test::members< filter_namespaces >::type >::value,
==,
- 4
+ 4,
+ "There should be 4 nested namespaces in the test namespace"
);
- BOOST_MPL_ASSERT_RELATION(
+ BOOST_MIRROR_ASSERT_RELATION(
size< meta_test::members< filter_types >::type >::value,
==,
- 6
+ 6,
+ "There should be 6 types defined in the test namespace"
);
//
- BOOST_MPL_ASSERT((iterator_not_equal<
+ typedef iterator_not_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT_NOT((iterator_equal<
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "The meta-object iterators returned by begin<> and end<> "\
+ "should point to different elements"
+ );
+
+ typedef iterator_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
+ >::type result_02;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_02,
+ "The meta-object iterators returned by begin<> and end<> "\
+ "should not point to the same element"
+ );
//
- BOOST_MPL_ASSERT((iterator_not_equal<
+ typedef iterator_not_equal<
begin<meta_test::members<filter_types>::type>::type,
end<meta_test::members<filter_types>::type>::type
- >));
- BOOST_MPL_ASSERT_NOT((iterator_equal<
+ >::type result_03;
+ BOOST_MIRROR_ASSERT(
+ result_03,
+ "The meta-type iterators returned by begin<> and end<> "\
+ "should point to different elements"
+ );
+
+ typedef iterator_equal<
begin<meta_test::members<filter_types>::type>::type,
end<meta_test::members<filter_types>::type>::type
- >));
+ >::type result_04;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_04,
+ "The meta-type iterators returned by begin<> and end<> "\
+ "should not point to the same element"
+ );
//
- BOOST_MPL_ASSERT((iterator_not_equal<
+ typedef iterator_not_equal<
begin<meta_test::members<filter_namespaces>::type>::type,
end<meta_test::members<filter_namespaces>::type>::type
- >));
- BOOST_MPL_ASSERT_NOT((iterator_equal<
+ >::type result_05;
+ BOOST_MIRROR_ASSERT(
+ result_05,
+ "The meta-namespace iterators returned by begin<> and end<> "\
+ "should point to different elements"
+ );
+
+ typedef iterator_equal<
begin<meta_test::members<filter_namespaces>::type>::type,
end<meta_test::members<filter_namespaces>::type>::type
- >));
+ >::type result_06;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_06,
+ "The meta-namespace iterators returned by begin<> and end<> "\
+ "should not point to the same element"
+ );
//
- BOOST_MPL_ASSERT((iterator_equal<
+ typedef iterator_equal<
find_if<
- meta_test::members<>::type,
- mpl::lambda<reflects_namespace<mpl::_1> >::type
- >::type,
+ meta_test::members<>::type,
+ mpl::lambda<reflects_namespace<mpl::_1> >::type
+ >::type,
begin<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT((iterator_equal<
+ >::type result_07;
+ BOOST_MIRROR_ASSERT(
+ result_07,
+ "The first member of the test namespace should be "\
+ "a nested namespace"
+ );
+ //
+ typedef iterator_equal<
find_if<
- meta_test::members<>::type,
- mpl::lambda<reflects_global_scope<mpl::_1> >::type
- >::type,
+ meta_test::members<>::type,
+ mpl::lambda<reflects_global_scope<mpl::_1> >::type
+ >::type,
end<meta_test::members<>::type>::type
- >));
+ >::type result_08;
+ BOOST_MIRROR_ASSERT(
+ result_08,
+ "There should be no member of the test namespace "\
+ "identified as the global scope"
+ );
//
- BOOST_MPL_ASSERT((iterator_equal<
+ typedef iterator_equal<
find_if<
- meta_test::members<filter_types>::type,
- mpl::lambda<reflects_namespace<mpl::_1> >::type
- >::type,
+ meta_test::members<filter_types>::type,
+ mpl::lambda<reflects_namespace<mpl::_1> >::type
+ >::type,
end<meta_test::members<filter_types>::type>::type
- >));
+ >::type result_09;
+ BOOST_MIRROR_ASSERT(
+ result_09,
+ "There should be no namespace among the type members "\
+ "of the test namespace"
+ );
#endif
}
Modified: sandbox/mirror/libs/mirror/test/classes_ct_10.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_10.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_10.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -25,26 +25,32 @@
#include "./simple_classes.hpp"
#include "./test.hpp"
+template <class T1, class T2>
+void test_type_of_attribs(T1*, T2*)
+{
+ typedef typename ::boost::is_same<T1, T2>::type
+ types_are_same;
+
+ BOOST_MIRROR_ASSERT(
+ types_are_same,
+ "The attributes should have the same types"
+ );
+}
+
+template <class T>
+void test_type_of_attribs(T*, T*) { }
+
template <class MetaAttribute1, class MetaAttribute2>
void test_attribs(void)
{
- BOOST_MPL_ASSERT((
- is_same<
- MetaAttribute1::type::reflected_type,
- MetaAttribute2::type::reflected_type
- >
- ));
- BOOST_MPL_ASSERT((
- is_same<
- MetaAttribute1::scope::type::reflected_type,
- MetaAttribute2::scope::type::reflected_type
- >
- ));
+ test_type_of_attribs(
+ (typename MetaAttribute1::type::reflected_type*)0,
+ (typename MetaAttribute2::type::reflected_type*)0
+ );
}
void test_main()
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
@@ -122,7 +128,6 @@
by_name<meta_H::all_attributes>::h,
at<meta_H::all_attributes, mpl::int_<7> >::type
>();
-
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/classes_ct_11.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_ct_11.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_ct_11.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -29,18 +29,23 @@
template <class MetaAttribute1, class MetaAttribute2>
void test_attribs(void)
{
- BOOST_MPL_ASSERT((
- is_same<
- MetaAttribute1::type::reflected_type,
- MetaAttribute2::type::reflected_type
- >
- ));
- BOOST_MPL_ASSERT((
- is_same<
- MetaAttribute1::scope::type::reflected_type,
- MetaAttribute2::scope::type::reflected_type
- >
- ));
+ typedef typename ::boost::is_same<
+ typename MetaAttribute1::type::reflected_type,
+ typename MetaAttribute2::type::reflected_type
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "The attributes should have the same types"
+ );
+ //
+ typedef typename ::boost::is_same<
+ typename MetaAttribute1::scope::reflected_type,
+ typename MetaAttribute2::scope::reflected_type
+ >::type result_02;
+ BOOST_MIRROR_ASSERT(
+ result_02,
+ "The attributes should be declared in the same class"
+ );
}
void test_main()
@@ -58,7 +63,7 @@
>();
test_attribs<
by_name<meta_P::attributes>::second,
- at<meta_P::attributes, mpl::int_<0> >::type
+ at<meta_P::attributes, mpl::int_<1> >::type
>();
//
test_attribs<
Modified: sandbox/mirror/libs/mirror/test/classes_rt_09.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_rt_09.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_rt_09.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -77,7 +77,6 @@
void test_main()
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
Modified: sandbox/mirror/libs/mirror/test/classes_rt_10.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/classes_rt_10.cpp (original)
+++ sandbox/mirror/libs/mirror/test/classes_rt_10.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -174,7 +174,6 @@
void test_main()
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
Modified: sandbox/mirror/libs/mirror/test/concepts_ct_01.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/concepts_ct_01.cpp (original)
+++ sandbox/mirror/libs/mirror/test/concepts_ct_01.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -54,7 +54,11 @@
>
>::type all_passed;
//
- BOOST_MPL_ASSERT(( all_passed ));
+ BOOST_MIRROR_ASSERT(
+ all_passed,
+ "All tests must pass the test for compliance "\
+ "with the MetaType concept"
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/concepts_ct_02.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/concepts_ct_02.cpp (original)
+++ sandbox/mirror/libs/mirror/test/concepts_ct_02.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -97,7 +97,11 @@
>
>::type all_passed;
//
- BOOST_MPL_ASSERT(( all_passed ));
+ BOOST_MIRROR_ASSERT(
+ all_passed,
+ "All tests must pass the test for compliance "\
+ "with the MetaType concept"
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/concepts_ct_03.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/concepts_ct_03.cpp (original)
+++ sandbox/mirror/libs/mirror/test/concepts_ct_03.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -72,7 +72,11 @@
>
>::type all_passed;
//
- BOOST_MPL_ASSERT(( all_passed ));
+ BOOST_MIRROR_ASSERT(
+ all_passed,
+ "All tests must pass the test for compliance "\
+ "with the MetaType concept"
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/namespaces_ct_01.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/namespaces_ct_01.cpp (original)
+++ sandbox/mirror/libs/mirror/test/namespaces_ct_01.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -18,6 +18,9 @@
#include "./namespaces.hpp"
#include "./test.hpp"
+#define BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG\
+ "The meta-namespace should not reflect the global scope"
+
void test_main()
{
using namespace ::std;
@@ -35,11 +38,26 @@
typedef BOOST_MIRRORED_NAMESPACE(::test::feature) meta_ns_test_feature;
typedef BOOST_MIRRORED_NAMESPACE(::test::feature::detail) meta_ns_test_feature_detail;
//
- BOOST_MPL_ASSERT_NOT(( reflects_global_scope<meta_ns_test> ));
- BOOST_MPL_ASSERT_NOT(( reflects_global_scope<meta_ns_test_stuff> ));
- BOOST_MPL_ASSERT_NOT(( reflects_global_scope<meta_ns_test_stuff_detail> ));
- BOOST_MPL_ASSERT_NOT(( reflects_global_scope<meta_ns_test_feature> ));
- BOOST_MPL_ASSERT_NOT(( reflects_global_scope<meta_ns_test_feature_detail> ));
+ BOOST_MIRROR_ASSERT_NOT(
+ reflects_global_scope<meta_ns_test>,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG
+ );
+ BOOST_MIRROR_ASSERT_NOT(
+ reflects_global_scope<meta_ns_test_stuff>,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG
+ );
+ BOOST_MIRROR_ASSERT_NOT(
+ reflects_global_scope<meta_ns_test_stuff_detail>,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG
+ );
+ BOOST_MIRROR_ASSERT_NOT(
+ reflects_global_scope<meta_ns_test_feature>,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG
+ );
+ BOOST_MIRROR_ASSERT_NOT(
+ reflects_global_scope<meta_ns_test_feature_detail>,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/namespaces_ct_02.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/namespaces_ct_02.cpp (original)
+++ sandbox/mirror/libs/mirror/test/namespaces_ct_02.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -10,13 +10,15 @@
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
-#include <boost/mpl/assert.hpp>
// namespace registering
#include <boost/mirror/traits/reflects_namespace.hpp>
//
#include "./namespaces.hpp"
#include "./test.hpp"
+#define BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG \
+ "The meta-object must reflect a namespace"
+
void test_main()
{
using namespace ::std;
@@ -32,12 +34,30 @@
typedef BOOST_MIRRORED_NAMESPACE(::test::feature::detail) meta_ns_test_feature_detail;
//
//
- BOOST_MPL_ASSERT(( reflects_namespace<meta_gs> ));
- BOOST_MPL_ASSERT(( reflects_namespace<meta_ns_test> ));
- BOOST_MPL_ASSERT(( reflects_namespace<meta_ns_test_stuff> ));
- BOOST_MPL_ASSERT(( reflects_namespace<meta_ns_test_stuff_detail> ));
- BOOST_MPL_ASSERT(( reflects_namespace<meta_ns_test_feature> ));
- BOOST_MPL_ASSERT(( reflects_namespace<meta_ns_test_feature_detail> ));
+ BOOST_MIRROR_ASSERT(
+ reflects_namespace<meta_gs>,
+ BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_namespace<meta_ns_test>,
+ BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_namespace<meta_ns_test_stuff>,
+ BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_namespace<meta_ns_test_stuff_detail>,
+ BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_namespace<meta_ns_test_feature>,
+ BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_namespace<meta_ns_test_feature_detail>,
+ BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/namespaces_ct_04.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/namespaces_ct_04.cpp (original)
+++ sandbox/mirror/libs/mirror/test/namespaces_ct_04.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -20,51 +20,68 @@
#include "./namespaces.hpp"
#include "./test.hpp"
+#define BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_1(TYPE) \
+ "The " #TYPE " type should be defined on the global scope"
+
+#define BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(TYPE) \
+ BOOST_MIRROR_ASSERT( \
+ reflects_namespace< \
+ BOOST_MIRRORED_TYPE(TYPE) :: scope \
+ >::type, \
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_1(TYPE) \
+ );
+
+#define BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2(MODAL) \
+ "The types " MODAL " be defined in the same scope"
+
void test_main()
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
- BOOST_STATIC_ASSERT( reflects_namespace<
- BOOST_MIRRORED_TYPE(bool) :: scope
- >::value );
- BOOST_STATIC_ASSERT( reflects_namespace<
- BOOST_MIRRORED_TYPE(char) :: scope
- >::value );
- BOOST_STATIC_ASSERT( reflects_namespace<
- BOOST_MIRRORED_TYPE(int) :: scope
- >::value );
- BOOST_STATIC_ASSERT( reflects_namespace<
- BOOST_MIRRORED_TYPE(double) :: scope
- >::value );
- BOOST_STATIC_ASSERT( reflects_namespace<
- BOOST_MIRRORED_TYPE(void*) :: scope
- >::value );
- BOOST_STATIC_ASSERT( reflects_namespace<
- BOOST_MIRRORED_TYPE(int const * const *) :: scope
- >::value );
- BOOST_STATIC_ASSERT( reflects_namespace<
- BOOST_MIRRORED_TYPE(char volatile * const &) :: scope
- >::value );
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(bool)
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(char)
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(int)
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(double)
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(void*)
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(int const * const *)
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(char volatile * const &)
//
- BOOST_STATIC_ASSERT(( is_same<
- BOOST_MIRRORED_TYPE(const char* []) :: scope,
- BOOST_MIRRORED_TYPE(int volatile &) :: scope
- >::value ));
-
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPEDEF(::boost::cts, bchar) :: scope,
- BOOST_MIRRORED_TYPEDEF(::boost::cts, bstring) :: scope
- > ));
- BOOST_MPL_ASSERT_NOT((is_same<
- BOOST_MIRRORED_TYPEDEF(::boost::cts, bchar) :: scope,
- BOOST_MIRRORED_TYPE(char) :: scope
- > ));
- BOOST_MPL_ASSERT_NOT(( is_same<
- BOOST_MIRRORED_TYPEDEF(::boost::cts, bchar) :: scope,
- BOOST_MIRRORED_TYPE(wchar_t) :: scope
- > ));
+ typedef is_same<
+ BOOST_MIRRORED_TYPE(const char* []) :: scope,
+ BOOST_MIRRORED_TYPE(int volatile &) :: scope
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should")
+ );
+
+ typedef is_same<
+ BOOST_MIRRORED_TYPEDEF(::boost::cts, bchar) :: scope,
+ BOOST_MIRRORED_TYPEDEF(::boost::cts, bstring) :: scope
+ >::type result_02;
+ BOOST_MIRROR_ASSERT(
+ result_02,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should")
+ );
+
+ typedef is_same<
+ BOOST_MIRRORED_TYPEDEF(::boost::cts, bchar) :: scope,
+ BOOST_MIRRORED_TYPE(char) :: scope
+ >::type result_03;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_03,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should not")
+ );
+
+ typedef is_same<
+ BOOST_MIRRORED_TYPEDEF(::boost::cts, bchar) :: scope,
+ BOOST_MIRRORED_TYPE(wchar_t) :: scope
+ >::type result_04;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_04,
+ BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should not")
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/namespaces_ct_05.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/namespaces_ct_05.cpp (original)
+++ sandbox/mirror/libs/mirror/test/namespaces_ct_05.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -12,7 +12,6 @@
#include <boost/type_traits/is_same.hpp>
// assert
-#include <boost/mpl/assert.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/accumulate.hpp>
#include <boost/mpl/vector.hpp>
@@ -78,30 +77,60 @@
// if the global lists are not available, then mirror does not
// reflect namespace members
//
- BOOST_MPL_ASSERT( empty< meta_test::members<>::type > );
- BOOST_MPL_ASSERT_RELATION( size< meta_test::members<>::type >::value, ==, 0);
- BOOST_MPL_ASSERT((iterator_equal<
+ BOOST_MIRROR_ASSERT(
+ empty< meta_test::members<>::type >::type,
+ "The list of members of the ::test namespace should be empty"
+ );
+
+ BOOST_MIRROR_ASSERT_RELATION(
+ size< meta_test::members<>::type >::value,
+ ==,
+ 0,
+ "The count of members of the ::test namespace should be 0"
+ );
+
+ typedef iterator_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT_NOT((iterator_not_equal<
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "The iterators returned by begin<> and end<> should be equal"
+ );
+
+ typedef iterator_not_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT((iterator_equal<
+ >::type result_02;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_02,
+ "The iterators returned by begin<> and end<> should "\
+ "not be different"
+ );
+
+ typedef iterator_equal<
find_if<
- meta_test::members<>::type,
- mpl::lambda<reflects_namespace<mpl::_1> >::type
- >::type,
- end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT((iterator_equal<
+ meta_test::members<>::type,
+ mpl::lambda<reflects_namespace<mpl::_1> >::type
+ >::type,
+ end<meta_test::members<>::type>::type
+ >::type result_03;
+ BOOST_MIRROR_ASSERT(
+ result_03,
+ "There should be no namespace members in the ::test namespace"
+ );
+
+ typedef iterator_equal<
find_if<
- meta_test::members<>::type,
- mpl::lambda<reflects_global_scope<mpl::_1> >::type
- >::type,
- end<meta_test::members<>::type>::type
- >));
+ meta_test::members<>::type,
+ mpl::lambda<reflects_global_scope<mpl::_1> >::type
+ >::type,
+ end<meta_test::members<>::type>::type
+ >::type result_04;
+ BOOST_MIRROR_ASSERT(
+ result_04,
+ "There should be no type members in the ::test namespace"
+ );
#else
typedef mpl::vector<
mpl::vector2<BOOST_MIRRORED_NAMESPACE(::test::a), mpl::int_<0> >,
@@ -123,51 +152,84 @@
>
>::type meta_namespaces;
- BOOST_MPL_ASSERT_NOT( empty< meta_test::members<>::type > );
- BOOST_MPL_ASSERT_RELATION(
+ BOOST_MIRROR_ASSERT_NOT(
+ empty< meta_test::members<>::type >::type,
+ "The list of members of the ::test namespace should not "\
+ "be empty"
+ );
+
+ BOOST_MIRROR_ASSERT_RELATION(
size< meta_test::members<>::type >::value,
==,
- 8
+ 8,
+ "There should be 8 members in the ::test namespace"
);
- BOOST_MPL_ASSERT((
- mpl::accumulate<
- meta_namespaces_and_indices,
- mpl::true_,
- mpl::and_<
- mpl::_1,
- is_same<
- at<
- meta_test::members<>::type,
- mpl::back<mpl::_2>
- >,
- mpl::front<mpl::_2>
- >
+
+ typedef mpl::accumulate<
+ meta_namespaces_and_indices,
+ mpl::true_,
+ mpl::and_<
+ mpl::_1,
+ is_same<
+ at<
+ meta_test::members<>::type,
+ mpl::back<mpl::_2>
+ >,
+ mpl::front<mpl::_2>
>
>
- ));
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "The position of the members in the ::test namespace "\
+ "should match the hardcoded order"
+ );
//
- BOOST_MPL_ASSERT((iterator_not_equal<
+ typedef iterator_not_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT_NOT((iterator_equal<
+ >::type result_02;
+ BOOST_MIRROR_ASSERT(
+ result_02,
+ "The iterators returned by begin<> and end<> on the list "\
+ "of members of the ::test namespace should be different"
+ );
+ //
+ typedef iterator_equal<
begin<meta_test::members<>::type>::type,
end<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT((iterator_equal<
+ >::type result_03;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_03,
+ "The iterators returned by begin<> and end<> on the list "\
+ "of members of the ::test namespace should not be equal"
+ );
+ //
+ typedef iterator_equal<
find_if<
- meta_test::members<>::type,
- mpl::lambda<reflects_namespace<mpl::_1> >::type
- >::type,
+ meta_test::members<>::type,
+ mpl::lambda<reflects_namespace<mpl::_1> >::type
+ >::type,
begin<meta_test::members<>::type>::type
- >));
- BOOST_MPL_ASSERT((iterator_equal<
+ >::type result_04;
+ BOOST_MIRROR_ASSERT(
+ result_04,
+ "The first member of the ::test namespace should "\
+ "be a namespace"
+ );
+ //
+ typedef iterator_equal<
find_if<
- meta_test::members<>::type,
- mpl::lambda<reflects_global_scope<mpl::_1> >::type
- >::type,
- end<meta_test::members<>::type>::type
- >));
+ meta_test::members<>::type,
+ mpl::lambda<reflects_global_scope<mpl::_1> >::type
+ >::type,
+ end<meta_test::members<>::type>::type
+ >::type result_05;
+ BOOST_MIRROR_ASSERT(
+ result_05,
+ "There should not be any member in the ::test namespace "\
+ "identified as the global scope"
+ );
#endif
}
Modified: sandbox/mirror/libs/mirror/test/other_ct_01.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/other_ct_01.cpp (original)
+++ sandbox/mirror/libs/mirror/test/other_ct_01.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -65,7 +65,6 @@
int main(void)
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
Modified: sandbox/mirror/libs/mirror/test/test.hpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/test.hpp (original)
+++ sandbox/mirror/libs/mirror/test/test.hpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -12,8 +12,37 @@
#define BOOST_MIRROR_LIBS_MIRROR_TEST_TEST_HPP
#include <boost/test/unit_test.hpp>
+#include <boost/config.hpp>
+
+#ifdef BOOST_NO_STATIC_ASSERT
+#include <boost/mpl/assert.hpp>
+#endif
using namespace ::boost::unit_test;
+#ifdef BOOST_NO_STATIC_ASSERT
+
+#define BOOST_MIRROR_ASSERT(EXPR, ERROR_MSG) \
+ BOOST_MPL_ASSERT(EXPR)
+
+#define BOOST_MIRROR_ASSERT_NOT(EXPR, ERROR_MSG) \
+ BOOST_MPL_ASSERT_NOT(EXPR)
+
+#define BOOST_MIRROR_ASSERT_RELATION(LEFT, REL, RIGHT, ERROR_MSG)\
+ BOOST_MPL_ASSERT_RELATION(LEFT, REL, RIGHT)
+
+#else
+
+#define BOOST_MIRROR_ASSERT(EXPR, ERROR_MSG) \
+ static_assert(EXPR :: value, ERROR_MSG)
+
+#define BOOST_MIRROR_ASSERT_NOT(EXPR, ERROR_MSG) \
+ static_assert(!EXPR :: value, ERROR_MSG)
+
+#define BOOST_MIRROR_ASSERT_RELATION(LEFT, REL, RIGHT, ERROR_MSG)\
+ static_assert(LEFT REL RIGHT, ERROR_MSG)
+
+#endif
+
#endif // include guard
Modified: sandbox/mirror/libs/mirror/test/types_ct_01.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/types_ct_01.cpp (original)
+++ sandbox/mirror/libs/mirror/test/types_ct_01.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -24,9 +24,11 @@
#include "./types.hpp"
#include "./test.hpp"
+#define BOOST_MIRROR_TEST_TYPES_CT_01_MSG \
+ "The reflected and the real type must be the same"
+
void test_main()
{
- using namespace ::std;
using namespace ::boost;
using namespace ::boost::mirror;
//
@@ -36,26 +38,56 @@
typedef BOOST_MIRRORED_TYPE(::test::feature::foo) meta_test_feature_foo;
typedef BOOST_MIRRORED_TYPE(baz) meta_baz;
//
- BOOST_MPL_ASSERT_NOT(( is_same<meta_int, meta_std_string> ));
- BOOST_MPL_ASSERT(( reflects_global_scope<meta_int::scope> ));
- BOOST_MPL_ASSERT(( reflects_namespace<meta_std_string::scope > ));
- BOOST_MPL_ASSERT_NOT(( reflects_global_scope<meta_std_string::scope> ));
- BOOST_MPL_ASSERT(( reflects_global_scope<meta_std_string::scope::scope> ));
- //
- BOOST_MPL_ASSERT(( is_same<meta_int::reflected_type, int> ));
- BOOST_MPL_ASSERT(( is_same<meta_std_string::reflected_type, ::std::string> ));
- BOOST_MPL_ASSERT(( is_same<
- meta_boost_cts_bstring::reflected_type,
+ typedef is_same<meta_int, meta_std_string>::type result_00;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_00,
+ "Meta types reflecting an int and a ::std::string "\
+ "should no be the same"
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_global_scope<meta_int::scope>::type,
+ "The int type should be the member of the global scope"
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_namespace<meta_std_string::scope>,
+ "The scope of ::std::string should be a namespace"
+ );
+ BOOST_MIRROR_ASSERT_NOT(
+ reflects_global_scope<meta_std_string::scope>,
+ "The scope of ::std::string should not be the global scope"
+ );
+ BOOST_MIRROR_ASSERT(
+ reflects_global_scope<meta_std_string::scope::scope>,
+ "::std::string should be defined in a namespace defined "\
+ "directly in the global scope"
+ );
+ //
+ typedef is_same<meta_int::reflected_type, int>::type result_01;
+ BOOST_MIRROR_ASSERT(result_01, BOOST_MIRROR_TEST_TYPES_CT_01_MSG);
+ //
+ typedef is_same<
+ meta_std_string::reflected_type,
+ ::std::string
+ >::type result_02;
+ BOOST_MIRROR_ASSERT(result_02, BOOST_MIRROR_TEST_TYPES_CT_01_MSG);
+ //
+ typedef is_same<
+ meta_boost_cts_bstring::reflected_type,
::boost::cts::bstring
- > ));
- BOOST_MPL_ASSERT(( is_same<
- meta_test_feature_foo::reflected_type,
- ::test::feature::foo
- > ));
- BOOST_MPL_ASSERT(( is_same<
- meta_baz::reflected_type,
- baz
- > ));
+ >::type result_03;
+ BOOST_MIRROR_ASSERT(result_03, BOOST_MIRROR_TEST_TYPES_CT_01_MSG);
+ //
+ typedef is_same<
+ meta_test_feature_foo::reflected_type,
+ ::test::feature::foo
+ >::type result_04;
+ BOOST_MIRROR_ASSERT(result_04, BOOST_MIRROR_TEST_TYPES_CT_01_MSG);
+ //
+ typedef is_same<
+ meta_baz::reflected_type,
+ baz
+ >::type result_05;
+ BOOST_MIRROR_ASSERT(result_05, BOOST_MIRROR_TEST_TYPES_CT_01_MSG);
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/types_ct_03.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/types_ct_03.cpp (original)
+++ sandbox/mirror/libs/mirror/test/types_ct_03.cpp 2009-04-16 11:25:41 EDT (Thu, 16 Apr 2009)
@@ -55,30 +55,39 @@
double
> some_types;
- BOOST_MPL_ASSERT(( mpl::accumulate<
- some_types,
- mpl::true_,
- mpl::and_<
- mpl::_1,
- mirror::reflects_global_scope<
- get_scope<
- BOOST_MIRRORED_TYPE(mpl::_2)
- >
- >
- >
- >::type ));
-
- BOOST_MPL_ASSERT(( mpl::accumulate<
- some_types,
- mpl::true_,
- mpl::and_<
- mpl::_1,
- is_same<
- get_reflected_type<BOOST_MIRRORED_TYPE(mpl::_2)>,
- mpl::_2
- >
- >
- >::type ));
+ typedef mpl::accumulate<
+ some_types,
+ mpl::true_,
+ mpl::and_<
+ mpl::_1,
+ mirror::reflects_global_scope<
+ get_scope<
+ BOOST_MIRRORED_TYPE(mpl::_2)
+ >
+ >
+ >
+ >::type result_01;
+ BOOST_MIRROR_ASSERT(
+ result_01,
+ "All types in list should be declared in the global scope"
+ );
+
+ typedef mpl::accumulate<
+ some_types,
+ mpl::true_,
+ mpl::and_<
+ mpl::_1,
+ is_same<
+ get_reflected_type<BOOST_MIRRORED_TYPE(mpl::_2)>,
+ mpl::_2
+ >
+ >
+ >::type result_02;
+ BOOST_MIRROR_ASSERT(
+ result_02,
+ "The reflected type and the real type must match for all "\
+ "types in the list"
+ );
typedef mpl::vector<
::std::string,
@@ -86,18 +95,23 @@
BOOST_MIRROR_TYPEDEF(::boost::cts, bstring)
> other_types;
- BOOST_MPL_ASSERT_NOT(( mpl::accumulate<
- other_types,
- mpl::false_,
- mpl::or_<
- mpl::_1,
- mirror::reflects_global_scope<
- get_scope<
- BOOST_MIRRORED_TYPE(mpl::_2)
- >
- >
- >
- >::type ));
+ typedef mpl::accumulate<
+ other_types,
+ mpl::false_,
+ mpl::or_<
+ mpl::_1,
+ mirror::reflects_global_scope<
+ get_scope<
+ BOOST_MIRRORED_TYPE(mpl::_2)
+ >
+ >
+ >
+ >::type result_03;
+ BOOST_MIRROR_ASSERT_NOT(
+ result_03,
+ "None of the types in the list should be declared "\
+ "in the global scope"
+ );
}
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