]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/serialization/test/test_simple_class.cpp
1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // test_simple_class.cpp
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)
9 // should pass compilation and execution
11 // invoke header for a custom archive test.
13 #include <cstddef> // NULL
14 #include <cstdio> // remove
17 #include <boost/math/special_functions/next.hpp>
19 #include <boost/config.hpp>
21 #if defined(BOOST_NO_STDC_NAMESPACE)
27 #include "test_tools.hpp"
32 bool A::check_equal(const A
&rhs
) const
34 BOOST_CHECK_EQUAL(b
, rhs
.b
);
35 BOOST_CHECK_EQUAL(l
, rhs
.l
);
36 #ifndef BOOST_NO_INT64_T
37 BOOST_CHECK_EQUAL(f
, rhs
.f
);
38 BOOST_CHECK_EQUAL(g
, rhs
.g
);
40 BOOST_CHECK_EQUAL(m
, rhs
.m
);
41 BOOST_CHECK_EQUAL(n
, rhs
.n
);
42 BOOST_CHECK_EQUAL(o
, rhs
.o
);
43 BOOST_CHECK_EQUAL(p
, rhs
.p
);
44 BOOST_CHECK_EQUAL(q
, rhs
.q
);
45 #ifndef BOOST_NO_CWCHAR
46 BOOST_CHECK_EQUAL(r
, rhs
.r
);
48 BOOST_CHECK_EQUAL(c
, rhs
.c
);
49 BOOST_CHECK_EQUAL(s
, rhs
.s
);
50 BOOST_CHECK_EQUAL(t
, rhs
.t
);
51 BOOST_CHECK_EQUAL(u
, rhs
.u
);
52 BOOST_CHECK_EQUAL(v
, rhs
.v
);
53 BOOST_CHECK_EQUAL(l
, rhs
.l
);
54 BOOST_CHECK(std::abs( boost::math::float_distance(w
, rhs
.w
)) < 2);
55 BOOST_CHECK(std::abs( boost::math::float_distance(x
, rhs
.x
)) < 2);
56 BOOST_CHECK(!(0 != y
.compare(rhs
.y
)));
57 #ifndef BOOST_NO_STD_WSTRING
58 BOOST_CHECK(!(0 != z
.compare(rhs
.z
)));
64 test_main( int /* argc */, char* /* argv */[] )
66 const char * testfile
= boost::archive::tmpnam(NULL
);
67 BOOST_REQUIRE(NULL
!= testfile
);
71 test_ostream
os(testfile
, TEST_STREAM_FLAGS
);
72 test_oarchive
oa(os
, TEST_ARCHIVE_FLAGS
);
73 oa
<< boost::serialization::make_nvp("a", a
);
76 test_istream
is(testfile
, TEST_STREAM_FLAGS
);
77 test_iarchive
ia(is
, TEST_ARCHIVE_FLAGS
);
78 ia
>> boost::serialization::make_nvp("a", a1
);
81 std::remove(testfile
);