|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62960 - in trunk: boost/iostreams/filter libs/iostreams/test
From: steven_at_[hidden]
Date: 2010-06-14 21:02:07
Author: steven_watanabe
Date: 2010-06-14 21:02:06 EDT (Mon, 14 Jun 2010)
New Revision: 62960
URL: http://svn.boost.org/trac/boost/changeset/62960
Log:
Make sure that compressing an empty string works.
Text files modified:
trunk/boost/iostreams/filter/symmetric.hpp | 7 +++++--
trunk/libs/iostreams/test/bzip2_test.cpp | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
Modified: trunk/boost/iostreams/filter/symmetric.hpp
==============================================================================
--- trunk/boost/iostreams/filter/symmetric.hpp (original)
+++ trunk/boost/iostreams/filter/symmetric.hpp 2010-06-14 21:02:06 EDT (Mon, 14 Jun 2010)
@@ -153,9 +153,12 @@
}
template<typename Sink>
- void close(Sink& snk, BOOST_IOS::openmode)
+ void close(Sink& snk, BOOST_IOS::openmode mode)
{
- if ((state() & f_write) != 0) {
+ if (mode == BOOST_IOS::out) {
+
+ if (!(state() & f_write))
+ begin_write();
// Repeatedly invoke filter() with no input.
try {
Modified: trunk/libs/iostreams/test/bzip2_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/bzip2_test.cpp (original)
+++ trunk/libs/iostreams/test/bzip2_test.cpp 2010-06-14 21:02:06 EDT (Mon, 14 Jun 2010)
@@ -33,6 +33,11 @@
basic_bzip2_decompressor<bzip2_alloc>(),
std::string(data.begin(), data.end()) )
);
+ BOOST_CHECK(
+ test_filter_pair( bzip2_compressor(),
+ bzip2_decompressor(),
+ std::string() )
+ );
}
test_suite* init_unit_test_suite(int, char* [])
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk