diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-09-15 20:41:11 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-09-15 20:41:11 +0200 |
| commit | ef10a4f34a3f10bc1fc7ee0b7b1be6f37d286741 (patch) | |
| tree | f2c123a4b1a755a5b4bf740cb89687163d5e9ded | |
| parent | 2d8cc72760cfd26e56b70786b30c4f6dafe04aa0 (diff) | |
| download | Project-Tick-ef10a4f34a3f10bc1fc7ee0b7b1be6f37d286741.tar.gz Project-Tick-ef10a4f34a3f10bc1fc7ee0b7b1be6f37d286741.zip | |
Add test for inflating zlib data
| -rw-r--r-- | test/testfiles/bigtest.zlib | bin | 0 -> 528 bytes | |||
| -rw-r--r-- | test/zlibstream_test.h | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/testfiles/bigtest.zlib b/test/testfiles/bigtest.zlib Binary files differnew file mode 100644 index 0000000000..36aeee57fb --- /dev/null +++ b/test/testfiles/bigtest.zlib diff --git a/test/zlibstream_test.h b/test/zlibstream_test.h index f37dcdbd91..d2e6b6ee82 100644 --- a/test/zlibstream_test.h +++ b/test/zlibstream_test.h @@ -89,6 +89,22 @@ public: } } + void test_inflate_zlib() + { + std::ifstream zlib_in("bigtest.zlib", std::ios::binary); + TS_ASSERT(zlib_in); + + std::stringbuf data; + izlibstream izls(zlib_in, 256); + izls.exceptions(std::ios::failbit); + TS_ASSERT(izls.good()); + + TS_ASSERT_THROWS_NOTHING(izls >> &data); + TS_ASSERT(izls); + TS_ASSERT(izls.eof()); + TS_ASSERT_EQUALS(data.str(), bigtest.str()); + } + void test_inflate_corrupt() { std::ifstream gzip_in("bigtest_corrupt.nbt", std::ios::binary); |
