1 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 |
---|---|
2 | // test_list.cpp |
3 | |
4 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
5 | // Use, modification and distribution is subject to the Boost Software |
6 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
7 | // http://www.boost.org/LICENSE_1_0.txt) |
8 | |
9 | // should pass compilation and execution |
10 | |
11 | #include <cstddef> // NULL |
12 | #include <fstream> |
13 | |
14 | #include <boost/config.hpp> |
15 | #include <cstdio> // remove |
16 | #if defined(BOOST_NO_STDC_NAMESPACE) |
17 | namespace std{ |
18 | using ::remove; |
19 | } |
20 | #endif |
21 | |
22 | #include <boost/archive/archive_exception.hpp> |
23 | #include "test_tools.hpp" |
24 | |
25 | #include "A.hpp" |
26 | #include "A.ipp" |
27 | |
28 | #include <boost/serialization/slist.hpp> |
29 | void test_slist(){ |
30 | const char * testfile = boost::archive::tmpnam(NULL); |
31 | BOOST_STD_EXTENSION_NAMESPACE::slist<A> aslist; |
32 | aslist.push_front(x: A()); |
33 | aslist.push_front(x: A()); |
34 | { |
35 | test_ostream os(testfile, TEST_STREAM_FLAGS); |
36 | test_oarchive oa(os, TEST_ARCHIVE_FLAGS); |
37 | oa << boost::serialization::make_nvp(n: "aslist", v&: aslist); |
38 | } |
39 | BOOST_STD_EXTENSION_NAMESPACE::slist<A> aslist1;{ |
40 | test_istream is(testfile, TEST_STREAM_FLAGS); |
41 | test_iarchive ia(is, TEST_ARCHIVE_FLAGS); |
42 | ia >> boost::serialization::make_nvp(n: "aslist", v&: aslist1); |
43 | } |
44 | BOOST_CHECK(aslist == aslist1); |
45 | std::remove(filename: testfile); |
46 | } |
47 | |
48 | int test_main( int /* argc */, char* /* argv */[] ) |
49 | { |
50 | test_slist(); |
51 | return EXIT_SUCCESS; |
52 | } |
53 | |
54 | // EOF |
55 | |
56 |