]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/iostreams/test/file_test.cpp
1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
2 // (C) Copyright 2004-2007 Jonathan Turkanis
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
6 // See http://www.boost.org/libs/iostreams for documentation.
8 #include <boost/iostreams/device/file.hpp>
9 #include <boost/test/test_tools.hpp>
10 #include <boost/test/unit_test.hpp>
11 #include "detail/temp_file.hpp"
12 #include "detail/verification.hpp"
14 using namespace boost
;
15 using namespace boost::iostreams
;
16 using namespace boost::iostreams::test
;
18 using boost::unit_test::test_suite
;
24 //--------------Test file_source------------------------------------------//
27 file_source
f(test
.name());
28 BOOST_CHECK(f
.is_open());
30 BOOST_CHECK(!f
.is_open());
32 BOOST_CHECK(f
.is_open());
35 //--------------Test file_sink--------------------------------------------//
38 file_sink
f(test
.name());
39 BOOST_CHECK(f
.is_open());
41 BOOST_CHECK(!f
.is_open());
43 BOOST_CHECK(f
.is_open());
46 //--------------Test file-------------------------------------------------//
50 BOOST_CHECK(f
.is_open());
52 BOOST_CHECK(!f
.is_open());
54 BOOST_CHECK(f
.is_open());
58 test_suite
* init_unit_test_suite(int, char* [])
60 test_suite
* test
= BOOST_TEST_SUITE("file test");
61 test
->add(BOOST_TEST_CASE(&file_test
));