sl@0: /* sl@0: * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Defines interface that all test objects comply with sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __TESTBASE_H__ sl@0: #define __TESTBASE_H__ sl@0: sl@0: #include sl@0: #include "t_testactionspec.h" sl@0: #include "testparameter.h" sl@0: #include "t_testaction.h" sl@0: sl@0: sl@0: class CConsoleBase; sl@0: class CASN1NormalTest; sl@0: sl@0: #define KErrASN1EncodingError 100 sl@0: sl@0: class CTestBase : public CBase sl@0: { sl@0: public: sl@0: // What's the name of this test? sl@0: virtual void GetName(TDes& aBuf) = 0; sl@0: // What's it parameter format in script file sl@0: sl@0: // Run the test, Leave if things go wrong (ie alloc failure). sl@0: // Leaving with KErrASN1EncodingError means a problem with the sl@0: // encoder or the decoder functionality. sl@0: virtual TBool PerformTestsL(CConsoleBase& aConsole) = 0; sl@0: CTestAction::TScriptError ConstructL(const TTestActionSpec& aTestActionSpec); sl@0: virtual ~CTestBase(); sl@0: sl@0: protected: sl@0: CTestBase(CASN1NormalTest &aASN1Action); sl@0: void OutputEncodingL(CConsoleBase& aConsole, TDesC8& aData); sl@0: CTestAction::TScriptError CheckValueParametersL(const TDesC& aParameters); sl@0: CTestAction::TScriptError CheckRandomParametersL(const TDesC& aParameters); sl@0: TBool CountTests(TInt &aTotalTests); sl@0: CASN1NormalTest &iASN1Action; sl@0: sl@0: // virtual functions sl@0: protected: sl@0: virtual void FillParameterArray(void) = 0; sl@0: RArray *iParameters; sl@0: RPointerArray *iValues; sl@0: sl@0: public: sl@0: TBuf iSyntaxErrorDescription; sl@0: }; sl@0: sl@0: #endif sl@0: