First public contribution.
1 #ifndef __TEST_POLICY_H
2 #define __TEST_POLICY_H
5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
7 * This component and the accompanying materials are made available
8 * under the terms of the License "Eclipse Public License v1.0"
9 * which accompanies this distribution, and is available
10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
12 * Initial Contributors:
13 * Nokia Corporation - initial contribution.
27 #include <d32usbdi_hubdriver.h>
32 namespace NUnitTesting_USBDI
35 // Forward declarations
41 class CBasicTestPolicy : public CActive
44 static CBasicTestPolicy* NewL();
50 virtual ~CBasicTestPolicy();
53 Run the test case with the specified identity and receive notification of test case
54 success or failiure completion
55 @param aTestCaseId the identity of the test case to run
56 @param aStatus the request status of the entity that wants test case completion notification
59 virtual void RunTestCaseL(const TDesC& aTestCaseId,TRequestStatus& aStatus);
64 virtual void SignalTestComplete(TInt aCompletionCode);
73 TInt RunError(TInt aError);
76 CBaseTestCase* iTestCase;
77 TRequestStatus* iNotifierStatus;
82 class CThreadTestPolicy : public CBasicTestPolicy
85 static CThreadTestPolicy* NewL();
91 virtual ~CThreadTestPolicy();
94 Run the test case with the specified identity and receive notification of test case
95 success or failiure completion
96 @param aTestCaseId the identity of the test case to run
97 @param aStatus the request status of the entity that wants test case completion notification
100 virtual void RunTestCaseL(const TDesC& aTestCaseId,TRequestStatus& aStatus);
105 virtual void SignalTestComplete(TInt aCompletionCode);
110 TInt RunError(TInt aError);
117 static TInt ThreadFunction(TAny* aThreadParameter);
118 static TInt DoTestL(const TDesC& aTestCaseId);
122 Each test case executes its test code in a spawned thread, so iTestThread is
123 the handle to the spawned test thread