Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "TestRecord.h"
17 #include "OpenFileByHandle0524.h"
24 CTestMmfVclntOpenFile0524::CTestMmfVclntOpenFile0524(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName,const TBool aRec)
25 : CTestMmfVclntOpenFile0523(aTestName, aSectName, aKeyName, aRec)
29 CTestMmfVclntOpenFile0524* CTestMmfVclntOpenFile0524::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aRec)
31 CTestMmfVclntOpenFile0524* self = new (ELeave) CTestMmfVclntOpenFile0524(aTestName,aSectName,aKeyName,aRec);
35 CTestMmfVclntOpenFile0524* CTestMmfVclntOpenFile0524::NewLC(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aRec)
37 CTestMmfVclntOpenFile0524* self = CTestMmfVclntOpenFile0524::NewL(aTestName,aSectName,aKeyName,aRec);
38 CleanupStack::PushL(self);
43 * Load and initialise an audio file.
45 TVerdict CTestMmfVclntOpenFile0524::DoTestStepL()
47 TVerdict iAllocTestStepResult=EPass;
49 TBool result = EFalse;
51 //>>>>>>>>>>>>>>>>>>>>>>>>Test Method Call<<<<<<<<<<<<<<<<<<<<<<<<<<
52 if( PerformTestStepL() != EPass )
59 INFO_PRINTF2(_L("Test error, returned error code = %d"), err);
64 //Check the iAllocTestStepResult
65 if (iAllocTestStepResult != EPass)
72 TBool completed = EFalse;
73 iAllocTestStepResult = EPass; // TODO check?? assume pass
74 TBool reachedEnd = EFalse; // Note: declare outside loop to help with debugging
77 __UHEAP_SETFAIL(RHeap::EFailNext, failCount);
80 //INFO_PRINTF2(_L("CVideoRecorderUtility: Alloc Test Loop: %d"), failCount);
82 //>>>>>>>>>>>>>>>>>>>>>>>>Test Method Call<<<<<<<<<<<<<<<<<<<<<<<<<<
83 TVerdict verdict = EFail;
84 TRAP(err, verdict = PerformTestStepL())
85 if (err == KErrNone && verdict != EPass)
93 TAny *testAlloc = User::Alloc(1); // when this fails, we passed through all allocs within test
94 if (testAlloc == NULL)
101 User::Free(testAlloc);
104 //Check the iAllocTestStepResult
105 if (iAllocTestStepResult != EPass)
110 completed = reachedEnd || result;
112 else if (err != KErrNoMemory) // bad error code
119 __UHEAP_SETFAIL(RHeap::ENone, 0);
129 failCount -= 1; // Failcount of 1 equates to 0 successful allocs, etc
131 if (err != KErrNone || result)
133 iAllocTestStepResult = EFail;
137 format.Format(_L(" Bad result with %d memory allocations tested\n"), failCount);
141 format.Format(_L(" Error(%d) with %d memory allocations tested\n"), err, failCount);
148 format.Format(_L(" Completed OK with %d memory allocations tested\n"), failCount);
152 return iAllocTestStepResult;