Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/iostreams/test/zlib_test.cpp @ 14

Last change on this file since 14 was 12, checked in by landauf, 17 years ago

added boost

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1// (C) Copyright Jonathan Turkanis 2004
2// Distributed under the Boost Software License, Version 1.0. (See accompanying
3// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
4
5// See http://www.boost.org/libs/iostreams for documentation.
6
7#include <string>
8#include <boost/iostreams/filter/test.hpp>
9#include <boost/iostreams/filter/zlib.hpp>
10#include <boost/test/test_tools.hpp>
11#include <boost/test/unit_test.hpp>
12#include "detail/sequence.hpp"
13#include "detail/verification.hpp"
14
15using namespace std;
16using namespace boost;
17using namespace boost::iostreams;
18using namespace boost::iostreams::test;
19using boost::unit_test::test_suite;     
20
21struct zlib_alloc : std::allocator<char> { };
22
23void zlib_test()
24{
25    text_sequence data;
26    BOOST_CHECK(
27        test_filter_pair( zlib_compressor(), 
28                          zlib_decompressor(), 
29                          std::string(data.begin(), data.end()) )
30    );
31    BOOST_CHECK(
32        test_filter_pair( basic_zlib_compressor<zlib_alloc>(), 
33                          basic_zlib_decompressor<zlib_alloc>(), 
34                          std::string(data.begin(), data.end()) )
35    );
36}
37
38test_suite* init_unit_test_suite(int, char* []) 
39{
40    test_suite* test = BOOST_TEST_SUITE("zlib test");
41    test->add(BOOST_TEST_CASE(&zlib_test));
42    return test;
43}
Note: See TracBrowser for help on using the repository browser.