os/mm/mmtestenv/mmtestfwunittest/src/tsu_mmtsth00/TSU_MmTsth00.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_mmtsth00/TSU_MmTsth00.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,93 @@
     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 contains the test steps for Unit Test Suite 00 : TestFrameworkMain.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +// EPOC includes
    1.22 +#include <e32base.h>
    1.23 +
    1.24 +// Test system includes
    1.25 +#include <testframework.h>
    1.26 +
    1.27 +// Specific includes for this test suite
    1.28 +#include "TestFrameworkMain.h"
    1.29 +#include "TSU_MmTsthSuite00.h"
    1.30 +
    1.31 +// Specific includes for these test steps
    1.32 +#include "TSU_MmTsth00.h"
    1.33 +
    1.34 +// --------------------------------------------
    1.35 +
    1.36 +// Unit Test Suite 00 : TestFrameworkMain.cpp
    1.37 +// Depends on : none
    1.38 +
    1.39 +// Tests :-
    1.40 +// 1 Construct a CTestFrameworkMain
    1.41 +
    1.42 +// (Other tests are specific to member classes!)
    1.43 +
    1.44 +// ---------------------
    1.45 +// RTestMmTsthU0001
    1.46 +
    1.47 +RTestMmTsthU0001* RTestMmTsthU0001::NewL()
    1.48 +	{
    1.49 +	RTestMmTsthU0001* self = new(ELeave) RTestMmTsthU0001;
    1.50 +	return self;
    1.51 +	}
    1.52 +
    1.53 +// Each test step initialises its own name.
    1.54 +RTestMmTsthU0001::RTestMmTsthU0001()
    1.55 +	{
    1.56 +	iTestStepName = _L("MM-TSTH-U-0001");
    1.57 +	}
    1.58 +
    1.59 +// preamble
    1.60 +TVerdict RTestMmTsthU0001::OpenL()
    1.61 +	{
    1.62 +	return iTestStepResult = EPass;
    1.63 +	}
    1.64 +
    1.65 +// postamble
    1.66 +void RTestMmTsthU0001::Close()
    1.67 +	{
    1.68 +	}
    1.69 +
    1.70 +// Do the test step.
    1.71 +TVerdict RTestMmTsthU0001::DoTestStepL()
    1.72 +	{
    1.73 +	TVerdict currentVerdict = EPass;
    1.74 +
    1.75 +	INFO_PRINTF1(_L("Unit test for TestFrameworkMain"));
    1.76 +
    1.77 +	CTestFrameworkMain* theTest = CTestFrameworkMain::NewLC();
    1.78 +
    1.79 +	// NB we can't run a second instance of CTestFrameworkMain (i.e. call StartTestingL())
    1.80 +	// without causing the old one to close at cleanup, stopping all tests.
    1.81 +	// Therefore our useful testing is limited to ensuring a CTestFrameworkMain
    1.82 +	// constructs correctly
    1.83 +
    1.84 +	// check a log has been constructed. if it is not NULL, we've passed
    1.85 +	CLog* theLog = theTest->LogClient();
    1.86 +	if(theLog != NULL)
    1.87 +		INFO_PRINTF1(_L("CTestFramework constructed correctly"));
    1.88 +
    1.89 +	CleanupStack::PopAndDestroy(theTest);
    1.90 +
    1.91 +	// we pass if we haven't left
    1.92 +	return iTestStepResult = currentVerdict; // should be EPass if we've got here
    1.93 +
    1.94 +	}
    1.95 +
    1.96 +