From 7c95df17eeea5e3d4a5a1e448b7184fbd8c1377a Mon Sep 17 00:00:00 2001 From: Nicolas 'Pixel' Noble Date: Mon, 21 Jan 2013 20:46:53 -0800 Subject: Adding a test for stackless ZStream read. --- tests/test-Handles.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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 h; IO 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()->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(); } -- cgit v1.2.3