First public contribution.
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
 
     2 // All rights reserved.
 
     3 // This component and the accompanying materials are made available
 
     4 // under the terms of "Eclipse Public License v1.0"
 
     5 // which accompanies this distribution, and is available
 
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    14 // This file contains the test steps for Unit Test Suite 00 : TestFrameworkMain.cpp
 
    21 // Test system includes
 
    22 #include <testframework.h>
 
    24 // Specific includes for this test suite
 
    25 #include "TestFrameworkMain.h"
 
    26 #include "TSU_MmTsthSuite00.h"
 
    28 // Specific includes for these test steps
 
    29 #include "TSU_MmTsth00.h"
 
    31 // --------------------------------------------
 
    33 // Unit Test Suite 00 : TestFrameworkMain.cpp
 
    37 // 1 Construct a CTestFrameworkMain
 
    39 // (Other tests are specific to member classes!)
 
    41 // ---------------------
 
    44 RTestMmTsthU0001* RTestMmTsthU0001::NewL()
 
    46 	RTestMmTsthU0001* self = new(ELeave) RTestMmTsthU0001;
 
    50 // Each test step initialises its own name.
 
    51 RTestMmTsthU0001::RTestMmTsthU0001()
 
    53 	iTestStepName = _L("MM-TSTH-U-0001");
 
    57 TVerdict RTestMmTsthU0001::OpenL()
 
    59 	return iTestStepResult = EPass;
 
    63 void RTestMmTsthU0001::Close()
 
    68 TVerdict RTestMmTsthU0001::DoTestStepL()
 
    70 	TVerdict currentVerdict = EPass;
 
    72 	INFO_PRINTF1(_L("Unit test for TestFrameworkMain"));
 
    74 	CTestFrameworkMain* theTest = CTestFrameworkMain::NewLC();
 
    76 	// NB we can't run a second instance of CTestFrameworkMain (i.e. call StartTestingL())
 
    77 	// without causing the old one to close at cleanup, stopping all tests.
 
    78 	// Therefore our useful testing is limited to ensuring a CTestFrameworkMain
 
    79 	// constructs correctly
 
    81 	// check a log has been constructed. if it is not NULL, we've passed
 
    82 	CLog* theLog = theTest->LogClient();
 
    84 		INFO_PRINTF1(_L("CTestFramework constructed correctly"));
 
    86 	CleanupStack::PopAndDestroy(theTest);
 
    88 	// we pass if we haven't left
 
    89 	return iTestStepResult = currentVerdict; // should be EPass if we've got here