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.) |
5 | |
6 | // See http://www.boost.org/libs/iostreams for documentation. |
7 | |
8 | #include <cctype> |
9 | #include <boost/iostreams/device/null.hpp> |
10 | #include <boost/iostreams/stream.hpp> |
11 | #include <boost/test/test_tools.hpp> |
12 | #include <boost/test/unit_test.hpp> |
13 | #include "detail/temp_file.hpp" |
14 | #include "detail/verification.hpp" |
15 | |
16 | using namespace std; |
17 | using namespace boost; |
18 | using namespace boost::iostreams; |
19 | using namespace boost::iostreams::test; |
20 | using boost::unit_test::test_suite; |
21 | |
22 | void read_null_source() |
23 | { |
24 | stream<null_source> in; |
25 | in.open(t: null_source()); |
26 | in.get(); |
27 | BOOST_CHECK(in.eof()); |
28 | } |
29 | |
30 | void write_null_sink() |
31 | { |
32 | stream<null_sink> out; |
33 | out.open(t: null_sink()); |
34 | write_data_in_chunks(os&: out); |
35 | BOOST_CHECK(out.good()); |
36 | } |
37 | |
38 | test_suite* init_unit_test_suite(int, char* []) |
39 | { |
40 | test_suite* test = BOOST_TEST_SUITE("null test"); |
41 | test->add(BOOST_TEST_CASE(&read_null_source)); |
42 | test->add(BOOST_TEST_CASE(&write_null_sink)); |
43 | return test; |
44 | } |
45 |