diff options
author | Nicolas 'Pixel' Noble <pixel@nobis-crew.org> | 2013-01-21 20:49:01 -0800 |
---|---|---|
committer | Nicolas 'Pixel' Noble <pixel@nobis-crew.org> | 2013-01-21 20:49:01 -0800 |
commit | 4569990b905a8a456e4c07b60883bb522b119d60 (patch) | |
tree | 9bec4f2f1a648ce4e5e04ecbdfda687a58a1bddf | |
parent | 7c95df17eeea5e3d4a5a1e448b7184fbd8c1377a (diff) |
Adding a few more tests for ZStreams.
-rw-r--r-- | tests/test-Handles.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc index 3b69992..0a4ddfa 100644 --- a/tests/test-Handles.cc +++ b/tests/test-Handles.cc @@ -262,6 +262,7 @@ class StacklessTaskTest : public StacklessTask { IO<Handle> h; IO<ZStream> z; uint8_t data[dg.size]; + ssize_t r; }; void StacklessTaskTest::Do() { @@ -273,12 +274,14 @@ void StacklessTaskTest::Do() { h = new Output("tests/data.gz"); StacklessOperation(h.asA<Output>()->open()); z = new ZStream(h, Z_BEST_COMPRESSION, ZStream::GZIP); - StacklessOperation(z->write(dg.getData(), dg.size)); + StacklessOperation(r = z->write(dg.getData(), dg.size)); + TAssert(r == 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)); + StacklessOperation(r = z->read(data, dg.size)); + TAssert(r == dg.size); TAssert(memcmp(dg.getData(), data, dg.size) == 0); StacklessOperation(z->close()); StacklessEnd(); |