]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/test/streambuf.cpp
5 // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 // Disable autolinking for unit tests.
12 #if !defined(BOOST_ALL_NO_LIB)
13 #define BOOST_ALL_NO_LIB 1
14 #endif // !defined(BOOST_ALL_NO_LIB)
16 // Test that header file is self-contained.
17 #include <boost/asio/streambuf.hpp>
19 #include <boost/asio/buffer.hpp>
20 #include "unit_test.hpp"
24 boost::asio::streambuf sb
;
28 BOOST_ASIO_CHECK(sb
.size() == 4);
30 for (int i
= 0; i
< 100; ++i
)
34 BOOST_ASIO_CHECK(sb
.size() == 1);
39 BOOST_ASIO_CHECK(sb
.size() == 0);
43 BOOST_ASIO_CHECK(sb
.size() == 2);
45 boost::asio::buffer_copy(sb
.prepare(10), boost::asio::buffer("cd", 2));
48 BOOST_ASIO_CHECK(sb
.size() == 4);
51 BOOST_ASIO_CHECK(sb
.size() == 4);
55 BOOST_ASIO_CHECK(sb
.size() == 0);
61 BOOST_ASIO_TEST_CASE(streambuf_test
)