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 "TestPlayer.h"
17 #include "OpenFileByHandle0036.h"
20 #include <ecom/ecom.h>
25 CTestMmfVclntOpenFile0036::CTestMmfVclntOpenFile0036(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay)
26 :CTestMmfVclntOpenFile0034(aTestName, aSectName, aKeyName, aPlay)
30 CTestMmfVclntOpenFile0036* CTestMmfVclntOpenFile0036::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay)
32 CTestMmfVclntOpenFile0036* self = new (ELeave) CTestMmfVclntOpenFile0036(aTestName,aSectName,aKeyName,aPlay);
36 CTestMmfVclntOpenFile0036* CTestMmfVclntOpenFile0036::NewLC(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay)
38 CTestMmfVclntOpenFile0036* self = CTestMmfVclntOpenFile0036::NewL(aTestName,aSectName,aKeyName,aPlay);
39 CleanupStack::PushL(self);
44 * Load and initialise an audio file.
46 TVerdict CTestMmfVclntOpenFile0036::DoTestStepL()
48 TVerdict iAllocTestStepResult=EPass;
50 TBool result = EFalse;
55 //>>>>>>>>>>>>>>>>>>>>>>>>Test Method Call<<<<<<<<<<<<<<<<<<<<<<<<<<
56 if( PerformTestStepL() != EPass )
63 INFO_PRINTF2(_L("Test error, returned error code = %d"), err);
68 //Check the iAllocTestStepResult
69 if (iAllocTestStepResult != EPass)
76 TBool completed = EFalse;
77 iAllocTestStepResult = EPass; // TODO check?? assume pass
78 TBool reachedEnd = EFalse; // Note: declare outside loop to help with debugging
81 __UHEAP_SETFAIL(RHeap::EFailNext, failCount);
84 //INFO_PRINTF2(_L("CVideoPlayerUtility: Alloc Test Loop: %d"), failCount);
85 //>>>>>>>>>>>>>>>>>>>>>>>>Test Method Call<<<<<<<<<<<<<<<<<<<<<<<<<<
86 TVerdict verdict = EFail;
87 TRAP(err, verdict = PerformTestStepL());
88 if (err == KErrNone && verdict != EPass)
96 TAny *testAlloc = User::Alloc(1); // when this fails, we passed through all allocs within test
97 if (testAlloc == NULL)
104 User::Free(testAlloc);
107 //Check the iAllocTestStepResult
108 if (iAllocTestStepResult != EPass)
113 completed = reachedEnd || result;
115 else if (err != KErrNoMemory) // bad error code
122 __UHEAP_SETFAIL(RHeap::ENone, 0);
132 failCount -= 1; // Failcount of 1 equates to 0 successful allocs, etc
134 if (err != KErrNone || result)
136 iAllocTestStepResult = EFail;
140 format.Format(_L(" Bad result with %d memory allocations tested\n"), failCount);
144 format.Format(_L(" Error(%d) with %d memory allocations tested\n"), err, failCount);
151 format.Format(_L(" Completed OK with %d memory allocations tested\n"), failCount);
155 return iAllocTestStepResult;