| 1 | Index: D:/boost/boost.build/libs/serialization/test/Jamfile.v2
|
|---|
| 2 | ===================================================================
|
|---|
| 3 | --- D:/boost/boost.build/libs/serialization/test/Jamfile.v2 (revision 138381)
|
|---|
| 4 | +++ D:/boost/boost.build/libs/serialization/test/Jamfile.v2 (revision 138382)
|
|---|
| 5 | @@ -25,6 +25,14 @@
|
|---|
| 6 |
|
|---|
| 7 | BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;
|
|---|
| 8 |
|
|---|
| 9 | +lib dll_base_lib : dll_base.cpp : <link>shared ;
|
|---|
| 10 | +lib dll_derived2_lib
|
|---|
| 11 | + : dll_derived2.cpp
|
|---|
| 12 | + dll_base_lib
|
|---|
| 13 | + /boost/serialization//boost_serialization
|
|---|
| 14 | + : <link>shared
|
|---|
| 15 | + ;
|
|---|
| 16 | +
|
|---|
| 17 | test-suite "serialization" :
|
|---|
| 18 | [ test-bsl-run_files test_array : A ]
|
|---|
| 19 | [ test-bsl-run_files test_binary ]
|
|---|
| 20 | @@ -34,6 +42,7 @@
|
|---|
| 21 | [ test-bsl-run_files test_delete_pointer ]
|
|---|
| 22 | [ test-bsl-run_files test_deque : A ]
|
|---|
| 23 | # [ test-bsl-run_files test_derived ]
|
|---|
| 24 | + [ test-bsl-run test_dll_exported : : : dll_base_lib dll_derived2_lib ]
|
|---|
| 25 | [ test-bsl-run_files test_derived_class : A ]
|
|---|
| 26 | [ test-bsl-run_files test_derived_class_ptr : A ]
|
|---|
| 27 | [ test-bsl-run_files test_diamond ]
|
|---|
| 28 | Index: D:/boost/boost.build/libs/serialization/src/void_cast.cpp
|
|---|
| 29 | ===================================================================
|
|---|
| 30 | --- D:/boost/boost.build/libs/serialization/src/void_cast.cpp (revision 138381)
|
|---|
| 31 | +++ D:/boost/boost.build/libs/serialization/src/void_cast.cpp (revision 138382)
|
|---|
| 32 | @@ -40,6 +40,12 @@
|
|---|
| 33 | }
|
|---|
| 34 | };
|
|---|
| 35 |
|
|---|
| 36 | +struct void_caster_weak_equal : std::binary_function<const void_caster *, const void_caster *, bool> {
|
|---|
| 37 | + bool operator()(const void_caster * lhs, const void_caster * rhs) const {
|
|---|
| 38 | + return *lhs->m_base == *rhs->m_base && *lhs->m_derived == *rhs->m_derived;
|
|---|
| 39 | + }
|
|---|
| 40 | +};
|
|---|
| 41 | +
|
|---|
| 42 | typedef std::set<const void_caster *, void_caster_compare> set_type;
|
|---|
| 43 | typedef boost::serialization::singleton<set_type> void_caster_registry;
|
|---|
| 44 |
|
|---|
| 45 | @@ -218,8 +224,20 @@
|
|---|
| 46 | s.erase(it);
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | +set_type::const_iterator
|
|---|
| 50 | +find(
|
|---|
| 51 | + set_type const & s,
|
|---|
| 52 | + void_caster_argument const & ca)
|
|---|
| 53 | +{
|
|---|
| 54 | + set_type::const_iterator const it(s.find(&ca));
|
|---|
| 55 | + if (s.end() != it)
|
|---|
| 56 | + return it;
|
|---|
| 57 | + else
|
|---|
| 58 | + return std::find_if(
|
|---|
| 59 | + s.begin(), s.end(),
|
|---|
| 60 | + std::bind1st(void_caster_weak_equal(), &ca));
|
|---|
| 61 | +}
|
|---|
| 62 |
|
|---|
| 63 | -
|
|---|
| 64 | } // namespace void_cast_detail
|
|---|
| 65 |
|
|---|
| 66 | // Given a void *, assume that it really points to an instance of one type
|
|---|
| 67 | @@ -242,7 +260,7 @@
|
|---|
| 68 | void_cast_detail::void_caster_argument ca(& derived, & base);
|
|---|
| 69 |
|
|---|
| 70 | void_cast_detail::set_type::const_iterator it;
|
|---|
| 71 | - it = s.find(& ca);
|
|---|
| 72 | + it = void_cast_detail::find(s, ca);
|
|---|
| 73 | if (s.end() != it)
|
|---|
| 74 | return (*it)->upcast(t);
|
|---|
| 75 |
|
|---|
| 76 | @@ -265,7 +283,7 @@
|
|---|
| 77 | void_cast_detail::void_caster_argument ca(& derived, & base);
|
|---|
| 78 |
|
|---|
| 79 | void_cast_detail::set_type::const_iterator it;
|
|---|
| 80 | - it = s.find(&ca);
|
|---|
| 81 | + it = void_cast_detail::find(s, ca);
|
|---|
| 82 | if (s.end() != it)
|
|---|
| 83 | return(*it)->downcast(t);
|
|---|
| 84 |
|
|---|
| 85 | Index: D:/boost/boost.build/libs/serialization/util/test.jam
|
|---|
| 86 | ===================================================================
|
|---|
| 87 | --- D:/boost/boost.build/libs/serialization/util/test.jam (revision 138381)
|
|---|
| 88 | +++ D:/boost/boost.build/libs/serialization/util/test.jam (revision 138382)
|
|---|
| 89 | @@ -113,13 +113,13 @@
|
|---|
| 90 | return $(tests) ;
|
|---|
| 91 | }
|
|---|
| 92 |
|
|---|
| 93 | -rule test-bsl-run ( test-name : sources * : requirements * )
|
|---|
| 94 | +rule test-bsl-run ( test-name : sources * : requirements * : libs * )
|
|---|
| 95 | {
|
|---|
| 96 | local tests ;
|
|---|
| 97 | tests += [
|
|---|
| 98 | run-invoke $(test-name)
|
|---|
| 99 | : # sources
|
|---|
| 100 | - $(test-name).cpp $(sources).cpp
|
|---|
| 101 | + $(test-name).cpp $(sources).cpp $(libs)
|
|---|
| 102 | :
|
|---|
| 103 | $(requirements)
|
|---|
| 104 | ] ;
|
|---|