|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r86727 - in branches/release/libs/serialization: . doc example performance/xml src test util vc7ide
From: ramey_at_[hidden]
Date: 2013-11-16 15:13:39
Author: ramey
Date: 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013)
New Revision: 86727
URL: http://svn.boost.org/trac/boost/changeset/86727
Log:
merge trunk to release
Deleted:
branches/release/libs/serialization/vc7ide/
Properties modified:
branches/release/libs/serialization/ (props changed)
branches/release/libs/serialization/example/ (props changed)
branches/release/libs/serialization/src/ (props changed)
branches/release/libs/serialization/test/test_diamond_complex.cpp (props changed)
Text files modified:
branches/release/libs/serialization/doc/archive_reference.html | 6 +-
branches/release/libs/serialization/example/demo_dll_a.hpp | 11 ++----
branches/release/libs/serialization/example/demo_dll_a.ipp | 10 +----
branches/release/libs/serialization/example/demo_dll_b.hpp | 7 ++-
branches/release/libs/serialization/example/demo_dll_b.ipp | 6 +-
branches/release/libs/serialization/example/log_archive.hpp | 9 ++++
branches/release/libs/serialization/example/polymorphic_portable_binary_iarchive.hpp | 2
branches/release/libs/serialization/example/polymorphic_portable_binary_oarchive.hpp | 2
branches/release/libs/serialization/example/portable_binary_archive.hpp | 2
branches/release/libs/serialization/example/portable_binary_iarchive.hpp | 2
branches/release/libs/serialization/example/portable_binary_oarchive.hpp | 2
branches/release/libs/serialization/example/simple_log_archive.hpp | 2
branches/release/libs/serialization/performance/xml/harness.hpp | 2
branches/release/libs/serialization/performance/xml/macro.hpp | 2
branches/release/libs/serialization/performance/xml/node.hpp | 2
branches/release/libs/serialization/src/basic_archive.cpp | 2
branches/release/libs/serialization/src/basic_iarchive.cpp | 14 ++++---
branches/release/libs/serialization/src/basic_serializer_map.cpp | 5 +-
branches/release/libs/serialization/src/shared_ptr_helper.cpp | 2
branches/release/libs/serialization/src/utf8_codecvt_facet.cpp | 21 +++++------
branches/release/libs/serialization/test/A.cpp | 9 +---
branches/release/libs/serialization/test/A.hpp | 2
branches/release/libs/serialization/test/B.hpp | 10 +++--
branches/release/libs/serialization/test/C.hpp | 2
branches/release/libs/serialization/test/D.hpp | 2
branches/release/libs/serialization/test/J.hpp | 2
branches/release/libs/serialization/test/base.hpp | 2
branches/release/libs/serialization/test/derived2.hpp | 2
branches/release/libs/serialization/test/polymorphic_base.hpp | 2
branches/release/libs/serialization/test/polymorphic_derived1.hpp | 2
branches/release/libs/serialization/test/polymorphic_derived2.hpp | 2
branches/release/libs/serialization/test/test_array.cpp | 52 ++++++++----------------------
branches/release/libs/serialization/test/test_codecvt_null.cpp | 2
branches/release/libs/serialization/test/test_complex.cpp | 27 ++++++++++-----
branches/release/libs/serialization/test/test_decl.hpp | 2
branches/release/libs/serialization/test/test_delete_pointer.cpp | 67 ++++++++++++++++++---------------------
branches/release/libs/serialization/test/test_iterators.cpp | 2
branches/release/libs/serialization/test/test_map.cpp | 4 -
branches/release/libs/serialization/test/test_non_default_ctor.cpp | 13 ++++---
branches/release/libs/serialization/test/test_non_intrusive.cpp | 13 ++++---
branches/release/libs/serialization/test/test_set.cpp | 2
branches/release/libs/serialization/test/test_shared_ptr.cpp | 1
branches/release/libs/serialization/test/test_shared_ptr_132.cpp | 3 -
branches/release/libs/serialization/test/test_shared_ptr_multi_base.cpp | 1
branches/release/libs/serialization/test/test_simple_class.cpp | 16 +-------
branches/release/libs/serialization/test/test_smart_cast.cpp | 8 ----
branches/release/libs/serialization/test/test_tools.hpp | 14 ++++----
branches/release/libs/serialization/test/test_traits_fail.cpp | 2
branches/release/libs/serialization/test/test_utf8_codecvt.cpp | 12 +++++-
branches/release/libs/serialization/test/test_variant.cpp | 7 ++-
branches/release/libs/serialization/util/test.jam | 1
51 files changed, 183 insertions(+), 214 deletions(-)
Modified: branches/release/libs/serialization/doc/archive_reference.html
==============================================================================
--- branches/release/libs/serialization/doc/archive_reference.html Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/doc/archive_reference.html 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -57,7 +57,7 @@
// serialization library
typedef boost::mpl::bool_<true> is_saving;
typedef boost::mpl::bool_<false> is_loading;
- template<class T> register_type(){}
+ template<class T> void register_type(){}
template<class T> trivial_oarchive & operator<<(const T & t){
return *this;
}
@@ -140,7 +140,7 @@
<dl>
-<dt><h4><code>void save_start()</code></h4></dt>
+<dt><h4><code>void save_start(char const *)</code></h4></dt>
<dd>
<strong>Default</strong>:Does nothing.<br>
<strong>Purpose</strong>:To inject/retrieve an object name into the archive. Used
@@ -148,7 +148,7 @@
</dd>
<p>
-<dt><h4><code>void save_end()</code></h4></dt>
+<dt><h4><code>void save_end(char const *)</code></h4></dt>
<dd>
<strong>Default</strong>:Does nothing.<br>
<strong>Purpose</strong>:To inject/retrieve an object name into the archive. Used
Modified: branches/release/libs/serialization/example/demo_dll_a.hpp
==============================================================================
--- branches/release/libs/serialization/example/demo_dll_a.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/demo_dll_a.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_A_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -20,6 +20,7 @@
#include <cstdlib> // for rand()
#include <cmath> // for fabs()
#include <cstddef> // size_t
+#include <boost/math/special_functions/next.hpp>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
@@ -245,13 +246,9 @@
return false;
if(v != rhs.v)
return false;
- if(w == 0 && std::fabs(rhs.w) > std::numeric_limits<float>::epsilon())
+ if(std::abs( boost::math::float_distance(w, rhs.w)) > 1)
return false;
- if(std::fabs(rhs.w/w - 1.0) > std::numeric_limits<float>::epsilon())
- return false;
- if(x == 0 && std::fabs(rhs.x - x) > std::numeric_limits<float>::epsilon())
- return false;
- if(std::fabs(rhs.x/x - 1.0) > std::numeric_limits<float>::epsilon())
+ if(std::abs( boost::math::float_distance(x, rhs.x)) > 1)
return false;
if(0 != y.compare(rhs.y))
return false;
Modified: branches/release/libs/serialization/example/demo_dll_a.ipp
==============================================================================
--- branches/release/libs/serialization/example/demo_dll_a.ipp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/demo_dll_a.ipp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_A_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -244,14 +244,10 @@
if(u != rhs.u)
return false;
if(v != rhs.v)
- return false;
- if(w == 0 && std::fabs(rhs.w) > std::numeric_limits<float>::epsilon())
- return false;
- if(std::fabs(rhs.w/w - 1.0) > std::numeric_limits<float>::epsilon())
return false;
- if(x == 0 && std::fabs(rhs.x - x) > std::numeric_limits<float>::epsilon())
+ if(std::abs( boost::math::float_distance(w, rhs.w)) > 1)
return false;
- if(std::fabs(rhs.x/x - 1.0) > std::numeric_limits<float>::epsilon())
+ if(std::abs( boost::math::float_distance(x, rhs.x)) > 1)
return false;
if(0 != y.compare(rhs.y))
return false;
Modified: branches/release/libs/serialization/example/demo_dll_b.hpp
==============================================================================
--- branches/release/libs/serialization/example/demo_dll_b.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/demo_dll_b.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_B_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -17,6 +17,7 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstdlib> // for rand()
+#include <boost/math/special_functions/next.hpp>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
@@ -104,8 +105,8 @@
&& t == rhs.t
&& u == rhs.u
&& v == rhs.v
- && std::fabs(w - rhs.w) <= std::numeric_limits<float>::round_error()
- && std::fabs(x - rhs.x) <= std::numeric_limits<float>::round_error()
+ && std::abs( boost::math::float_distance(w, rhs.w)) < 2
+ && std::abs( boost::math::float_distance(x, rhs.x)) < 2
;
}
Modified: branches/release/libs/serialization/example/demo_dll_b.ipp
==============================================================================
--- branches/release/libs/serialization/example/demo_dll_b.ipp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/demo_dll_b.ipp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_B_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -104,8 +104,8 @@
&& t == rhs.t
&& u == rhs.u
&& v == rhs.v
- && std::fabs(w - rhs.w) <= std::numeric_limits<float>::round_error()
- && std::fabs(x - rhs.x) <= std::numeric_limits<float>::round_error()
+ && std::abs( boost::math::float_distance(w, rhs.w)) < 2
+ && std::abs( boost::math::float_distance(x, rhs.x)) < 2
;
}
Modified: branches/release/libs/serialization/example/log_archive.hpp
==============================================================================
--- branches/release/libs/serialization/example/log_archive.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/log_archive.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define LOG_ARCHIVE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -18,6 +18,13 @@
#include <boost/archive/xml_oarchive.hpp>
+namespace boost {
+namespace archive {
+ namespace detail {
+ template<class Archive> class interface_oarchive;
+ } // namespace detail
+} // namespace archive
+
/////////////////////////////////////////////////////////////////////////
// log data to an output stream. This illustrates a simpler implemenation
// of text output which is useful for getting a formatted display of
Modified: branches/release/libs/serialization/example/polymorphic_portable_binary_iarchive.hpp
==============================================================================
--- branches/release/libs/serialization/example/polymorphic_portable_binary_iarchive.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/polymorphic_portable_binary_iarchive.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_IARCHIVE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/example/polymorphic_portable_binary_oarchive.hpp
==============================================================================
--- branches/release/libs/serialization/example/polymorphic_portable_binary_oarchive.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/polymorphic_portable_binary_oarchive.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_OARCHIVE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/example/portable_binary_archive.hpp
==============================================================================
--- branches/release/libs/serialization/example/portable_binary_archive.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/portable_binary_archive.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -7,7 +7,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/example/portable_binary_iarchive.hpp
==============================================================================
--- branches/release/libs/serialization/example/portable_binary_iarchive.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/portable_binary_iarchive.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define PORTABLE_BINARY_IARCHIVE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/example/portable_binary_oarchive.hpp
==============================================================================
--- branches/release/libs/serialization/example/portable_binary_oarchive.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/portable_binary_oarchive.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define PORTABLE_BINARY_OARCHIVE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/example/simple_log_archive.hpp
==============================================================================
--- branches/release/libs/serialization/example/simple_log_archive.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/example/simple_log_archive.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SIMPLE_LOG_ARCHIVE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/performance/xml/harness.hpp
==============================================================================
--- branches/release/libs/serialization/performance/xml/harness.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/performance/xml/harness.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -12,7 +12,7 @@
#define BOOST_SERIALIZATION_XML_PERFORMANCE_HARNESS_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/performance/xml/macro.hpp
==============================================================================
--- branches/release/libs/serialization/performance/xml/macro.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/performance/xml/macro.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -11,7 +11,7 @@
#if !defined(BOOST_SERIALIZATION_XML_PERFORMANCE_MACRO_HPP)
#define BOOST_SERIALIZATION_XML_PERFORMANCE_MACRO_HPP
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
#pragma once
#endif
Modified: branches/release/libs/serialization/performance/xml/node.hpp
==============================================================================
--- branches/release/libs/serialization/performance/xml/node.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/performance/xml/node.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -11,7 +11,7 @@
#if !defined(BOOST_SERIALIZATION_XML_PERFORMANCE_NODE_HPP)
#define BOOST_SERIALIZATION_XML_PERFORMANCE_NODE_HPP
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
#pragma once
#endif
Modified: branches/release/libs/serialization/src/basic_archive.cpp
==============================================================================
--- branches/release/libs/serialization/src/basic_archive.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/src/basic_archive.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -74,7 +74,7 @@
BOOST_ARCHIVE_DECL(library_version_type)
BOOST_ARCHIVE_VERSION(){
- return library_version_type(10);
+ return library_version_type(11);
}
} // namespace archive
Modified: branches/release/libs/serialization/src/basic_iarchive.cpp
==============================================================================
--- branches/release/libs/serialization/src/basic_iarchive.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/src/basic_iarchive.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -453,9 +453,9 @@
}
BOOST_ASSERT(NULL != bpis_ptr);
class_id_type new_cid = register_type(bpis_ptr->get_basic_serializer());
+ BOOST_VERIFY(register_type(bpis_ptr->get_basic_serializer()) == cid);
int i = cid;
cobject_id_vector[i].bpis_ptr = bpis_ptr;
- BOOST_ASSERT(new_cid == cid);
}
int i = cid;
cobject_id & co = cobject_id_vector[i];
@@ -495,14 +495,16 @@
// cyclic strucures
object_id_vector.push_back(aobject(t, cid));
+ // remember that that the address of these elements could change
+ // when we make another call so don't use the address
bpis_ptr->load_object_ptr(
- ar,
- object_id_vector[ui].address,
- co.file_version
+ ar,
+ t,
+ m_pending.version
);
- t = object_id_vector[ui].address;
- object_id_vector[ui].loaded_as_pointer = true;
BOOST_ASSERT(NULL != t);
+ object_id_vector[ui].address = t;
+ object_id_vector[ui].loaded_as_pointer = true;
}
return bpis_ptr;
Modified: branches/release/libs/serialization/src/basic_serializer_map.cpp
==============================================================================
--- branches/release/libs/serialization/src/basic_serializer_map.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/src/basic_serializer_map.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -43,11 +43,12 @@
BOOST_ARCHIVE_DECL(bool)
basic_serializer_map::insert(const basic_serializer * bs){
// attempt to insert serializer into it's map
- const std::pair<map_type::iterator, bool> result =
- m_map.insert(bs);
// the following is commented out - rather than being just
// deleted as a reminder not to try this.
+ // const std::pair<map_type::iterator, bool> result =
+ m_map.insert(bs);
+
// At first it seemed like a good idea. It enforced the
// idea that a type be exported from at most one code module
// (DLL or mainline). This would enforce a "one definition rule"
Modified: branches/release/libs/serialization/src/shared_ptr_helper.cpp
==============================================================================
--- branches/release/libs/serialization/src/shared_ptr_helper.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/src/shared_ptr_helper.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -1,5 +1,5 @@
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/src/utf8_codecvt_facet.cpp
==============================================================================
--- branches/release/libs/serialization/src/utf8_codecvt_facet.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/src/utf8_codecvt_facet.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -7,15 +7,14 @@
#ifdef BOOST_NO_STD_WSTREAMBUF
#error "wide char i/o not supported on this platform"
#else
-
-#define BOOST_UTF8_BEGIN_NAMESPACE \
- namespace boost { namespace archive { namespace detail {
-#define BOOST_UTF8_DECL
-#define BOOST_UTF8_END_NAMESPACE }}}
-#include <boost/detail/utf8_codecvt_facet.ipp>
-#undef BOOST_UTF8_END_NAMESPACE
-#undef BOOST_UTF8_DECL
-#undef BOOST_UTF8_BEGIN_NAMESPACE
-
+ #ifdef BOOST_NO_CXX11_HDR_CODECVT
+ #define BOOST_UTF8_BEGIN_NAMESPACE \
+ namespace boost { namespace archive { namespace detail {
+ #define BOOST_UTF8_DECL
+ #define BOOST_UTF8_END_NAMESPACE }}}
+ #include <boost/detail/utf8_codecvt_facet.ipp>
+ #undef BOOST_UTF8_END_NAMESPACE
+ #undef BOOST_UTF8_DECL
+ #undef BOOST_UTF8_BEGIN_NAMESPACE
+ #endif // BOOST_NO_CXX11_HDR_CODECVT
#endif // BOOST_NO_STD_WSTREAMBUF
-
Modified: branches/release/libs/serialization/test/A.cpp
==============================================================================
--- branches/release/libs/serialization/test/A.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/A.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -12,6 +12,7 @@
#include <cstdlib> // rand()
#include <cmath> // fabs()
#include <cstddef> // size_t
+#include <boost/math/special_functions/next.hpp>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
@@ -148,13 +149,9 @@
return false;
if(v != rhs.v)
return false;
- if(w == 0 && std::fabs(rhs.w) > std::numeric_limits<float>::epsilon())
+ if(std::abs( boost::math::float_distance(w, rhs.w)) > 1)
return false;
- if(std::fabs(rhs.w/w - 1.0) > std::numeric_limits<float>::epsilon())
- return false;
- if(x == 0 && std::fabs(rhs.x - x) > std::numeric_limits<float>::epsilon())
- return false;
- if(std::fabs(rhs.x/x - 1.0) > std::numeric_limits<float>::epsilon())
+ if(std::abs( boost::math::float_distance(x, rhs.x)) > 1)
return false;
if(0 != y.compare(rhs.y))
return false;
Modified: branches/release/libs/serialization/test/A.hpp
==============================================================================
--- branches/release/libs/serialization/test/A.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/A.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_A_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/B.hpp
==============================================================================
--- branches/release/libs/serialization/test/B.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/B.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_B_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -18,6 +18,7 @@
#include <cstdlib> // for rand()
#include <cmath>
+#include <boost/math/special_functions/next.hpp>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
@@ -67,6 +68,7 @@
ar >> BOOST_SERIALIZATION_NVP(v);
ar >> BOOST_SERIALIZATION_NVP(w);
ar >> BOOST_SERIALIZATION_NVP(x);
+ break;
default:
break;
}
@@ -104,9 +106,9 @@
&& s == rhs.s
&& t == rhs.t
&& u == rhs.u
- && v == rhs.v
- && std::fabs(w - rhs.w) <= std::numeric_limits<float>::round_error()
- && std::fabs(x - rhs.x) <= std::numeric_limits<float>::round_error()
+ && v == rhs.v
+ && std::abs( boost::math::float_distance(w, rhs.w)) < 2
+ && std::abs( boost::math::float_distance(x, rhs.x)) < 2
;
}
Modified: branches/release/libs/serialization/test/C.hpp
==============================================================================
--- branches/release/libs/serialization/test/C.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/C.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_A_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/D.hpp
==============================================================================
--- branches/release/libs/serialization/test/D.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/D.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_D_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/J.hpp
==============================================================================
--- branches/release/libs/serialization/test/J.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/J.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_J_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/base.hpp
==============================================================================
--- branches/release/libs/serialization/test/base.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/base.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_BASE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/derived2.hpp
==============================================================================
--- branches/release/libs/serialization/test/derived2.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/derived2.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TEST_DERIVED2_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/polymorphic_base.hpp
==============================================================================
--- branches/release/libs/serialization/test/polymorphic_base.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/polymorphic_base.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define POLYMORPHIC_BASE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/polymorphic_derived1.hpp
==============================================================================
--- branches/release/libs/serialization/test/polymorphic_derived1.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/polymorphic_derived1.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define POLYMORPHIC_DERIVED1_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/polymorphic_derived2.hpp
==============================================================================
--- branches/release/libs/serialization/test/polymorphic_derived2.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/polymorphic_derived2.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define POLYMORPHIC_DERIVED2_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/test_array.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_array.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_array.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -10,7 +10,7 @@
#include <cstddef>
#include <fstream>
-
+#include <algorithm> // equal
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
@@ -18,7 +18,7 @@
using ::remove;
}
#endif
-
+#include <boost/foreach.hpp>
#include "test_tools.hpp"
#include <boost/detail/no_exceptions_support.hpp>
#include <boost/archive/archive_exception.hpp>
@@ -27,34 +27,13 @@
#include "A.hpp"
#include "A.ipp"
-struct array_equal_to //: public std::binary_function<T, T, bool>
-{
-template<class T, class U>
- bool operator()(const T & _Left, const U & _Right) const
- {
- // consider alignment
- int count_left = sizeof(_Left) / (
- static_cast<const char *>(static_cast<const void *>(&_Left[1]))
- - static_cast<const char *>(static_cast<const void *>(&_Left[0]))
- );
- int count_right = sizeof(_Right) / (
- static_cast<const char *>(static_cast<const void *>(&_Right[1]))
- - static_cast<const char *>(static_cast<const void *>(&_Right[0]))
- );
- if(count_right != count_left)
- return false;
- while(count_left-- > 0){
- if(_Left[count_left] == _Right[count_left])
- continue;
- return false;
- }
- return true;
- }
-};
+template<class T, unsigned int N>
+bool deep_compare(const T (& lhs)[N], const T (& rhs)[N]){
+ return std::equal(&lhs[0], &lhs[N], &rhs[0]);
+}
template <class T>
-int test_array(T)
-{
+int test_array(){
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_REQUIRE(NULL != testfile);
@@ -79,11 +58,10 @@
ia >> boost::serialization::make_nvp("b_array", b_array1);
ia >> boost::serialization::make_nvp("c_array", c_array1);
- array_equal_to/*<A[10]>*/ Compare;
- BOOST_CHECK(Compare(a_array, a_array1));
- BOOST_CHECK(Compare(b_array[0], b_array1[0]));
- BOOST_CHECK(Compare(b_array[1], b_array1[1]));
- BOOST_CHECK(Compare(c_array, c_array1));
+ BOOST_CHECK(deep_compare(a_array,a_array1));
+ BOOST_CHECK(b_array[0][0] == b_array1[0][0]);
+ BOOST_CHECK(b_array[1][0] == b_array1[1][0]);
+ BOOST_CHECK(c_array == c_array1);
}
{
T a_array1[9];
@@ -114,11 +92,11 @@
int test_main( int /* argc */, char* /* argv */[] )
{
- int res = test_array(A());
+ int res = test_array<A>();
// test an int array for which optimized versions should be available
- if (res == EXIT_SUCCESS)
- res = test_array(0);
- return res;
+ if (res == EXIT_SUCCESS)
+ res = test_array<int>();
+ return res;
}
// EOF
Modified: branches/release/libs/serialization/test/test_codecvt_null.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_codecvt_null.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_codecvt_null.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -10,7 +10,7 @@
// which use wchar_t as 2 byte objects will emit warnings. These should be
// ignored.
-#include <algorithm>
+#include <algorithm> // std::copy
#include <fstream>
#include <iostream>
#include <iterator>
Modified: branches/release/libs/serialization/test/test_complex.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_complex.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_complex.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -15,9 +15,10 @@
#include <cstdio> // remove
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
-#include <boost/limits.hpp>
+#include <boost/math/special_functions/next.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
+#include <boost/limits.hpp>
namespace std{
using ::rand;
using ::remove;
@@ -30,15 +31,15 @@
}
#endif
-#include <boost/config.hpp>
-#include <boost/limits.hpp>
-
#include "test_tools.hpp"
+
#include <boost/preprocessor/stringize.hpp>
#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST)
#include <boost/serialization/complex.hpp>
+#include <iostream>
+
int test_main( int /* argc */, char* /* argv */[] )
{
const char * testfile = boost::archive::tmpnam(NULL);
@@ -46,12 +47,12 @@
// test array of objects
std::complex<float> a(
- static_cast<float>(std::rand()),
- static_cast<float>(std::rand())
+ static_cast<float>(std::rand()) / static_cast<float>(std::rand()),
+ static_cast<float>(std::rand()) / static_cast<float>(std::rand())
);
std::complex<double> b(
- static_cast<double>(std::rand()),
- static_cast<double>(std::rand())
+ static_cast<double>(std::rand()) / static_cast<double>(std::rand()),
+ static_cast<double>(std::rand()) / static_cast<double>(std::rand())
);
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
@@ -68,8 +69,14 @@
ia >> boost::serialization::make_nvp("adoublecomplex", b1);
}
- BOOST_CHECK(std::abs(a-a1) <= 2.*std::numeric_limits<float>::round_error());
- BOOST_CHECK(std::abs(b-b1) <= 2.*std::numeric_limits<double>::round_error());
+ std::cerr << "a.real()-a1a.real() distance = " << std::abs( boost::math::float_distance(a.real(), a1.real())) << std::endl;
+ BOOST_CHECK(std::abs(boost::math::float_distance(a.real(), a1.real())) < 2);
+ std::cerr << "a.imag() - a1a.imag() distance = " << std::abs( boost::math::float_distance(a.imag(), a1.imag())) << std::endl;
+ BOOST_CHECK(std::abs(boost::math::float_distance(a.imag(), a1.imag())) < 2);
+ std::cerr << "b.real() - b1.real() distance = " << std::abs( boost::math::float_distance(b.real(), b1.real())) << std::endl;
+ BOOST_CHECK(std::abs(boost::math::float_distance(b.real(), b1.real())) < 2);
+ std::cerr << "b.imag() - b1.imag() distance = " << std::abs( boost::math::float_distance(b.imag(), b1.imag())) << std::endl;
+ BOOST_CHECK(std::abs(boost::math::float_distance(b.imag(), b1.imag())) < 2);
std::remove(testfile);
return EXIT_SUCCESS;
Modified: branches/release/libs/serialization/test/test_decl.hpp
==============================================================================
--- branches/release/libs/serialization/test/test_decl.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_decl.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -2,7 +2,7 @@
#define BOOST_TEST_DECL_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
Modified: branches/release/libs/serialization/test/test_delete_pointer.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_delete_pointer.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_delete_pointer.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -24,7 +24,6 @@
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
-#include <boost/serialization/vector.hpp>
//A holds a pointer to another A, but doesn't own the pointer.
//objCount
@@ -41,89 +40,85 @@
{
static int i = 0;
ar >> BOOST_SERIALIZATION_NVP(next_);
- if(++i == 3)
- boost::serialization::throw_exception(boost::archive::archive_exception(
- boost::archive::archive_exception::no_exception
- ));
+ //if(++i == 3)
+ // boost::serialization::throw_exception(boost::archive::archive_exception(
+ // boost::archive::archive_exception::no_exception
+ // ));
+ ++loadcount;
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
public:
A()
{
+ if(test && objcount == 3)
+ boost::serialization::throw_exception(boost::archive::archive_exception(
+ boost::archive::archive_exception::no_exception
+ ));
next_ = 0;
++objcount;
}
- A(const A& a)
- {
- next_ = a.next_; ++objcount;
- }
- ~A()
- {
+ ~A(){
+ delete next_;
--objcount;
}
A* next_;
static int objcount;
+ static bool test;
+ static int loadcount;
};
int A::objcount = 0;
+int A::loadcount = 0;
+bool A::test = false;
int
test_main( int /* argc */, char* /* argv */[] )
{
- std::vector<A*> vec;
- A* a = new A;
- a->next_ = 0;
- vec.push_back(a);
//fill the vector with chained A's. The vector is assumed
//to own the objects - we will destroy the objects through this vector.
+
+ A * head = new A;
+ A* last = head;
unsigned int i;
- for(i = 1; i < 10; ++i)
+ for(i = 1; i < 9; ++i)
{
- a = new A;
- vec[i - 1]->next_ = a;
- a->next_ = 0;
- vec.push_back(a);
+ A *a = new A;
+ last->next_ = a;
+ last = a;
}
const char * testfile = boost::archive::tmpnam(0);
BOOST_REQUIRE(NULL != testfile);
- //output the vector
+ //output the list
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
- oa << BOOST_SERIALIZATION_NVP(vec);
+ oa << BOOST_SERIALIZATION_NVP(head);
}
- //erase the objects
- for(i = 0; i < vec.size(); ++i)
- delete vec[i];
- vec.clear();
+ delete head;
+ BOOST_CHECK(A::objcount == 0);
- //read the vector back
+ head = NULL;
+ A::test = true;
+ //read the list back
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
BOOST_TRY {
- ia >> BOOST_SERIALIZATION_NVP(vec);
+ ia >> BOOST_SERIALIZATION_NVP(head);
}
BOOST_CATCH (...){
ia.delete_created_pointers();
- vec.clear();
}
BOOST_CATCH_END
}
- //delete the objects
- for(i = 0; i < vec.size(); ++i)
- delete vec[i];
- vec.clear();
-
//identify the leaks
- BOOST_CHECK(A::objcount == 0);
+ BOOST_CHECK(A::loadcount == 0);
std::remove(testfile);
return EXIT_SUCCESS;
}
-
Modified: branches/release/libs/serialization/test/test_iterators.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_iterators.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_iterators.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -6,7 +6,7 @@
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <algorithm>
+#include <algorithm> // std::copy
#include <vector>
#include <cstdlib> // for rand
#include <functional>
Modified: branches/release/libs/serialization/test/test_map.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_map.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_map.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -8,7 +8,7 @@
// should pass compilation and execution
-#include <algorithm>
+#include <algorithm> // std::copy
#include <vector>
#include <fstream>
#include <cstddef> // size_t, NULL
@@ -57,8 +57,6 @@
}
};
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(random_key)
-
void
test_map(){
const char * testfile = boost::archive::tmpnam(NULL);
Modified: branches/release/libs/serialization/test/test_non_default_ctor.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_non_default_ctor.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_non_default_ctor.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -20,6 +20,7 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/limits.hpp>
+#include <boost/math/special_functions/next.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
@@ -100,8 +101,8 @@
&& t == rhs.t
&& u == rhs.u
&& v == rhs.v
- && std::fabs(w - rhs.w) <= std::numeric_limits<float>::round_error()
- && std::fabs(x - rhs.x) <= std::numeric_limits<float>::round_error()
+ && std::abs( boost::math::float_distance(w, rhs.w)) < 2
+ && std::abs( boost::math::float_distance(x, rhs.x)) < 2
;
}
@@ -115,10 +116,10 @@
return t < rhs.u;
if(! (v == rhs.v) )
return t < rhs.v;
- if(! (std::fabs(w - rhs.w) < std::numeric_limits<float>::round_error() ) )
- return t < rhs.w;
- if(! (std::fabs(x - rhs.x) < std::numeric_limits<float>::round_error() ) )
- return t < rhs.x;
+ if(std::abs( boost::math::float_distance(w, rhs.w)) > 1)
+ return false;
+ if(std::abs( boost::math::float_distance(x, rhs.x)) > 1)
+ return false;
return false;
}
Modified: branches/release/libs/serialization/test/test_non_intrusive.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_non_intrusive.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_non_intrusive.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -19,6 +19,7 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/limits.hpp>
+#include <boost/math/special_functions/next.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
@@ -68,8 +69,8 @@
&& t == rhs.t
&& u == rhs.u
&& v == rhs.v
- && std::fabs(w - rhs.w) <= std::numeric_limits<float>::round_error()
- && std::fabs(x - rhs.x) <= std::numeric_limits<float>::round_error()
+ && std::abs( boost::math::float_distance(w, rhs.w)) < 2
+ && std::abs( boost::math::float_distance(x, rhs.x)) < 2
;
}
@@ -83,10 +84,10 @@
return t < rhs.u;
if(! (v == rhs.v) )
return t < rhs.v;
- if(! (std::fabs(w - rhs.w) < std::numeric_limits<float>::round_error() ) )
- return t < rhs.w;
- if(! (std::fabs(x - rhs.x) < std::numeric_limits<float>::round_error() ) )
- return t < rhs.x;
+ if(std::abs( boost::math::float_distance(w, rhs.w)) > 1)
+ return false;
+ if(std::abs( boost::math::float_distance(x, rhs.x)) > 1)
+ return false;
return false;
}
Modified: branches/release/libs/serialization/test/test_set.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_set.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_set.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -12,7 +12,7 @@
#include <cstdio> // remove
#include <fstream>
-#include <algorithm>
+#include <algorithm> // std::copy
#include <vector>
#include <boost/config.hpp>
Modified: branches/release/libs/serialization/test/test_shared_ptr.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_shared_ptr.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_shared_ptr.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -18,7 +18,6 @@
using ::remove;
}
#endif
-#include <boost/type_traits/broken_compiler_spec.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/weak_ptr.hpp>
Modified: branches/release/libs/serialization/test/test_shared_ptr_132.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_shared_ptr_132.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_shared_ptr_132.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -30,7 +30,6 @@
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/export.hpp>
-#include <boost/type_traits/broken_compiler_spec.hpp>
// This is a simple class. It contains a counter of the number
// of objects of this class which have been instantiated.
@@ -57,7 +56,6 @@
virtual ~A(){--count;} // default destructor
};
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(A)
BOOST_SERIALIZATION_SHARED_PTR(A)
// B is a subclass of A
@@ -83,7 +81,6 @@
// B needs to be exported because its serialized via a base class pointer
BOOST_SHARED_POINTER_EXPORT(B)
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(B)
BOOST_SERIALIZATION_SHARED_PTR(B)
int A::count = 0;
Modified: branches/release/libs/serialization/test/test_shared_ptr_multi_base.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_shared_ptr_multi_base.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_shared_ptr_multi_base.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -18,7 +18,6 @@
using ::remove;
}
#endif
-#include <boost/type_traits/broken_compiler_spec.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/weak_ptr.hpp>
Modified: branches/release/libs/serialization/test/test_simple_class.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_simple_class.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_simple_class.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -14,6 +14,7 @@
#include <cstdio> // remove
#include <fstream>
#include <cmath>
+#include <boost/math/special_functions/next.hpp>
#include <boost/config.hpp>
@@ -50,19 +51,8 @@
BOOST_CHECK_EQUAL(u, rhs.u);
BOOST_CHECK_EQUAL(v, rhs.v);
BOOST_CHECK_EQUAL(l, rhs.l);
- BOOST_CHECK(!(
- w == 0
- && std::fabs(rhs.w) > std::numeric_limits<float>::epsilon()
- ));
- BOOST_CHECK(!(
- std::fabs(rhs.w/w - 1.0) > std::numeric_limits<float>::epsilon()
- ));
- BOOST_CHECK(!(
- x == 0 && std::fabs(rhs.x - x) > std::numeric_limits<float>::epsilon()
- ));
- BOOST_CHECK(!(
- std::fabs(rhs.x/x - 1.0) > std::numeric_limits<float>::epsilon()
- ));
+ BOOST_CHECK(std::abs( boost::math::float_distance(w, rhs.w)) < 2);
+ BOOST_CHECK(std::abs( boost::math::float_distance(x, rhs.x)) < 2);
BOOST_CHECK(!(0 != y.compare(rhs.y)));
#ifndef BOOST_NO_STD_WSTRING
BOOST_CHECK(!(0 != z.compare(rhs.z)));
Modified: branches/release/libs/serialization/test/test_smart_cast.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_smart_cast.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_smart_cast.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -39,10 +39,6 @@
#pragma warning(pop)
#endif
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Base1)
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Base2)
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Derived)
-
// if compiler doesn't support TPS, the smart_cast syntax doesn't
// work for references. One has to use the smart_cast_reference
// syntax (tested below ) instead.
@@ -151,10 +147,6 @@
#pragma warning(pop)
#endif
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VBase1)
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VBase2)
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VDerived)
-
// see above
void test_dynamic_reference_cast_2(){
Modified: branches/release/libs/serialization/test/test_tools.hpp
==============================================================================
--- branches/release/libs/serialization/test/test_tools.hpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_tools.hpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -1,14 +1,14 @@
#ifndef BOOST_SERIALIZATION_TEST_TOOLS_HPP
#define BOOST_SERIALIZATION_TEST_TOOLS_HPP
-#define BOOST_FILESYSTEM_VERSION 3
-#include <boost/filesystem.hpp>
-
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
+#define BOOST_FILESYSTEM_VERSION 3
+#include <boost/filesystem/operations.hpp> // unique_path
+
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// test_tools.hpp
//
@@ -20,10 +20,10 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // size_t
+#include <boost/config.hpp>
#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE
#include <exception>
#endif
-#include <boost/config.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#if defined(UNDER_CE)
@@ -63,9 +63,9 @@
#include <direct.h>
#include <boost/archive/tmpdir.hpp>
-#if defined(__COMO__)
+//#if defined(__COMO__)
#define chdir _chdir
-#endif
+//#endif // defined win32
#if defined(NDEBUG) && defined(__BORLANDC__)
#define STRCPY strcpy
Modified: branches/release/libs/serialization/test/test_traits_fail.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_traits_fail.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_traits_fail.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -34,7 +34,7 @@
int
test_main( int /* argc */, char* /* argv */[] )
{
- return boost::exit_failure;
+ return EXIT_SUCCESS;
}
// EOF
Modified: branches/release/libs/serialization/test/test_utf8_codecvt.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_utf8_codecvt.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_utf8_codecvt.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -6,7 +6,7 @@
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <algorithm>
+#include <algorithm> // std::copy
#include <fstream>
#include <iostream>
#include <iterator>
@@ -42,7 +42,15 @@
#include "test_tools.hpp"
#include <boost/archive/add_facet.hpp>
-#include <boost/archive/detail/utf8_codecvt_facet.hpp>
+
+#ifndef BOOST_NO_CXX11_HDR_CODECVT
+ #include <codecvt>
+ namespace boost { namespace archive { namespace detail {
+ typedef std::codecvt_utf8<wchar_t> utf8_codecvt_facet;
+ } } }
+#else
+ #include <boost/archive/detail/utf8_codecvt_facet.hpp>
+#endif
template<std::size_t s>
struct test_data
Modified: branches/release/libs/serialization/test/test_variant.cpp
==============================================================================
--- branches/release/libs/serialization/test/test_variant.cpp Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/test/test_variant.cpp 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -18,8 +18,9 @@
#include <cstddef> // NULL
#include <cstdio> // remove
#include <fstream>
-#include <cmath> // for fabs()
#include <boost/config.hpp>
+#include <cmath> // for fabs()
+#include <boost/math/special_functions/next.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
@@ -77,11 +78,11 @@
bool operator()( const float & lhs, const float & rhs ) const
{
- return std::fabs(lhs- rhs) < std::numeric_limits<float>::round_error();
+ return std::abs( boost::math::float_distance(lhs, rhs)) < 2;
}
bool operator()( const double & lhs, const double & rhs ) const
{
- return std::fabs(lhs - rhs) < std::numeric_limits<float>::round_error();
+ return std::abs( boost::math::float_distance(lhs, rhs)) < 2;
}
};
Modified: branches/release/libs/serialization/util/test.jam
==============================================================================
--- branches/release/libs/serialization/util/test.jam Sat Nov 16 15:13:24 2013 (r86726)
+++ branches/release/libs/serialization/util/test.jam 2013-11-16 15:13:39 EST (Sat, 16 Nov 2013) (r86727)
@@ -46,6 +46,7 @@
<toolset>msvc:<cxxflags>"-wd4996"
# toolset optimizations
<toolset>gcc:<cxxflags>"-ftemplate-depth-255"
+ <toolset>clang:<cxxflags>"-ftemplate-depth-255"
<toolset>msvc:<cxxflags>"-Gy"
$(requirements)
: # test name
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