diff options
author | Pixel <pixel@nobis-crew.org> | 2012-02-28 00:05:31 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2012-02-28 00:05:31 -0800 |
commit | 81132947f2f70d4a4b7423d8b718b662bcefaef9 (patch) | |
tree | ee4c2b12ee8cb8881ef4cab4d21fa1a9ca4b7727 /tests | |
parent | 30c37eb549c17b29a8131598cc06aeaf374896f5 (diff) |
Adding a short test for the ZStreams.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-Handles.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc index c872e9f..d2e2396 100644 --- a/tests/test-Handles.cc +++ b/tests/test-Handles.cc @@ -3,6 +3,7 @@ #include <Output.h> #include <Buffer.h> #include <BStream.h> +#include <ZHandle.h> #ifdef _WIN32 void ctime_r(const time_t * t, char * str) { @@ -103,5 +104,26 @@ void MainTask::Do() { TAssert(s == 12); TAssert(b->isEOF()); + { + IO<Output> o(new Output("tests/out.z")); + IO<ZStream> z(new ZStream(o)); + z->detach(); + z->writeString("foobar\n"); + } + + { + IO<Output> o(new Output("tests/out.gz")); + IO<ZStream> z(new ZStream(o, Z_BEST_COMPRESSION, ZStream::GZIP)); + z->detach(); + z->writeString("foobar\n"); + } + + { + IO<Output> o(new Output("tests/out.raw")); + IO<ZStream> z(new ZStream(o, Z_BEST_COMPRESSION, ZStream::RAW)); + z->detach(); + z->writeString("foobar\n"); + } + Printer::log(M_STATUS, "Test::Handles passed."); } |