os/mm/mmtestenv/mmtestfwunittest/src/tsu_stubs/TestSuiteVirtualStub.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmtestenv/mmtestfwunittest/src/tsu_stubs/TestSuiteVirtualStub.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,76 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This file is a helper for TestFramework Unit Test classes.
    1.18 +// It subclasses the abstract CTestSuite to produce a working class we can test
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +// EPOC includes
    1.23 +#include <e32base.h>
    1.24 +
    1.25 +// Test system includes
    1.26 +#include <testframework.h>
    1.27 +#include "TestStepVirtualStub.h"
    1.28 +#include "TestSuiteVirtualStub.h"
    1.29 +
    1.30 +
    1.31 +// do not export if Unit Testing
    1.32 +#if defined (__TSU_TESTFRAMEWORK__)
    1.33 +#undef EXPORT_C
    1.34 +#define EXPORT_C
    1.35 +
    1.36 +// define only if not Unit Testing
    1.37 +#else
    1.38 +
    1.39 +
    1.40 +// Create an instance of this test suite.
    1.41 +// NewTestSuiteVirtualStubL is exported at ordinal 1.
    1.42 +// This provides the interface to allow the Test Framework
    1.43 +// to create instances of this test suite.
    1.44 +EXPORT_C CTestSuiteVirtualStub* NewTestSuiteVirtualStubL() 
    1.45 +    { 
    1.46 +	CTestSuiteVirtualStub* result = new (ELeave) CTestSuiteVirtualStub;
    1.47 +	CleanupStack::PushL(result);
    1.48 +	result->ConstructL();
    1.49 +	CleanupStack::Pop(); // result
    1.50 +	return result;
    1.51 +    }
    1.52 +#endif
    1.53 +
    1.54 +// destructor
    1.55 +CTestSuiteVirtualStub::~CTestSuiteVirtualStub()
    1.56 +	{
    1.57 +	}
    1.58 +
    1.59 +_LIT(KTxtVersion,"CTestSuiteVirtualStub Version");
    1.60 +
    1.61 +// Get test suite version.
    1.62 +TPtrC CTestSuiteVirtualStub::GetVersion() const
    1.63 +	{
    1.64 +	return KTxtVersion();
    1.65 +	}
    1.66 +
    1.67 +// Initialiser for test suite.
    1.68 +// This creates all the test steps and stores them
    1.69 +// inside CTestSuiteVirtualStub
    1.70 +void CTestSuiteVirtualStub::InitialiseL()
    1.71 +	{
    1.72 +
    1.73 +	// store the name of this test suite
    1.74 +	iSuiteName = KTestSuiteVirtualStub;
    1.75 +
    1.76 +	// add test steps
    1.77 +	AddTestStepL(RTestStepVirtualStub::NewL());
    1.78 +
    1.79 +	}