mirror of
https://github.com/boostorg/serialization.git
synced 2026-02-01 08:52:08 +00:00
Full merge from trunk at revision 41356 of entire boost-root tree. Do Serialization separately to verify pre-commit check failures have been fixed.
[SVN r41368]
This commit is contained in:
@@ -26,21 +26,22 @@ namespace std{
|
||||
|
||||
#include "A.hpp"
|
||||
|
||||
int test_main( int /* argc */, char* /* argv */[] )
|
||||
template <class T>
|
||||
int test_vector(T)
|
||||
{
|
||||
const char * testfile = boost::archive::tmpnam(NULL);
|
||||
BOOST_REQUIRE(NULL != testfile);
|
||||
|
||||
// test array of objects
|
||||
std::vector<A> avector;
|
||||
avector.push_back(A());
|
||||
avector.push_back(A());
|
||||
std::vector<T> avector;
|
||||
avector.push_back(T());
|
||||
avector.push_back(T());
|
||||
{
|
||||
test_ostream os(testfile, TEST_STREAM_FLAGS);
|
||||
test_oarchive oa(os);
|
||||
oa << boost::serialization::make_nvp("avector", avector);
|
||||
}
|
||||
std::vector<A> avector1;
|
||||
std::vector<T> avector1;
|
||||
{
|
||||
test_istream is(testfile, TEST_STREAM_FLAGS);
|
||||
test_iarchive ia(is);
|
||||
@@ -51,4 +52,16 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int test_main( int /* argc */, char* /* argv */[] )
|
||||
{
|
||||
int res = test_vector(A());
|
||||
// test an int vector for which optimized versions should be available
|
||||
if (res == EXIT_SUCCESS)
|
||||
res = test_vector(0);
|
||||
// test a bool vector
|
||||
if (res == EXIT_SUCCESS)
|
||||
res = test_vector(false);
|
||||
return res;
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
||||
Reference in New Issue
Block a user