diff --git a/boost/iostreams/filter/test.hpp b/boost/iostreams/filter/test.hpp
index 3b01fed..476d4a3 100644
|
a
|
b
|
bool test_input_filter( Filter filter,
|
| 153 | 153 | { |
| 154 | 154 | non_blocking_source src(input, inc); |
| 155 | 155 | std::string dest; |
| 156 | | iostreams::copy(compose(filter, src), iostreams::back_inserter(dest)); |
| | 156 | iostreams::copy(iostreams::compose(filter, src), iostreams::back_inserter(dest)); |
| 157 | 157 | if (dest != output) |
| 158 | 158 | return false; |
| 159 | 159 | } |
| … |
… |
bool test_output_filter( Filter filter,
|
| 197 | 197 | { |
| 198 | 198 | array_source src(input.data(), input.data() + input.size()); |
| 199 | 199 | std::string dest; |
| 200 | | iostreams::copy(src, compose(filter, non_blocking_sink(dest, inc))); |
| | 200 | iostreams::copy(src, iostreams::compose(filter, non_blocking_sink(dest, inc))); |
| 201 | 201 | if (dest != output ) |
| 202 | 202 | return false; |
| 203 | 203 | } |
| … |
… |
bool test_filter_pair( OutputFilter out,
|
| 243 | 243 | array_source src(data.data(), data.data() + data.size()); |
| 244 | 244 | std::string temp; |
| 245 | 245 | std::string dest; |
| 246 | | iostreams::copy(src, compose(out, non_blocking_sink(temp, inc))); |
| | 246 | iostreams::copy(src, iostreams::compose(out, non_blocking_sink(temp, inc))); |
| 247 | 247 | iostreams::copy( |
| 248 | | compose(in, non_blocking_source(temp, inc)), |
| | 248 | iostreams::compose(in, non_blocking_source(temp, inc)), |
| 249 | 249 | iostreams::back_inserter(dest) |
| 250 | 250 | ); |
| 251 | 251 | if (dest != data) |
| … |
… |
bool test_filter_pair( OutputFilter out,
|
| 255 | 255 | array_source src(data.data(), data.data() + data.size()); |
| 256 | 256 | std::string temp; |
| 257 | 257 | std::string dest; |
| 258 | | iostreams::copy(src, compose(out, non_blocking_sink(temp, inc))); |
| | 258 | iostreams::copy(src, iostreams::compose(out, non_blocking_sink(temp, inc))); |
| 259 | 259 | // truncate the file, this should not loop, it may throw |
| 260 | 260 | // std::ios_base::failure, which we swallow. |
| 261 | 261 | try { |
| 262 | 262 | temp.resize(temp.size() / 2); |
| 263 | 263 | iostreams::copy( |
| 264 | | compose(in, non_blocking_source(temp, inc)), |
| | 264 | iostreams::compose(in, non_blocking_source(temp, inc)), |
| 265 | 265 | iostreams::back_inserter(dest) |
| 266 | 266 | ); |
| 267 | 267 | } catch(std::ios_base::failure&) {} |
| … |
… |
bool test_filter_pair( OutputFilter out,
|
| 270 | 270 | array_source src(data.data(), data.data() + data.size()); |
| 271 | 271 | std::string temp; |
| 272 | 272 | std::string dest; |
| 273 | | iostreams::copy(compose(out, src), non_blocking_sink(temp, inc)); |
| | 273 | iostreams::copy(iostreams::compose(out, src), non_blocking_sink(temp, inc)); |
| 274 | 274 | iostreams::copy( |
| 275 | 275 | non_blocking_source(temp, inc), |
| 276 | | compose(in, iostreams::back_inserter(dest)) |
| | 276 | iostreams::compose(in, iostreams::back_inserter(dest)) |
| 277 | 277 | ); |
| 278 | 278 | if (dest != data) |
| 279 | 279 | return false; |
| … |
… |
bool test_filter_pair( OutputFilter out,
|
| 282 | 282 | array_source src(data.data(), data.data() + data.size()); |
| 283 | 283 | std::string temp; |
| 284 | 284 | std::string dest; |
| 285 | | iostreams::copy(compose(out, src), non_blocking_sink(temp, inc)); |
| | 285 | iostreams::copy(iostreams::compose(out, src), non_blocking_sink(temp, inc)); |
| 286 | 286 | // truncate the file, this should not loop, it may throw |
| 287 | 287 | // std::ios_base::failure, which we swallow. |
| 288 | 288 | try { |
| 289 | 289 | temp.resize(temp.size() / 2); |
| 290 | 290 | iostreams::copy( |
| 291 | 291 | non_blocking_source(temp, inc), |
| 292 | | compose(in, iostreams::back_inserter(dest)) |
| | 292 | iostreams::compose(in, iostreams::back_inserter(dest)) |
| 293 | 293 | ); |
| 294 | 294 | } catch(std::ios_base::failure&) {} |
| 295 | 295 | } |