|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52450 - in sandbox/mirror: boost/mirror/detail libs/mirror/example/algorithms libs/mirror/example/registering libs/mirror/example/special libs/mirror/test
From: chochlik_at_[hidden]
Date: 2009-04-17 13:44:35
Author: matus.chochlik
Date: 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
New Revision: 52450
URL: http://svn.boost.org/trac/boost/changeset/52450
Log:
[mirror 0.4.x]
- fixed a bug in the class generators implementation
- fixed several minor bugs in the testsuite
- now the tests pass with g++ 4.5.0 in c++0x mode
Text files modified:
sandbox/mirror/boost/mirror/detail/meta_all_attribs_base.hpp | 2
sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp | 2
sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp | 9 ---
sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp | 19 ++++---
sandbox/mirror/libs/mirror/test/classes_ct_01.cpp | 10 ++--
sandbox/mirror/libs/mirror/test/classes_ct_02.cpp | 4
sandbox/mirror/libs/mirror/test/classes_ct_03.cpp | 15 ++---
sandbox/mirror/libs/mirror/test/classes_ct_04.cpp | 6 +-
sandbox/mirror/libs/mirror/test/classes_ct_05.cpp | 6 +-
sandbox/mirror/libs/mirror/test/classes_ct_06.cpp | 33 ++++++------
sandbox/mirror/libs/mirror/test/classes_ct_07.cpp | 4
sandbox/mirror/libs/mirror/test/classes_ct_09.cpp | 30 ++++++------
sandbox/mirror/libs/mirror/test/classes_ct_10.cpp | 2
sandbox/mirror/libs/mirror/test/classes_ct_11.cpp | 4
sandbox/mirror/libs/mirror/test/concepts_ct_01.cpp | 2
sandbox/mirror/libs/mirror/test/concepts_ct_02.cpp | 2
sandbox/mirror/libs/mirror/test/concepts_ct_03.cpp | 2
sandbox/mirror/libs/mirror/test/namespaces_ct_01.cpp | 10 ++--
sandbox/mirror/libs/mirror/test/namespaces_ct_02.cpp | 12 ++--
sandbox/mirror/libs/mirror/test/namespaces_ct_04.cpp | 12 ++--
sandbox/mirror/libs/mirror/test/namespaces_ct_05.cpp | 22 ++++----
sandbox/mirror/libs/mirror/test/other_rt_02.cpp | 9 ++-
sandbox/mirror/libs/mirror/test/test.hpp | 74 +++++++++++++++++++++++++++--
sandbox/mirror/libs/mirror/test/types_ct_01.cpp | 20 ++++----
sandbox/mirror/libs/mirror/test/types_ct_02.cpp | 99 ++++++++++++++++++++++++++-------------
sandbox/mirror/libs/mirror/test/types_ct_03.cpp | 6 +-
sandbox/mirror/libs/mirror/test/types_ct_05.cpp | 52 ++++++++++----------
sandbox/mirror/libs/mirror/test/visitors_02.cpp | 7 +-
28 files changed, 282 insertions(+), 193 deletions(-)
Modified: sandbox/mirror/boost/mirror/detail/meta_all_attribs_base.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/meta_all_attribs_base.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/meta_all_attribs_base.hpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -601,7 +601,7 @@
BOOST_TYPEOF_NESTED_TYPEDEF_TPL(
detail,
(ancestor::attributes::template get_generator_plugin<
- MetaClassAttributes,
+ typename ancestor::attributes,
MetaFunction
>(position(), UnitKindSelector()))
)
Modified: sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp (original)
+++ sandbox/mirror/libs/mirror/example/algorithms/begin_end.cpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -62,7 +62,7 @@
int main(void)
{
- using namespace ::std;
+ using ::std::endl;
using namespace ::boost;
using namespace ::boost::mirror;
//
Modified: sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp (original)
+++ sandbox/mirror/libs/mirror/example/registering/virtual_bases.cpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -196,7 +196,7 @@
int main(void)
{
- using namespace ::std;
+ using ::std::endl;
using namespace ::boost;
using namespace ::boost::mirror;
//
@@ -262,13 +262,6 @@
reflects_virtual_inheritance< mpl::at<BOOST_MIRRORED_CLASS(E)::base_classes::list, mpl::int_<2> >::type >
));
//
- //BOOST_MIRRORED_CLASS(B)::all_attributes::detail::list_of_base_class_infos huuh = "1223";
- //BOOST_MIRRORED_CLASS(B)::all_attributes::detail::list_of_regular_base_classes huuh = "1223";
- //BOOST_MIRRORED_CLASS(B)::all_attributes::detail::list_of_virtual_base_classes huuh = "1223";
- //BOOST_MIRRORED_CLASS(B)::all_attributes::detail::regular_base_class_layout huuh = "1223";
- //BOOST_MIRRORED_CLASS(B)::all_attributes::detail::virtual_base_class_layout_w_dups huuh = "1223";
- //BOOST_MIRRORED_CLASS(B)::all_attributes::detail::virtual_base_class_layout huuh = "1223";
- //BOOST_MIRRORED_CLASS(E)::all_attributes::detail::base_class_layout huuh = "1223";
//
BOOST_MPL_ASSERT((
reflects_virtual_inheritance<
Modified: sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp (original)
+++ sandbox/mirror/libs/mirror/example/special/boost_tuple.cpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -84,13 +84,13 @@
typedef A D[2][3];
typedef ::boost::optional< ::boost::any> Z;
typedef ::boost::variant< A, B, C&, D> V;
- typedef tuple<int, double, const string *> T1;
- typedef tuple<const A, volatile B, C&, D, V, Z> T2;
+ typedef ::boost::tuple<int, double, const string *> T1;
+ typedef ::boost::tuple<const A, volatile B, C&, D, V, Z> T2;
typedef pair<T1, T2> T3;
- typedef tuple<void*, const wstring& , const string&> T4;
- typedef tuple<char, wchar_t, short int const> T5;
+ typedef ::boost::tuple<void*, const wstring& , const string&> T4;
+ typedef ::boost::tuple<char, wchar_t, short int const> T5;
typedef pair<T4, T5> T6;
- typedef vector<tuple<T1, T2, T3, T4, T5, T6> > T7;
+ typedef vector< ::boost::tuple<T1, T2, T3, T4, T5, T6> > T7;
typedef set<map<list<T1>, T7> > T;
//
typedef BOOST_MIRRORED_CLASS(T) meta_T;
@@ -136,17 +136,20 @@
bcout << "---------------------------------------------------" << endl;
reverse_for_each<meta_X::attributes>(p);
bcout << "---------------------------------------------------" << endl;
- for_each<meta_X::attributes>(cref(select_base_name()), cref(str_printer()));
+ for_each<meta_X::attributes>(
+ ::boost::cref(select_base_name()),
+ ::boost::cref(str_printer())
+ );
bcout << "---------------------------------------------------" << endl;
for_each<
begin<meta_X::attributes>::type,
end<meta_X::attributes>::type
- >(cref(select_full_name()), cref(str_printer()));
+ >(::boost::cref(select_full_name()), ::boost::cref(str_printer()));
bcout << "---------------------------------------------------" << endl;
reverse_for_each<
begin<meta_X::attributes>::type,
end<meta_X::attributes>::type
- >(cref(select_base_name()), cref(str_printer()));
+ >(::boost::cref(select_base_name()), ::boost::cref(str_printer()));
bcout << "---------------------------------------------------" << endl;
bcout << "Finished" << endl;
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -79,7 +79,7 @@
>
>::type result_01;
BOOST_MIRROR_ASSERT_NOT(
- result_01,
+ (result_01),
"No class in list should be from the global scope"
);
@@ -98,7 +98,7 @@
>
>::type result_02;
BOOST_MIRROR_ASSERT(
- result_02,
+ (result_02),
"All classes in list should be from a named namespace"
);
@@ -115,7 +115,7 @@
>
>::type result_03;
BOOST_MIRROR_ASSERT(
- result_03,
+ (result_03),
"All classes in list should be from a not-nested namespace"
);
@@ -130,7 +130,7 @@
>
>::type result_04;
BOOST_MIRROR_ASSERT(
- result_04,
+ (result_04),
"Meta-classes for classes in list should be recognized"
);
@@ -146,7 +146,7 @@
>
>::type result_05;
BOOST_MIRROR_ASSERT(
- result_05,
+ (result_05),
"Base-level type and reflected type must be the same"
);
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -81,7 +81,7 @@
>
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
"The count of attributes must match the hardcoded values"
);
@@ -102,7 +102,7 @@
>
>::type result_02;
BOOST_MIRROR_ASSERT(
- result_02,
+ (result_02),
"The count of attributes must match the hardcoded values"
);
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -48,15 +48,14 @@
} // 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, \
+ (is_same< \
+ add_pointer_to_type_at< \
+ meta_H::all_attributes, \
+ mpl::int_< POSITION > \
+ >::type, \
+ BOOST_TYPEOF(ADDRESS) \
+ >::type), \
BOOST_MIRROR_TEST_CLASSES_CT_03_MSG \
);
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -93,9 +93,9 @@
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");
+ 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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -80,9 +80,9 @@
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");
+ 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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -15,7 +15,6 @@
*/
// MPL
-#include <boost/mpl/assert.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/front.hpp>
@@ -60,23 +59,23 @@
> some_classes;
// check the counts of base classes
- typedef mpl::accumulate<
- some_classes,
- mpl::true_,
- mpl::and_<
- mpl::_1,
- mpl::equal_to<
- mirror::size< get_base_classes<
- BOOST_MIRRORED_CLASS(
- mpl::front<mpl::_2>
- )
- > >,
- mpl::at<mpl::_2, mpl::int_<1> >
- >
- >
- >::type result_01;
+
BOOST_MIRROR_ASSERT(
- result_01,
+ (mpl::accumulate<
+ some_classes,
+ mpl::true_,
+ mpl::and_<
+ mpl::_1,
+ mpl::equal_to<
+ mirror::size< get_base_classes<
+ BOOST_MIRRORED_CLASS(
+ mpl::front<mpl::_2>
+ )
+ > >,
+ mpl::at<mpl::_2, mpl::int_<1> >
+ >
+ >
+ >::type),
"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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -315,9 +315,9 @@
classes_attribs_and_base_classes,
mpl::true_,
test_op
- >::type result_01;
+ >::type result;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result),
"The types of attributes and base classes must match "\
"the hardcoded values"
);
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -78,7 +78,7 @@
// reflect namespace members
//
BOOST_MIRROR_ASSERT(
- empty< meta_test::members<>::type >,
+ (empty< meta_test::members<>::type >),
"The list of members of the test namespace should be empty"
);
BOOST_MIRROR_ASSERT_RELATION(
@@ -94,7 +94,7 @@
end<meta_test::members<>::type>::type
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
"Member iterators returned by begin<> and end<> "\
"for the test namespace should be equal"
);
@@ -104,7 +104,7 @@
end<meta_test::members<>::type>::type
>::type result_02;
BOOST_MIRROR_ASSERT_NOT(
- result_02,
+ (result_02),
"Member iterators returned by begin<> and end<> "\
"for the test namespace should be equal"
);
@@ -118,7 +118,7 @@
end<meta_test::members<>::type>::type
>::type result_03;
BOOST_MIRROR_ASSERT(
- result_03,
+ (result_03),
"There should be no namespace among the members of test"
);
//
@@ -130,13 +130,13 @@
end<meta_test::members<>::type>::type
>::type result_04;
BOOST_MIRROR_ASSERT(
- result_04,
+ (result_04),
"There should be no member of test namespace identified "\
"as the global scope"
);
#else
BOOST_MIRROR_ASSERT_NOT(
- empty< meta_test::members<>::type >,
+ (empty< meta_test::members<>::type >),
"List of members of the test namespace should not be empty"
);
BOOST_MIRROR_ASSERT_RELATION(
@@ -174,7 +174,7 @@
end<meta_test::members<>::type>::type
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
"The meta-object iterators returned by begin<> and end<> "\
"should point to different elements"
);
@@ -184,7 +184,7 @@
end<meta_test::members<>::type>::type
>::type result_02;
BOOST_MIRROR_ASSERT_NOT(
- result_02,
+ (result_02),
"The meta-object iterators returned by begin<> and end<> "\
"should not point to the same element"
);
@@ -194,7 +194,7 @@
end<meta_test::members<filter_types>::type>::type
>::type result_03;
BOOST_MIRROR_ASSERT(
- result_03,
+ (result_03),
"The meta-type iterators returned by begin<> and end<> "\
"should point to different elements"
);
@@ -204,7 +204,7 @@
end<meta_test::members<filter_types>::type>::type
>::type result_04;
BOOST_MIRROR_ASSERT_NOT(
- result_04,
+ (result_04),
"The meta-type iterators returned by begin<> and end<> "\
"should not point to the same element"
);
@@ -214,7 +214,7 @@
end<meta_test::members<filter_namespaces>::type>::type
>::type result_05;
BOOST_MIRROR_ASSERT(
- result_05,
+ (result_05),
"The meta-namespace iterators returned by begin<> and end<> "\
"should point to different elements"
);
@@ -224,7 +224,7 @@
end<meta_test::members<filter_namespaces>::type>::type
>::type result_06;
BOOST_MIRROR_ASSERT_NOT(
- result_06,
+ (result_06),
"The meta-namespace iterators returned by begin<> and end<> "\
"should not point to the same element"
);
@@ -237,7 +237,7 @@
begin<meta_test::members<>::type>::type
>::type result_07;
BOOST_MIRROR_ASSERT(
- result_07,
+ (result_07),
"The first member of the test namespace should be "\
"a nested namespace"
);
@@ -250,7 +250,7 @@
end<meta_test::members<>::type>::type
>::type result_08;
BOOST_MIRROR_ASSERT(
- result_08,
+ (result_08),
"There should be no member of the test namespace "\
"identified as the global scope"
);
@@ -263,7 +263,7 @@
end<meta_test::members<filter_types>::type>::type
>::type result_09;
BOOST_MIRROR_ASSERT(
- result_09,
+ (result_09),
"There should be no namespace among the type members "\
"of the test namespace"
);
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -32,7 +32,7 @@
types_are_same;
BOOST_MIRROR_ASSERT(
- types_are_same,
+ (types_are_same),
"The attributes should have the same types"
);
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -34,7 +34,7 @@
typename MetaAttribute2::type::reflected_type
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
"The attributes should have the same types"
);
//
@@ -43,7 +43,7 @@
typename MetaAttribute2::scope::reflected_type
>::type result_02;
BOOST_MIRROR_ASSERT(
- result_02,
+ (result_02),
"The attributes should be declared in the same class"
);
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -55,7 +55,7 @@
>::type all_passed;
//
BOOST_MIRROR_ASSERT(
- all_passed,
+ (all_passed),
"All tests must pass the test for compliance "\
"with the MetaType concept"
);
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -98,7 +98,7 @@
>::type all_passed;
//
BOOST_MIRROR_ASSERT(
- all_passed,
+ (all_passed),
"All tests must pass the test for compliance "\
"with the MetaType concept"
);
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -73,7 +73,7 @@
>::type all_passed;
//
BOOST_MIRROR_ASSERT(
- all_passed,
+ (all_passed),
"All tests must pass the test for compliance "\
"with the MetaType concept"
);
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -39,23 +39,23 @@
typedef BOOST_MIRRORED_NAMESPACE(::test::feature::detail) meta_ns_test_feature_detail;
//
BOOST_MIRROR_ASSERT_NOT(
- reflects_global_scope<meta_ns_test>,
+ (reflects_global_scope<meta_ns_test>),
BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG
);
BOOST_MIRROR_ASSERT_NOT(
- reflects_global_scope<meta_ns_test_stuff>,
+ (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>,
+ (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>,
+ (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>,
+ (reflects_global_scope<meta_ns_test_feature_detail>),
BOOST_MIRROR_TEST_NAMESPACES_CT_01_MSG
);
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -35,27 +35,27 @@
//
//
BOOST_MIRROR_ASSERT(
- reflects_namespace<meta_gs>,
+ (reflects_namespace<meta_gs>),
BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
);
BOOST_MIRROR_ASSERT(
- reflects_namespace<meta_ns_test>,
+ (reflects_namespace<meta_ns_test>),
BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
);
BOOST_MIRROR_ASSERT(
- reflects_namespace<meta_ns_test_stuff>,
+ (reflects_namespace<meta_ns_test_stuff>),
BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
);
BOOST_MIRROR_ASSERT(
- reflects_namespace<meta_ns_test_stuff_detail>,
+ (reflects_namespace<meta_ns_test_stuff_detail>),
BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
);
BOOST_MIRROR_ASSERT(
- reflects_namespace<meta_ns_test_feature>,
+ (reflects_namespace<meta_ns_test_feature>),
BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
);
BOOST_MIRROR_ASSERT(
- reflects_namespace<meta_ns_test_feature_detail>,
+ (reflects_namespace<meta_ns_test_feature_detail>),
BOOST_MIRROR_TEST_NAMESPACE_CT_02_MSG
);
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -25,9 +25,9 @@
#define BOOST_MIRROR_TEST_NAMESPACES_CT_04_TYPE_GS(TYPE) \
BOOST_MIRROR_ASSERT( \
- reflects_namespace< \
+ (reflects_namespace< \
BOOST_MIRRORED_TYPE(TYPE) :: scope \
- >::type, \
+ >), \
BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_1(TYPE) \
);
@@ -52,7 +52,7 @@
BOOST_MIRRORED_TYPE(int volatile &) :: scope
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should")
);
@@ -61,7 +61,7 @@
BOOST_MIRRORED_TYPEDEF(::boost::cts, bstring) :: scope
>::type result_02;
BOOST_MIRROR_ASSERT(
- result_02,
+ (result_02),
BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should")
);
@@ -70,7 +70,7 @@
BOOST_MIRRORED_TYPE(char) :: scope
>::type result_03;
BOOST_MIRROR_ASSERT_NOT(
- result_03,
+ (result_03),
BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should not")
);
@@ -79,7 +79,7 @@
BOOST_MIRRORED_TYPE(wchar_t) :: scope
>::type result_04;
BOOST_MIRROR_ASSERT_NOT(
- result_04,
+ (result_04),
BOOST_MIRROR_TEST_NAMESPACES_CT_04_MSG_2("should not")
);
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -78,7 +78,7 @@
// reflect namespace members
//
BOOST_MIRROR_ASSERT(
- empty< meta_test::members<>::type >::type,
+ (empty< meta_test::members<>::type >),
"The list of members of the ::test namespace should be empty"
);
@@ -94,7 +94,7 @@
end<meta_test::members<>::type>::type
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
"The iterators returned by begin<> and end<> should be equal"
);
@@ -103,7 +103,7 @@
end<meta_test::members<>::type>::type
>::type result_02;
BOOST_MIRROR_ASSERT_NOT(
- result_02,
+ (result_02),
"The iterators returned by begin<> and end<> should "\
"not be different"
);
@@ -116,7 +116,7 @@
end<meta_test::members<>::type>::type
>::type result_03;
BOOST_MIRROR_ASSERT(
- result_03,
+ (result_03),
"There should be no namespace members in the ::test namespace"
);
@@ -128,7 +128,7 @@
end<meta_test::members<>::type>::type
>::type result_04;
BOOST_MIRROR_ASSERT(
- result_04,
+ (result_04),
"There should be no type members in the ::test namespace"
);
#else
@@ -153,7 +153,7 @@
>::type meta_namespaces;
BOOST_MIRROR_ASSERT_NOT(
- empty< meta_test::members<>::type >::type,
+ (empty< meta_test::members<>::type >),
"The list of members of the ::test namespace should not "\
"be empty"
);
@@ -180,7 +180,7 @@
>
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
"The position of the members in the ::test namespace "\
"should match the hardcoded order"
);
@@ -190,7 +190,7 @@
end<meta_test::members<>::type>::type
>::type result_02;
BOOST_MIRROR_ASSERT(
- result_02,
+ (result_02),
"The iterators returned by begin<> and end<> on the list "\
"of members of the ::test namespace should be different"
);
@@ -200,7 +200,7 @@
end<meta_test::members<>::type>::type
>::type result_03;
BOOST_MIRROR_ASSERT_NOT(
- result_03,
+ (result_03),
"The iterators returned by begin<> and end<> on the list "\
"of members of the ::test namespace should not be equal"
);
@@ -213,7 +213,7 @@
begin<meta_test::members<>::type>::type
>::type result_04;
BOOST_MIRROR_ASSERT(
- result_04,
+ (result_04),
"The first member of the ::test namespace should "\
"be a namespace"
);
@@ -226,7 +226,7 @@
end<meta_test::members<>::type>::type
>::type result_05;
BOOST_MIRROR_ASSERT(
- result_05,
+ (result_05),
"There should not be any member in the ::test namespace "\
"identified as the global scope"
);
Modified: sandbox/mirror/libs/mirror/test/other_rt_02.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/other_rt_02.cpp (original)
+++ sandbox/mirror/libs/mirror/test/other_rt_02.cpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -110,8 +110,8 @@
mpl::vector2<selector_4, mpl::int_<6> >
> selectors_and_sizes;
- BOOST_MPL_ASSERT((
- mpl::accumulate<
+ BOOST_MIRROR_ASSERT(
+ (mpl::accumulate<
selectors_and_sizes,
mpl::true_,
mpl::and_<
@@ -125,8 +125,9 @@
mpl::at< mpl::_2, mpl::int_<1> >
>
>
- >::type
- ));
+ >::type),
+ "Sizes of the global lists must match the hardcoded values"
+ );
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -14,35 +14,95 @@
#include <boost/test/unit_test.hpp>
#include <boost/config.hpp>
+#define BOOST_MIRROR_ASSERT_USES_STATIC_ASSERT
+
#ifdef BOOST_NO_STATIC_ASSERT
+#ifdef BOOST_MIRROR_ASSERT_USES_STATIC_ASSERT
+#undef BOOST_MIRROR_ASSERT_USES_STATIC_ASSERT
+#endif
+#endif
+
+#ifndef BOOST_MIRROR_ASSERT_USES_STATIC_ASSERT
#include <boost/mpl/assert.hpp>
#endif
using namespace ::boost::unit_test;
-#ifdef BOOST_NO_STATIC_ASSERT
+namespace boost {
+namespace mirror {
+namespace test {
+
+#ifdef BOOST_MIRROR_ASSERT_USES_STATIC_ASSERT
+
+template <bool Result>
+struct assertion_result;
+
+template <>
+struct assertion_result<false>
+{
+ char x;
+};
+
+template <>
+struct assertion_result<true>
+{
+ double x;
+};
+
+typedef assertion_result<false> assertion_failed;
+typedef assertion_result<true> assertion_passed;
+
+static_assert(
+ sizeof(assertion_passed) != sizeof(assertion_failed),
+ "Internal error in the implementation of MIRROR_ASSERT"
+);
+
+template <class IntegralConstant>
+assertion_result<IntegralConstant::value>
+get_assertion_result(void (*) (IntegralConstant));
+
+#define BOOST_MIRROR_ASSERT_RESULT(EXPR, RESULT, ERROR_MSG) \
+ static_assert( \
+ sizeof(::boost::mirror::test::get_assertion_result(\
+ ( void (*) EXPR ) 0 \
+ )) == \
+ sizeof(::boost::mirror::test::assertion_result<RESULT>), \
+ ERROR_MSG \
+ )
#define BOOST_MIRROR_ASSERT(EXPR, ERROR_MSG) \
- BOOST_MPL_ASSERT(EXPR)
+ BOOST_MIRROR_ASSERT_RESULT( \
+ EXPR, \
+ true, \
+ ERROR_MSG \
+ )
#define BOOST_MIRROR_ASSERT_NOT(EXPR, ERROR_MSG) \
- BOOST_MPL_ASSERT_NOT(EXPR)
+ BOOST_MIRROR_ASSERT_RESULT( \
+ EXPR, \
+ false, \
+ ERROR_MSG \
+ )
#define BOOST_MIRROR_ASSERT_RELATION(LEFT, REL, RIGHT, ERROR_MSG)\
- BOOST_MPL_ASSERT_RELATION(LEFT, REL, RIGHT)
+ static_assert(LEFT REL RIGHT, ERROR_MSG)
#else
#define BOOST_MIRROR_ASSERT(EXPR, ERROR_MSG) \
- static_assert(EXPR :: value, ERROR_MSG)
+ BOOST_MPL_ASSERT(EXPR)
#define BOOST_MIRROR_ASSERT_NOT(EXPR, ERROR_MSG) \
- static_assert(!EXPR :: value, ERROR_MSG)
+ BOOST_MPL_ASSERT_NOT(EXPR)
#define BOOST_MIRROR_ASSERT_RELATION(LEFT, REL, RIGHT, ERROR_MSG)\
- static_assert(LEFT REL RIGHT, ERROR_MSG)
+ BOOST_MPL_ASSERT_RELATION(LEFT, REL, RIGHT)
#endif
+} // namespace test
+} // namespace mirror
+} // namespace boost
+
#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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -40,54 +40,54 @@
//
typedef is_same<meta_int, meta_std_string>::type result_00;
BOOST_MIRROR_ASSERT_NOT(
- result_00,
+ (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,
+ (reflects_global_scope<meta_int::scope>),
"The int type should be the member of the global scope"
);
BOOST_MIRROR_ASSERT(
- reflects_namespace<meta_std_string::scope>,
+ (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>,
+ (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>,
+ (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);
+ 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);
+ BOOST_MIRROR_ASSERT((result_02), BOOST_MIRROR_TEST_TYPES_CT_01_MSG);
//
typedef is_same<
meta_boost_cts_bstring::reflected_type,
::boost::cts::bstring
>::type result_03;
- BOOST_MIRROR_ASSERT(result_03, BOOST_MIRROR_TEST_TYPES_CT_01_MSG);
+ 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);
+ 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);
+ 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_02.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/types_ct_02.cpp (original)
+++ sandbox/mirror/libs/mirror/test/types_ct_02.cpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -11,7 +11,6 @@
*/
// MPL_ASSERT
-#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
//
#include <boost/mirror/meta_namespace.hpp>
@@ -26,38 +25,72 @@
{
using ::boost::is_same;
// usage without 'using ::boost::mirror'
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPE(int)::scope,
- BOOST_MIRRORED_GLOBAL_SCOPE()
- > ));
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPE(::std::string)::scope,
- BOOST_MIRRORED_NAMESPACE(::std)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPE(::boost::cts::bstring)::scope,
- BOOST_MIRRORED_NAMESPACE(::std)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPE_NS(::boost::cts, bstring)::scope,
- BOOST_MIRRORED_NAMESPACE(::std)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPEDEF(::boost::cts, bstring)::scope,
- BOOST_MIRRORED_NAMESPACE(::boost::cts)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPEDEF(::boost::cts, bstring)::scope::scope,
- BOOST_MIRRORED_NAMESPACE(::boost)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPE(::test::feature::detail::foo_impl)::scope,
- BOOST_MIRRORED_NAMESPACE(::test::feature::detail)
- > ));
- BOOST_MPL_ASSERT(( is_same<
- BOOST_MIRRORED_TYPE(::test::feature::foo)::scope::scope,
- BOOST_MIRRORED_NAMESPACE(::test)
- > ));
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPE(int)::scope,
+ BOOST_MIRRORED_GLOBAL_SCOPE()
+ >),
+ "The int type should be defined in the global scope"
+ );
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPE(::std::string)::scope,
+ BOOST_MIRRORED_NAMESPACE(::std)
+ >),
+ "The string type should be defined in the ::std namespace"
+ );
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPE(::boost::cts::bstring)::scope,
+ BOOST_MIRRORED_NAMESPACE(::std)
+ >),
+ "The bstring type should be defined in the ::std namespace"
+ );
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPE_NS(::boost::cts, bstring)::scope,
+ BOOST_MIRRORED_NAMESPACE(::std)
+ >),
+ "The bstring type should be defined in the ::std namespace"
+ );
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPEDEF(::boost::cts, bstring)::scope,
+ BOOST_MIRRORED_NAMESPACE(::boost::cts)
+ >),
+ "The bstring typedef should be defined "\
+ "in the ::boost::cts namespace"
+ );
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPEDEF(
+ ::boost::cts, bstring
+ )::scope::scope,
+ BOOST_MIRRORED_NAMESPACE(::boost)
+ >),
+ "The bstring typedef should be defined "\
+ "in a namespace nested in the ::boost namespace"
+ );
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPE(
+ ::test::feature::detail::foo_impl
+ )::scope,
+ BOOST_MIRRORED_NAMESPACE(::test::feature::detail)
+ >),
+ "The type foo_impl should be defined in the "\
+ "::test::feature::detail namespace"
+ );
+ BOOST_MIRROR_ASSERT(
+ (is_same<
+ BOOST_MIRRORED_TYPE(
+ ::test::feature::foo
+ )::scope::scope,
+ BOOST_MIRRORED_NAMESPACE(::test)
+ >),
+ "The 'foo' type should be defined in a namespace which "\
+ "is nested in the ::test namespace"
+ );
}
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-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -68,7 +68,7 @@
>
>::type result_01;
BOOST_MIRROR_ASSERT(
- result_01,
+ (result_01),
"All types in list should be declared in the global scope"
);
@@ -84,7 +84,7 @@
>
>::type result_02;
BOOST_MIRROR_ASSERT(
- result_02,
+ (result_02),
"The reflected type and the real type must match for all "\
"types in the list"
);
@@ -108,7 +108,7 @@
>
>::type result_03;
BOOST_MIRROR_ASSERT_NOT(
- result_03,
+ (result_03),
"None of the types in the list should be declared "\
"in the global scope"
);
Modified: sandbox/mirror/libs/mirror/test/types_ct_05.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/types_ct_05.cpp (original)
+++ sandbox/mirror/libs/mirror/test/types_ct_05.cpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -28,19 +28,19 @@
{
using namespace ::boost;
//
- BOOST_MPL_ASSERT(( is_same<
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(false || true)::reflected_type,
bool
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be bool");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF('c')::reflected_type,
char
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be char");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(L'w')::reflected_type,
wchar_t
- > ));
- BOOST_MPL_ASSERT(( mpl::or_<
+ > ), "The reflected type must be wchar_t");
+ BOOST_MIRROR_ASSERT(( mpl::or_<
is_same<
BOOST_MIRRORED_TYPEOF("a+b")::reflected_type,
const char [4]
@@ -49,8 +49,8 @@
BOOST_MIRRORED_TYPEOF("a+b")::reflected_type,
char [4]
>
- > ));
- BOOST_MPL_ASSERT(( mpl::or_<
+ > ), "The reflected type must be a char array");
+ BOOST_MIRROR_ASSERT(( mpl::or_<
is_same<
BOOST_MIRRORED_TYPEOF(L"v+w")::reflected_type,
const wchar_t [4]
@@ -59,41 +59,41 @@
BOOST_MIRRORED_TYPEOF(L"v+w")::reflected_type,
wchar_t [4]
>
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be a wchar_t array");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(1+2)::reflected_type,
int
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be an int");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(3L + 4L)::reflected_type,
long
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be a long int");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(5.0f + 6.0f)::reflected_type,
float
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be a float");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(7.0 + 8.0)::reflected_type,
double
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be a double");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(::std::string("x+y"))::reflected_type,
::std::string
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be a ::std::string");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(::std::wstring(L"x+y"))::reflected_type,
::std::wstring
- > ));
+ > ), "The reflected type must be a ::std::wstring");
//
const int i = 10;
- BOOST_MPL_ASSERT(( is_same<
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(&i)::reflected_type,
const int *
- > ));
- BOOST_MPL_ASSERT(( is_same<
+ > ), "The reflected type must be const int *");
+ BOOST_MIRROR_ASSERT(( is_same<
BOOST_MIRRORED_TYPEOF(&foo)::reflected_type,
int (*)(short, long)
- > ));
+ > ), "The reflected type must be int (*)(short, long)");
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
Modified: sandbox/mirror/libs/mirror/test/visitors_02.cpp
==============================================================================
--- sandbox/mirror/libs/mirror/test/visitors_02.cpp (original)
+++ sandbox/mirror/libs/mirror/test/visitors_02.cpp 2009-04-17 13:44:32 EDT (Fri, 17 Apr 2009)
@@ -77,9 +77,10 @@
void test_main()
{
- using namespace ::std;
- using namespace ::boost;
-
+ using ::std::pair;
+ using ::std::string;
+ using ::std::wstring;
+ using ::boost::make_tuple;
test_traversals(make_tuple(0,1,2,3,4,5,6,7,8,9));
test_traversals(pair<string, wstring>("ABC",L"DEF"));
}
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