From 81132947f2f70d4a4b7423d8b718b662bcefaef9 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 28 Feb 2012 00:05:31 -0800 Subject: Adding a short test for the ZStreams. --- tests/test-Handles.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') 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 #include #include +#include #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 o(new Output("tests/out.z")); + IO z(new ZStream(o)); + z->detach(); + z->writeString("foobar\n"); + } + + { + IO o(new Output("tests/out.gz")); + IO z(new ZStream(o, Z_BEST_COMPRESSION, ZStream::GZIP)); + z->detach(); + z->writeString("foobar\n"); + } + + { + IO o(new Output("tests/out.raw")); + IO z(new ZStream(o, Z_BEST_COMPRESSION, ZStream::RAW)); + z->detach(); + z->writeString("foobar\n"); + } + Printer::log(M_STATUS, "Test::Handles passed."); } -- cgit v1.2.3