sl@0: // Copyright (c) 2002-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 "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: // sl@0: sl@0: // EPOC includes sl@0: #include sl@0: sl@0: // Test system includes sl@0: #include sl@0: #include "TSU_MmTsthStep13.h" sl@0: #include "TSU_MmTsthSuite13.h" sl@0: sl@0: // preamble sl@0: TVerdict RTSUMmTsthStep13::OpenL() sl@0: { sl@0: // initialise iTestUtils for tests. if this fails, tests are sl@0: // inconclusive (will not run) sl@0: CLog* theLog = iSuite->LogSystem(); // use the current log sl@0: CTestUtils* theTestUtils = NULL; sl@0: TRAPD(err, theTestUtils = CTestUtils::NewL(theLog)); sl@0: if(err != KErrNone) sl@0: { sl@0: ERR_PRINTF2(_L("CTestUtils::NewL() failed in preamble, error code %d"), err); sl@0: return iTestStepResult = EInconclusive; sl@0: } sl@0: iTestUtils = theTestUtils; sl@0: return iTestStepResult = EPass; sl@0: } sl@0: sl@0: // postamble sl@0: void RTSUMmTsthStep13::Close() sl@0: { sl@0: delete iTestUtils; sl@0: } sl@0: sl@0: // Cleanup file system after tests. sl@0: // NB - any file locks or read-only flags MUST be cleared sl@0: // by the test itself before calling this method. sl@0: // We do not intend to check return codes from this function, as sl@0: // not all the files/directories we intend to remove will sl@0: // necessarily exist. sl@0: void RTSUMmTsthStep13::CleanupFileSystem() sl@0: { sl@0: RFs theFs; sl@0: CFileMan* theFm = NULL; sl@0: theFs.Connect(); sl@0: TRAPD(err, theFm = CFileMan::NewL(theFs)); sl@0: if(err != KErrNone) sl@0: { sl@0: ERR_PRINTF2(_L("Cannot create CFileMan, error code %d"), err); sl@0: theFs.Close(); sl@0: } sl@0: sl@0: theFm->RmDir(_L("c:\\TFData1\\")); sl@0: theFm->RmDir(_L("c:\\TFData2\\")); sl@0: theFs.Close(); sl@0: delete theFm; sl@0: }