summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNicolas 'Pixel' Noble <pixel@nobis-crew.org>2013-01-21 20:54:38 -0800
committerNicolas 'Pixel' Noble <pixel@nobis-crew.org>2013-01-21 20:54:38 -0800
commita91b18c00cf38e2db339f06766e2def626c65aa1 (patch)
tree18143bcd6c8fbc574c175b7294d699e180ec5347 /tests
parent4569990b905a8a456e4c07b60883bb522b119d60 (diff)
Still adding few more things to the basic stackless handles test.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-Handles.cc13
1 files changed, 12 insertions, 1 deletions
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<Output>()->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<Input>()->open());
+ StacklessOperation(r = h->read(data, dg.size));
+ TAssert(r == dg.size);
+ StacklessOperation(h->close());
+
h = new Output("tests/data.gz");
StacklessOperation(h.asA<Output>()->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<Input>()->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();
}