diff options
author | Nicolas 'Pixel' Noble <pixel@nobis-crew.org> | 2013-01-21 20:46:53 -0800 |
---|---|---|
committer | Nicolas 'Pixel' Noble <pixel@nobis-crew.org> | 2013-01-21 20:46:53 -0800 |
commit | 7c95df17eeea5e3d4a5a1e448b7184fbd8c1377a (patch) | |
tree | afcb39911552c56c11248f541bb694838f026c86 /tests | |
parent | 99b5bb39e9bae2c3a3295c11af1e6deaddd6fecb (diff) |
Adding a test for stackless ZStream read.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-Handles.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc index c8a650f..3b69992 100644 --- a/tests/test-Handles.cc +++ b/tests/test-Handles.cc @@ -261,6 +261,7 @@ class StacklessTaskTest : public StacklessTask { const char * getName() const { return "StacklessTaskTest"; } IO<Handle> h; IO<ZStream> z; + uint8_t data[dg.size]; }; void StacklessTaskTest::Do() { @@ -274,6 +275,12 @@ void StacklessTaskTest::Do() { z = new ZStream(h, Z_BEST_COMPRESSION, ZStream::GZIP); StacklessOperation(z->write(dg.getData(), dg.size)); StacklessOperation(z->close()); + h = new Input("tests/data.gz"); + StacklessOperation(h.asA<Input>()->open()); + z = new ZStream(h, Z_BEST_COMPRESSION, ZStream::GZIP); + StacklessOperation(z->read(data, dg.size)); + TAssert(memcmp(dg.getData(), data, dg.size) == 0); + StacklessOperation(z->close()); StacklessEnd(); } |