First public contribution.
2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Defines interface that all test objects comply with
20 #ifndef __TESTBASE_H__
21 #define __TESTBASE_H__
24 #include "t_testactionspec.h"
25 #include "testparameter.h"
26 #include "t_testaction.h"
30 class CASN1NormalTest;
32 #define KErrASN1EncodingError 100
34 class CTestBase : public CBase
37 // What's the name of this test?
38 virtual void GetName(TDes& aBuf) = 0;
39 // What's it parameter format in script file
41 // Run the test, Leave if things go wrong (ie alloc failure).
42 // Leaving with KErrASN1EncodingError means a problem with the
43 // encoder or the decoder functionality.
44 virtual TBool PerformTestsL(CConsoleBase& aConsole) = 0;
45 CTestAction::TScriptError ConstructL(const TTestActionSpec& aTestActionSpec);
49 CTestBase(CASN1NormalTest &aASN1Action);
50 void OutputEncodingL(CConsoleBase& aConsole, TDesC8& aData);
51 CTestAction::TScriptError CheckValueParametersL(const TDesC& aParameters);
52 CTestAction::TScriptError CheckRandomParametersL(const TDesC& aParameters);
53 TBool CountTests(TInt &aTotalTests);
54 CASN1NormalTest &iASN1Action;
58 virtual void FillParameterArray(void) = 0;
59 RArray<CTestParameter::TType> *iParameters;
60 RPointerArray<CTestParameter> *iValues;
63 TBuf<KMaxErrorSize> iSyntaxErrorDescription;