diff options
| author | ljfa <ljfa-ag@web.de> | 2015-09-21 18:10:03 +0200 |
|---|---|---|
| committer | ljfa <ljfa-ag@web.de> | 2015-09-21 18:10:03 +0200 |
| commit | 8773152a57a4e1524be66c7d6777c48de246040f (patch) | |
| tree | 4820f57edbe07859737624b8dfcdbf91309a8687 /test | |
| parent | 57136429177ed86e2152154d4ecc229d3afe6d94 (diff) | |
| download | Project-Tick-8773152a57a4e1524be66c7d6777c48de246040f.tar.gz Project-Tick-8773152a57a4e1524be66c7d6777c48de246040f.zip | |
Make the inflate_streambuf rewind the input
Diffstat (limited to 'test')
| -rw-r--r-- | test/testfiles/trailing_data.zlib | bin | 0 -> 20 bytes | |||
| -rw-r--r-- | test/zlibstream_test.h | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/testfiles/trailing_data.zlib b/test/testfiles/trailing_data.zlib Binary files differnew file mode 100644 index 0000000000..83848f3024 --- /dev/null +++ b/test/testfiles/trailing_data.zlib diff --git a/test/zlibstream_test.h b/test/zlibstream_test.h index f8308cf7c5..e76745f80f 100644 --- a/test/zlibstream_test.h +++ b/test/zlibstream_test.h @@ -133,6 +133,27 @@ public: } } + void test_inflate_trailing() + { + //This file contains additional uncompressed data after the zlib-compressed data + std::ifstream file("trailing_data.zlib", std::ios::binary); + izlibstream izls(file, 32); + TS_ASSERT(file && izls); + + std::string str; + izls >> str; + TS_ASSERT(izls); + TS_ASSERT(izls.eof()); + TS_ASSERT_EQUALS(str, "foobar"); + + //Now read the uncompressed data + TS_ASSERT(file); + TS_ASSERT(!file.eof()); + file >> str; + TS_ASSERT(!file.bad()); + TS_ASSERT_EQUALS(str, "barbaz"); + } + void test_deflate_zlib() { //Here we assume that inflating works and has already been tested |
