tabs and licence

[SVN r23760]
This commit is contained in:
Robert Ramey
2004-07-19 07:00:01 +00:00
parent 9894a800e8
commit 9e6d12881d
120 changed files with 1107 additions and 530 deletions

View File

@@ -58,17 +58,17 @@ private:
ar & BOOST_SERIALIZATION_NVP(g);
#endif
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
int i;
if(Archive::is_saving::value){
i = l;
ar & BOOST_SERIALIZATION_NVP(i);
}
else{
ar & BOOST_SERIALIZATION_NVP(i);
l = i;
}
int i;
if(Archive::is_saving::value){
i = l;
ar & BOOST_SERIALIZATION_NVP(i);
}
else{
ar & BOOST_SERIALIZATION_NVP(i);
l = i;
}
#else
ar & BOOST_SERIALIZATION_NVP(l);
ar & BOOST_SERIALIZATION_NVP(l);
#endif
ar & BOOST_SERIALIZATION_NVP(m);
ar & BOOST_SERIALIZATION_NVP(n);

View File

@@ -68,24 +68,24 @@ rule run-invoke ( test-name : sources * : defn * )
if $(BOOST_SERIALIZATION_TEST_RELEASE) {
return [
run
$(sources)
<lib>../../test/build/boost_test_exec_monitor
<lib>../../serialization/build/boost_serialization
$(sources)
<lib>../../test/build/boost_test_exec_monitor
<lib>../../serialization/build/boost_serialization
: # args
: # input files
: # requirements
# <threading>single
# <runtime-link>static
<stlport-iostream>on
<borland><*><cxxflags>"-w-8080 -w-8071 -w-8057"
# <threading>single
# <runtime-link>static
<stlport-iostream>on
<borland><*><cxxflags>"-w-8080 -w-8071 -w-8057"
<borland-5.5.1><*><cxxflags>"-w-8080 -w-8071 -w-8057"
<borland-5.6.4><*><cxxflags>"-w-8080 -w-8071 -w-8057"
<define>$(defn)
<include>$(BOOST_ROOT)
<define>$(defn)
<include>$(BOOST_ROOT)
: # name
$(test-name)_release
$(test-name)_release
: # default-build
release
release
] ;
}
}
@@ -103,10 +103,10 @@ rule test-bsl-run_archive ( test-name : archive-name : sources * ) {
return [
run-invoke $(test-name)_$(archive-name)
:
$(test-name).cpp $(sources).cpp
<lib>../../../libs/serialization/build/boost_wserialization
$(test-name).cpp $(sources).cpp
<lib>../../../libs/serialization/build/boost_wserialization
:
BOOST_ARCHIVE_TEST=$(archive-name).hpp
BOOST_ARCHIVE_TEST=$(archive-name).hpp
] ;
case "*" :
return [
@@ -127,7 +127,7 @@ rule test-bsl-run_files ( test-name ) {
for local defn in $(BOOST_ARCHIVE_LIST) {
test-bsl-run_archive $(test-name) : $(defn:LB) ;
}
}
}
test-suite "serialization" :
[ test-bsl-run_files test_array ]
@@ -182,14 +182,14 @@ if $(BOOST_SERIALIZATION_TEST) {
[
run-invoke test_codecvt_null
:
test_codecvt_null.cpp
<lib>../../../libs/serialization/build/boost_wserialization
test_codecvt_null.cpp
<lib>../../../libs/serialization/build/boost_wserialization
]
[
run-invoke test_utf8_codecvt
:
test_utf8_codecvt.cpp
<lib>../../../libs/serialization/build/boost_wserialization
test_utf8_codecvt.cpp
<lib>../../../libs/serialization/build/boost_wserialization
]
# demos
@@ -213,5 +213,5 @@ if $(BOOST_SERIALIZATION_TEST) {
# should compile
[ compile test_const.cpp ]
;
}
}

View File

@@ -1,3 +1,16 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// binary_archive
#include <boost/archive/binary_oarchive.hpp>
typedef boost::archive::binary_oarchive test_oarchive;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// binary_warchive
#include <boost/archive/binary_woarchive.hpp>
typedef boost::archive::binary_woarchive test_oarchive;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/polymorphic_binary_oarchive.hpp>
typedef boost::archive::polymorphic_binary_oarchive test_oarchive;
typedef std::ofstream test_ostream;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/polymorphic_text_oarchive.hpp>
typedef boost::archive::polymorphic_text_oarchive test_oarchive;
typedef std::ofstream test_ostream;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/polymorphic_text_woarchive.hpp>
typedef boost::archive::polymorphic_text_woarchive test_oarchive;
typedef std::wofstream test_ostream;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/polymorphic_xml_oarchive.hpp>
typedef boost::archive::polymorphic_xml_oarchive test_oarchive;
typedef std::ofstream test_ostream;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/polymorphic_xml_woarchive.hpp>
typedef boost::archive::polymorphic_xml_woarchive test_oarchive;
typedef std::wofstream test_ostream;

View File

@@ -1,4 +1,9 @@
// file includes for testing a custom archive.
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.// file includes for testing a custom archive.
// as an example this tests the portable binary archive
// #include output archive header

View File

@@ -25,5 +25,4 @@ runtest VC7.1
TOOLS=msvc6
makepath
runtest msvc
runtest msvc-stlport

View File

@@ -9,6 +9,14 @@
// should pass compilation and execution
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/serialization/nvp.hpp>
@@ -84,7 +92,7 @@ int test_main( int /* argc */, char* /* argv */[] )
}
BOOST_CATCH (boost::archive::archive_exception ae){}
}
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -8,14 +8,17 @@
// should pass compilation and execution
#include <fstream>
#include <cstdlib> // for rand()
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ using ::rand; }
namespace std{
using ::rand;
using ::remove;
}
#endif
#include <fstream>
#include "test_tools.hpp"
#include <boost/serialization/nvp.hpp>
@@ -30,8 +33,8 @@ class A {
template<class Archive>
void serialize(Archive & ar, const unsigned int /* file_version */){
ar & boost::serialization::make_nvp(
"data",
boost::serialization::make_binary_object(data, sizeof(data))
"data",
boost::serialization::make_binary_object(data, sizeof(data))
);
}
@@ -79,7 +82,7 @@ int test_main( int /* argc */, char* /* argv */[] )
}
BOOST_CHECK(i == i1);
BOOST_CHECK(a == a1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -17,7 +17,14 @@
#include <locale>
#include <vector>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/archive/add_facet.hpp>
@@ -73,10 +80,10 @@ int test_main( int /* argc */, char* /* argv */[] ) {
ofs.open(testfile, std::ios::binary);
std::copy(
td::wchar_encoding,
// borland 5.60 complains about this
// borland 5.60 complains about this
// td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t),
// so use this instead
td::wchar_encoding + 13,
// so use this instead
td::wchar_encoding + 13,
boost::archive::iterators::ostream_iterator<wchar_t>(ofs)
);
}
@@ -85,11 +92,11 @@ int test_main( int /* argc */, char* /* argv */[] ) {
std::wifstream ifs;
ifs.imbue(*null_locale);
ifs.open(testfile, std::ios::binary);
ok = std::equal(
ok = std::equal(
td::wchar_encoding,
// borland 5.60 complains about this
// borland 5.60 complains about this
// td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t),
// so use this instead
// so use this instead
td::wchar_encoding + 13,
boost::archive::iterators::istream_iterator<wchar_t>(ifs)
);
@@ -105,14 +112,14 @@ int test_main( int /* argc */, char* /* argv */[] ) {
std::wifstream ifs("testfile2");
ifs.imbue(*null_locale);
int i2;
int i2;
ifs >> i2;
BOOST_CHECK(i == i2);
ifs.close();
}
delete null_locale;
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/nvp.hpp>
#include "test_tools.hpp"
@@ -51,7 +59,7 @@ int test_main( int /* argc */, char* /* argv */[] )
ia >> boost::serialization::make_nvp("c", c1);
}
BOOST_CHECK(c == c1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "A.hpp"
#include <boost/serialization/nvp.hpp>
@@ -109,7 +117,7 @@ int test_main( int /* argc */, char* /* argv */[] )
oa << BOOST_SERIALIZATION_NVP(k);
}
BOOST_CATCH (boost::archive::archive_exception ae){
exception = ae;
exception = ae;
}
BOOST_CHECK(
exception.code == boost::archive::archive_exception::pointer_conflict
@@ -121,19 +129,19 @@ int test_main( int /* argc */, char* /* argv */[] )
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is);
exception = boost::archive::archive_exception(
boost::archive::archive_exception::no_exception
boost::archive::archive_exception::no_exception
);
BOOST_TRY {
ia >> BOOST_SERIALIZATION_NVP(k);
}
BOOST_CATCH (boost::archive::archive_exception ae){
exception = ae;
exception = ae;
}
BOOST_CHECK(
exception.code == boost::archive::archive_exception::pointer_conflict
);
}
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -9,6 +9,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/vector.hpp>
@@ -114,7 +122,7 @@ test_main( int /* argc */, char* /* argv */[] )
//identify the leaks
BOOST_CHECK(A::objcount == 0);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/deque.hpp>
#include <boost/archive/archive_exception.hpp>
@@ -37,7 +45,7 @@ int test_main( int /* argc */, char* /* argv */[] )
}
BOOST_CHECK(adeque == adeque1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/archive/archive_exception.hpp>
#include "test_tools.hpp"
@@ -126,7 +134,7 @@ test_main( int /* argc */, char* /* argv */[] )
save_derived(testfile);
load_derived(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include "B.hpp"
@@ -34,7 +42,7 @@ int test_main( int /* argc */, char* /* argv */[] )
}
BOOST_CHECK(tb != tb1);
BOOST_CHECK(*tb == *tb1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -11,7 +11,14 @@
#include <fstream>
#include <iostream>
#include <boost/serialization/string.hpp>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/map.hpp>
#include <boost/serialization/utility.hpp>
@@ -57,8 +64,8 @@ public:
{
return i == another.i && m == another.m;
}
// make virtual to evade gcc quirk
virtual ~base() {};
// make virtual to evade gcc quirk
virtual ~base() {};
private:
int i;
std::map<int, std::string> m;
@@ -162,6 +169,6 @@ test_main( int /* argc */, char* /* argv */[] )
BOOST_CHECK(1 == save_count);
BOOST_CHECK(1 == load_count);
BOOST_CHECK(b2 == b);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/base_object.hpp>
#include <boost/archive/archive_exception.hpp>
@@ -114,7 +122,7 @@ test_main( int /* argc */, char* /* argv */[] )
save_exported(testfile);
load_exported(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -132,9 +132,9 @@ void test_transform_width(unsigned int size){
BOOST_CHECK(
std::equal(
rawdata,
rawdata + size,
translator2(BOOST_MAKE_PFTO_WRAPPER(v6.begin()))
rawdata,
rawdata + size,
translator2(BOOST_MAKE_PFTO_WRAPPER(v6.begin()))
)
);

View File

@@ -47,11 +47,11 @@ void test_base64(){
typedef
boost::archive::iterators::insert_linebreaks<
boost::archive::iterators::base64_from_binary<
boost::archive::iterators::transform_width<
CharType *
,6
,sizeof(CharType) * 8
>
boost::archive::iterators::transform_width<
CharType *
,6
,sizeof(CharType) * 8
>
>
,72
>
@@ -67,9 +67,9 @@ void test_base64(){
typedef
boost::archive::iterators::transform_width<
boost::archive::iterators::binary_from_base64<
boost::archive::iterators::remove_whitespace<
BOOST_DEDUCED_TYPENAME text_base64_type::iterator
>
boost::archive::iterators::remove_whitespace<
BOOST_DEDUCED_TYPENAME text_base64_type::iterator
>
>,
sizeof(CharType) * 8,
6
@@ -77,9 +77,9 @@ void test_base64(){
BOOST_CHECK(
std::equal(
rawdata,
rawdata + size,
translate_in(BOOST_MAKE_PFTO_WRAPPER(text_base64.begin()))
rawdata,
rawdata + size,
translate_in(BOOST_MAKE_PFTO_WRAPPER(text_base64.begin()))
)
);

View File

@@ -83,8 +83,8 @@ test_main( int /* argc */, char* /* argv */[] )
A a;
B b;
std::string filename;
filename += boost::archive::tmpdir();
filename += '/';
filename += boost::archive::tmpdir();
filename += '/';
filename += BOOST_PP_STRINGIZE(testfile_);
filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST);
in(filename.c_str(), a, b);

View File

@@ -81,8 +81,8 @@ test_main( int /* argc */, char* /* argv */[] )
A a;
B b;
std::string filename;
filename += boost::archive::tmpdir();
filename += '/';
filename += boost::archive::tmpdir();
filename += '/';
filename += BOOST_PP_STRINGIZE(testfile_);
filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST);
out(filename.c_str(), a, b);

View File

@@ -11,6 +11,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/level.hpp>
#include <boost/serialization/nvp.hpp>
#include "test_tools.hpp"
@@ -53,7 +61,7 @@ test_main( int /* argc */, char* /* argv */[] )
A a;
out(testfile, a);
in(testfile, a);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/list.hpp>
#ifdef BOOST_HAS_SLIST
#include <boost/serialization/slist.hpp>
@@ -59,7 +67,7 @@ int test_main( int /* argc */, char* /* argv */[] )
BOOST_CHECK(aslist == aslist1);
#endif
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,7 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/type_traits/is_pointer.hpp>
#include <boost/static_assert.hpp>
#include <boost/checked_delete.hpp>
@@ -105,7 +112,7 @@ int test_main( int /* argc */, char* /* argv */[] )
boost::checked_deleter<A>()
);
#endif
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -128,7 +128,7 @@ int test_main( int /* argc */, char* /* argv */[] )
BOOST_CHECK(amultimap == amultimap1);
#endif
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -1,9 +1,25 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// test_mi.cpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// test of serialization of base classes with multiple inheritance
// contributed by Peter Dimov
#include <iostream>
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/serialization/nvp.hpp>
@@ -113,6 +129,6 @@ test_main( int /* argc */, char* /* argv */[] )
std::cout << "pb->get_y(): " << pb->get_y() << std::endl;
delete pc;
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -1,16 +1,21 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// test_mult_archive_types.cpp
//
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstdio>
#include <boost/config.hpp>
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
@@ -89,7 +94,7 @@ void test_save_and_load(A * first, A * second)
ia >> BOOST_SERIALIZATION_NVP(second);
}
BOOST_CHECK(first == second);
std::remove(testfile);
std::remove(testfile);
}
using namespace boost::archive;

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include "D.hpp"
@@ -32,7 +40,7 @@ int test_main( int /* argc */, char* /* argv */[] )
ia >> boost::serialization::make_nvp("a", a1);
}
BOOST_CHECK(a == a1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -16,6 +16,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -233,7 +241,7 @@ test_main( int /* argc */, char* /* argv */[] )
save_derived(testfile);
load_derived(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -14,7 +14,7 @@
#include <fstream>
#include <cstdlib> // for rand()
#include <cstdlib> // for rand(), remove()
#include <cmath> // for fabs()
#include <boost/config.hpp>
@@ -22,6 +22,7 @@
namespace std{
using ::rand;
using ::fabs;
using ::remove;
}
#endif
@@ -188,7 +189,7 @@ test_main( int /* argc */, char* /* argv */[] )
save(testfile);
load(testfile);
BOOST_CHECK(0 == A::count);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -13,14 +13,15 @@
// b) usage of a non-default constructor
#include <fstream>
#include <cstdlib> // for rand()
#include <cstdlib> // for rand(), remove
#include <cmath> // for fabs()
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::rand;
using ::fabs;
using ::rand;
using ::fabs;
using ::remove;
}
#endif
@@ -163,7 +164,7 @@ test_main( int /* argc */, char* /* argv */[] )
BOOST_REQUIRE(NULL != testfile);
save(testfile);
load(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/serialization/base_object.hpp>
@@ -71,7 +79,7 @@ test_main( int /* argc */, char* /* argv */[] )
BOOST_REQUIRE(NULL != testfile);
save(testfile);
load(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/serialization/nvp.hpp>
@@ -50,7 +58,7 @@ int test_main( int argc, char* argv[] )
}
BOOST_CHECK(b == *bptr1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/optional.hpp>
#include <boost/archive/archive_exception.hpp>
@@ -44,7 +52,7 @@ int test_main( int /* argc */, char* /* argv */[] )
BOOST_CHECK(aoptional1 == aoptional1a);
BOOST_CHECK(aoptional2 == aoptional2a);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#if !defined(BOOST_ARCHIVE_TEST)
#define BOOST_ARCHIVE_TEST polymorphic_text_archive.hpp
#endif
@@ -40,6 +48,6 @@ int test_main(int /* argc */, char * /* argv */ [])
ia_interface >> BOOST_SERIALIZATION_NVP(d1);
}
BOOST_CHECK(d == d1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include "J.hpp"
@@ -34,7 +42,7 @@ int test_main( int /* argc */, char* /* argv */[] )
ia >> BOOST_SERIALIZATION_NVP(j1);
}
BOOST_CHECK(j == j1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/archive/archive_exception.hpp>
#include "test_tools.hpp"
@@ -223,7 +231,7 @@ test_main( int /* argc */, char* /* argv */[] )
save_registered(testfile);
load_registered(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/set.hpp>
#ifdef BOOST_HAS_HASH
#include <boost/serialization/hash_set.hpp>
@@ -93,6 +101,6 @@ int test_main( int /* argc */, char* /* argv */[] )
BOOST_CHECK(ahash_multiset == ahash_multiset1);
#endif
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,12 +10,21 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/shared_ptr.hpp>
#include "test_tools.hpp"
#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.
class A
@@ -103,7 +112,7 @@ void test_save_and_load2(boost::shared_ptr<A>& first, boost::shared_ptr<A>& seco
ia >> BOOST_SERIALIZATION_NVP(second);
}
BOOST_CHECK(boost::get_pointer(first) == boost::get_pointer(second));
std::remove(testfile);
std::remove(testfile);
}
// This does the tests

View File

@@ -10,10 +10,18 @@
// invoke header for a custom archive test.
#include "test_tools.hpp"
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/serialization/nvp.hpp>
#include "A.hpp"

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include "A.hpp"
@@ -35,7 +43,7 @@ int test_main( int /* argc */, char* /* argv */[] )
}
BOOST_CHECK(ta != ta1);
BOOST_CHECK(*ta == *ta1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include "B.hpp"
@@ -33,7 +41,7 @@ int test_main( int argc, char* argv[] )
ia >> boost::serialization::make_nvp("b1", b1);
}
BOOST_CHECK(b == b1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -49,15 +49,15 @@ void test_static_reference_cast_2(){
BOOST_CHECK_EQUAL(& b2, & scb2);
// downcast
// BOOST_CHECK_EQUAL(& d, & (smart_cast<Derived &, Base1 &>(b1)));
// BOOST_CHECK_EQUAL(& d, & (smart_cast<Derived &, Base2 &>(b2)));
// BOOST_CHECK_EQUAL(& d, & (smart_cast<Derived &, Base1 &>(b1)));
// BOOST_CHECK_EQUAL(& d, & (smart_cast<Derived &, Base2 &>(b2)));
// crosscast pointers fails at compiler time
// BOOST_CHECK_EQUAL(pB2,smart_cast<B2 *>(pB1));
// though explicit cross cast will always work
BOOST_CHECK_EQUAL(& b2,(
& smart_cast<Base2 &, Derived &>(
smart_cast<Derived &, Base1 &>(b1)
smart_cast<Derived &, Base1 &>(b1)
))
);
}
@@ -81,7 +81,7 @@ void test_static_reference_cast_1(){
// though explicit cross cast will always work
BOOST_CHECK_EQUAL(& b2,(
& smart_cast_reference<Base2 &>(
smart_cast_reference<Derived &>(b1)
smart_cast_reference<Derived &>(b1)
))
);
}
@@ -107,7 +107,7 @@ void test_static_pointer_cast(){
// though explicit cross cast will always work
BOOST_CHECK_EQUAL(pB2,
smart_cast<Base2 *>(
smart_cast<Derived *>(pB1)
smart_cast<Derived *>(pB1)
)
);
}
@@ -159,7 +159,7 @@ void test_dynamic_reference_cast_2(){
// explicit cross cast should always work
BOOST_CHECK_EQUAL(& b2, (
& smart_cast<VBase2 &, VDerived &>(
smart_cast<VDerived &, VBase1 &>(b1)
smart_cast<VDerived &, VBase1 &>(b1)
))
);
}
@@ -183,7 +183,7 @@ void test_dynamic_reference_cast_1(){
// explicit cross cast should always work
BOOST_CHECK_EQUAL(& b2, (
& smart_cast_reference<VBase2 &>(
smart_cast_reference<VDerived &>(b1)
smart_cast_reference<VDerived &>(b1)
))
);
}
@@ -208,7 +208,7 @@ void test_dynamic_pointer_cast(){
// though explicit cross cast will always work
BOOST_CHECK_EQUAL(pB2,
smart_cast<VBase2 *>(
smart_cast<VDerived *>(pB1)
smart_cast<VDerived *>(pB1)
)
);
}

View File

@@ -9,7 +9,14 @@
// should pass compilation and execution
#include <fstream>
#include <cstdio>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/split_free.hpp>
@@ -145,7 +152,7 @@ test_main( int /* argc */, char* /* argv */[] )
out(testfile, a, b, c);
in(testfile, a, b, c);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -21,7 +21,7 @@
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::tmpnam;
using ::remove;
using ::remove;
}
#endif
@@ -38,7 +38,7 @@ struct leak_reporter {
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
}
~leak_reporter(){
// _CrtDumpMemoryLeaks(); // replaced by the above
// _CrtDumpMemoryLeaks(); // replaced by the above
}
};
leak_reporter leak_reporter::instance;
@@ -58,19 +58,24 @@ leak_reporter leak_reporter::instance;
#if defined(__BORLANDC__)
namespace {
using std::_tempnam;
using std::getenv;
// borland defines strcpy as a macro in release mode
// borland defines strcpy as a macro in release mode
#if ! defined(NDEBUG)
using std::strcpy;
#endif
}
#endif
#if defined(BOOST_MSVC)
namespace std{
using ::_tempnam;
} // namespace std
#endif
char * tmpnam(char * buffer){
static char ibuffer [256];
const char * dname = boost::archive::tmpdir();
/* const */ char * tfilename = _tempnam(dname, "ser");
char * dname = boost::archive::tmpdir();
char * tfilename = std::_tempnam(dname, "ser");
if(NULL == buffer){
strcpy(ibuffer, tfilename);
delete tfilename;

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/serialization/tracking.hpp>
#include <boost/serialization/nvp.hpp>
@@ -112,7 +120,7 @@ test_main( int /* argc */, char* /* argv */[] )
out(testfile);
in(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/archive/archive_exception.hpp>
@@ -218,7 +226,7 @@ test_main( int /* argc */, char* /* argv */[] )
load_unregistered2(testfile);
save_registered(testfile);
load_registered(testfile);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -1,11 +1,10 @@
//
// utf8_transform_test.cpp -
// A test suite for utf8_transform_iterator
//
// NOTE: These are not yet comprehensive. Simply a test of basic
// functionality. Iterator concept checks, and further verification
// of operator++/operator-- interaction would be useful.
//
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// test_utf8_codecvt.cpp
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// 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 <fstream>

View File

@@ -10,6 +10,14 @@
#include <fstream>
#include <cstdio> // remove
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include "test_tools.hpp"
#include <boost/serialization/vector.hpp>
@@ -37,7 +45,7 @@ int test_main( int /* argc */, char* /* argv */[] )
ia >> boost::serialization::make_nvp("avector", avector1);
}
BOOST_CHECK(avector == avector1);
std::remove(testfile);
std::remove(testfile);
return boost::exit_success;
}

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// text_archive
#include <boost/archive/text_oarchive.hpp>
typedef boost::archive::text_oarchive test_oarchive;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// text_warchive
#include <boost/archive/text_woarchive.hpp>
typedef boost::archive::text_woarchive test_oarchive;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// xml_archive
#include <boost/archive/xml_oarchive.hpp>
typedef boost::archive::xml_oarchive test_oarchive;

View File

@@ -1,3 +1,9 @@
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// xml_warchive
#include <boost/archive/xml_woarchive.hpp>
typedef boost::archive::xml_woarchive test_oarchive;