os/mm/mmtestenv/mmtestfwunittest/src/tsu_stubs/TestSuiteVirtualStub.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// This file is a helper for TestFramework Unit Test classes.
sl@0
    15
// It subclasses the abstract CTestSuite to produce a working class we can test
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
// EPOC includes
sl@0
    20
#include <e32base.h>
sl@0
    21
sl@0
    22
// Test system includes
sl@0
    23
#include <testframework.h>
sl@0
    24
#include "TestStepVirtualStub.h"
sl@0
    25
#include "TestSuiteVirtualStub.h"
sl@0
    26
sl@0
    27
sl@0
    28
// do not export if Unit Testing
sl@0
    29
#if defined (__TSU_TESTFRAMEWORK__)
sl@0
    30
#undef EXPORT_C
sl@0
    31
#define EXPORT_C
sl@0
    32
sl@0
    33
// define only if not Unit Testing
sl@0
    34
#else
sl@0
    35
sl@0
    36
sl@0
    37
// Create an instance of this test suite.
sl@0
    38
// NewTestSuiteVirtualStubL is exported at ordinal 1.
sl@0
    39
// This provides the interface to allow the Test Framework
sl@0
    40
// to create instances of this test suite.
sl@0
    41
EXPORT_C CTestSuiteVirtualStub* NewTestSuiteVirtualStubL() 
sl@0
    42
    { 
sl@0
    43
	CTestSuiteVirtualStub* result = new (ELeave) CTestSuiteVirtualStub;
sl@0
    44
	CleanupStack::PushL(result);
sl@0
    45
	result->ConstructL();
sl@0
    46
	CleanupStack::Pop(); // result
sl@0
    47
	return result;
sl@0
    48
    }
sl@0
    49
#endif
sl@0
    50
sl@0
    51
// destructor
sl@0
    52
CTestSuiteVirtualStub::~CTestSuiteVirtualStub()
sl@0
    53
	{
sl@0
    54
	}
sl@0
    55
sl@0
    56
_LIT(KTxtVersion,"CTestSuiteVirtualStub Version");
sl@0
    57
sl@0
    58
// Get test suite version.
sl@0
    59
TPtrC CTestSuiteVirtualStub::GetVersion() const
sl@0
    60
	{
sl@0
    61
	return KTxtVersion();
sl@0
    62
	}
sl@0
    63
sl@0
    64
// Initialiser for test suite.
sl@0
    65
// This creates all the test steps and stores them
sl@0
    66
// inside CTestSuiteVirtualStub
sl@0
    67
void CTestSuiteVirtualStub::InitialiseL()
sl@0
    68
	{
sl@0
    69
sl@0
    70
	// store the name of this test suite
sl@0
    71
	iSuiteName = KTestSuiteVirtualStub;
sl@0
    72
sl@0
    73
	// add test steps
sl@0
    74
	AddTestStepL(RTestStepVirtualStub::NewL());
sl@0
    75
sl@0
    76
	}