Update contrib.
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.
15 // Open/Close 'disconnected' test
20 #include <e32std_private.h>
21 #include <u32std.h> // unicode builds
23 #include <e32base_private.h>
24 #include <e32Test.h> // RTest headder
25 #include "testcaseroot.h"
26 #include "testcase0457.h"
30 // the name below is used to add a pointer to our construction method to a pointer MAP in
32 _LIT(KTestCaseId,"PBASE-USB_OTGDI-0457");
33 const TTestCaseFactoryReceipt<CTestCase0457> CTestCase0457::iFactoryReceipt(KTestCaseId);
35 // # times to repeat the steps
36 #define OPEN_REPEATS gOpenIterations
38 CTestCase0457* CTestCase0457::NewL(TBool aHost)
41 CTestCase0457* self = new (ELeave) CTestCase0457(aHost);
42 CleanupStack::PushL(self);
44 CleanupStack::Pop(self);
49 CTestCase0457::CTestCase0457(TBool aHost)
50 : CTestCaseRoot(KTestCaseId, aHost)
59 void CTestCase0457::ConstructL()
62 iRepeats = OPEN_REPEATS;
68 CTestCase0457::~CTestCase0457()
76 void CTestCase0457::ExecuteTestCaseL()
79 iCaseStep = EPreconditions;
81 CActiveScheduler::Add(this);
86 void CTestCase0457::DescribePreconditions()
88 test.Printf(_L("Remove any USB plug beforehand.\n"));
92 void CTestCase0457::DoCancel()
101 // handle event completion
102 void CTestCase0457::RunStepL()
106 // Obtain the completion code for this CActive obj.
107 TInt completionCode(iStatus.Int());
113 test.Printf(KPressAnyKeyToStart);
114 iCaseStep = ELoadLdd;
120 test.Printf(_L("Load the LDD iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS);
126 iCaseStep = EUnloadLdd;
130 if (EFalse == StepUnloadLDD())
131 return TestFailed(KErrAbort,_L("Unload Ldd failure"));
133 iCaseStep = ELoopDecrement;
138 test.Printf(_L("Repeat test\n"));
141 iCaseStep = ELoadLdd;
143 iCaseStep = ELastStep;
154 test.Printf(_L("<Error> unknown test step"));
156 TestPolicy().SignalTestComplete(KErrCorrupt);