From a91b18c00cf38e2db339f06766e2def626c65aa1 Mon Sep 17 00:00:00 2001 From: Nicolas 'Pixel' Noble Date: Mon, 21 Jan 2013 20:54:38 -0800 Subject: Still adding few more things to the basic stackless handles test. --- tests/test-Handles.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc index 0a4ddfa..1beba1c 100644 --- a/tests/test-Handles.cc +++ b/tests/test-Handles.cc @@ -267,16 +267,26 @@ class StacklessTaskTest : public StacklessTask { void StacklessTaskTest::Do() { StacklessBegin(); + h = new Output("tests/data.raw"); StacklessOperation(h.asA()->open()); - StacklessOperation(h->write(dg.getData(), dg.size)); + StacklessOperation(r = h->write(dg.getData(), dg.size)); + TAssert(r == dg.size); StacklessOperation(h->close()); + + h = new Input("tests/data.raw"); + StacklessOperation(h.asA()->open()); + StacklessOperation(r = h->read(data, dg.size)); + TAssert(r == dg.size); + StacklessOperation(h->close()); + h = new Output("tests/data.gz"); StacklessOperation(h.asA()->open()); z = new ZStream(h, Z_BEST_COMPRESSION, ZStream::GZIP); StacklessOperation(r = z->write(dg.getData(), dg.size)); TAssert(r == dg.size); StacklessOperation(z->close()); + h = new Input("tests/data.gz"); StacklessOperation(h.asA()->open()); z = new ZStream(h, Z_BEST_COMPRESSION, ZStream::GZIP); @@ -284,6 +294,7 @@ void StacklessTaskTest::Do() { TAssert(r == dg.size); TAssert(memcmp(dg.getData(), data, dg.size) == 0); StacklessOperation(z->close()); + StacklessEnd(); } -- cgit v1.2.3