sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\misc\t_zip.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include "crash_gzip.h" sl@0: sl@0: sl@0: TInt64 CrashTime() {return 0;} sl@0: sl@0: RFs TheFs; sl@0: RFile TheOutFile; sl@0: sl@0: class TCrashTestGzip : public MCrashGzip sl@0: { sl@0: public: sl@0: sl@0: void SetOutput(); sl@0: virtual TBool Out(const TDesC8& aDes); sl@0: virtual TInt32 GetMaxLength(); sl@0: }; sl@0: sl@0: RTest test(_L("T_ZIP")); sl@0: sl@0: void TCrashTestGzip::SetOutput() sl@0: { sl@0: TInt r=TheOutFile.Replace(TheFs, _L("c:\\out.zip"),EFileWrite); sl@0: test(r==KErrNone); sl@0: Init(); sl@0: } sl@0: sl@0: sl@0: TInt TCrashTestGzip::Out(const TDesC8& aDes) sl@0: { sl@0: TInt r = TheOutFile.Write(aDes); sl@0: test(r==KErrNone); sl@0: return KErrNone; sl@0: } sl@0: sl@0: sl@0: TInt32 TCrashTestGzip::GetMaxLength() sl@0: { sl@0: return -1; sl@0: } sl@0: sl@0: sl@0: _LIT8(KText, "12345"); sl@0: sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: test.Title(); sl@0: sl@0: test.Start(_L("Connect to file server")); sl@0: TInt r=TheFs.Connect(); sl@0: test(r==KErrNone); sl@0: sl@0: test.Next(_L("Making zip file")); sl@0: TCrashTestGzip zip; sl@0: zip.SetOutput(); sl@0: zip.Write(KText); sl@0: zip.FlushEnd(); sl@0: sl@0: TheOutFile.Close(); sl@0: TheFs.Close(); sl@0: sl@0: return KErrNone; sl@0: } sl@0: