Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/iostreams/test/gzip_test.cpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

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/gzip.hpp>
9#include <boost/iostreams/filter/test.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 boost;
16using namespace boost::iostreams;
17using namespace boost::iostreams::test;
18using boost::unit_test::test_suite;     
19
20struct gzip_alloc : std::allocator<char> { };
21
22void gzip_test()
23{
24    text_sequence data;
25    BOOST_CHECK(
26        test_filter_pair( gzip_compressor(), 
27                          gzip_decompressor(), 
28                          std::string(data.begin(), data.end()) )
29    );
30    BOOST_CHECK(
31        test_filter_pair( basic_gzip_compressor<gzip_alloc>(), 
32                          basic_gzip_decompressor<gzip_alloc>(), 
33                          std::string(data.begin(), data.end()) )
34    );
35}
36
37test_suite* init_unit_test_suite(int, char* []) 
38{
39    test_suite* test = BOOST_TEST_SUITE("gzip test");
40    test->add(BOOST_TEST_CASE(&gzip_test));
41    return test;
42}
Note: See TracBrowser for help on using the repository browser.