First public contribution.
1 // Copyright (c) 2007-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 the License "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.
21 #include <e32std_private.h>
22 #include <u32std.h> // unicode builds
24 #include <e32base_private.h>
25 #include <e32Test.h> // RTest headder
26 #include "testcaseroot.h"
27 #include "testcasefactory.h"
28 #include "testcase0456.h"
33 // the name below is used to add a pointer to our construction method to a pointer MAP in
35 _LIT(KTestCaseId,"PBASE-USB_OTGDI-0456");
36 const TTestCaseFactoryReceipt<CTestCase0456> CTestCase0456::iFactoryReceipt(KTestCaseId);
39 CTestCase0456* CTestCase0456::NewL(TBool aHost)
42 CTestCase0456* self = new (ELeave) CTestCase0456(aHost);
43 CleanupStack::PushL(self);
45 CleanupStack::Pop(self);
50 CTestCase0456::CTestCase0456(TBool aHost)
51 : CTestCaseRoot(KTestCaseId, aHost)
60 void CTestCase0456::ConstructL()
63 iRepeats = OPEN_REPEATS;
69 CTestCase0456::~CTestCase0456()
77 void CTestCase0456::ExecuteTestCaseL()
80 iCaseStep = EPreconditions;
82 CActiveScheduler::Add(this);
87 void CTestCase0456::DescribePreconditions()
89 test.Printf(_L("Insert A connector beforehand.\n"));
93 void CTestCase0456::DoCancel()
102 // handle event completion
103 void CTestCase0456::RunStepL()
107 // Obtain the completion code for this CActive obj.
108 TInt completionCode(iStatus.Int());
114 test.Printf(KPressAnyKeyToStart);
115 iCaseStep = ELoadLdd;
122 test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
128 iCaseStep = EUnloadLdd;
132 if (EFalse == StepUnloadLDD())
133 return TestFailed(KErrAbort,_L("Unload Ldd failure"));
135 iCaseStep = ELoopDecrement;
140 test.Printf(_L("Repeat test\n"));
143 iCaseStep = ELoadLdd;
145 iCaseStep = ELastStep;
156 test.Printf(_L("<Error> unknown test step"));
158 TestPolicy().SignalTestComplete(KErrCorrupt);