|
0
|
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".
|
|
|
7 |
//
|
|
|
8 |
// Initial Contributors:
|
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
|
10 |
//
|
|
|
11 |
// Contributors:
|
|
|
12 |
//
|
|
|
13 |
// Description:
|
|
|
14 |
// This file contains the test steps for Unit Test Suite 00 : TestFrameworkMain.cpp
|
|
|
15 |
//
|
|
|
16 |
//
|
|
|
17 |
|
|
|
18 |
// EPOC includes
|
|
|
19 |
#include <e32base.h>
|
|
|
20 |
|
|
|
21 |
// Test system includes
|
|
|
22 |
#include <testframework.h>
|
|
|
23 |
|
|
|
24 |
// Specific includes for this test suite
|
|
|
25 |
#include "TestFrameworkMain.h"
|
|
|
26 |
#include "TSU_MmTsthSuite00.h"
|
|
|
27 |
|
|
|
28 |
// Specific includes for these test steps
|
|
|
29 |
#include "TSU_MmTsth00.h"
|
|
|
30 |
|
|
|
31 |
// --------------------------------------------
|
|
|
32 |
|
|
|
33 |
// Unit Test Suite 00 : TestFrameworkMain.cpp
|
|
|
34 |
// Depends on : none
|
|
|
35 |
|
|
|
36 |
// Tests :-
|
|
|
37 |
// 1 Construct a CTestFrameworkMain
|
|
|
38 |
|
|
|
39 |
// (Other tests are specific to member classes!)
|
|
|
40 |
|
|
|
41 |
// ---------------------
|
|
|
42 |
// RTestMmTsthU0001
|
|
|
43 |
|
|
|
44 |
RTestMmTsthU0001* RTestMmTsthU0001::NewL()
|
|
|
45 |
{
|
|
|
46 |
RTestMmTsthU0001* self = new(ELeave) RTestMmTsthU0001;
|
|
|
47 |
return self;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
// Each test step initialises its own name.
|
|
|
51 |
RTestMmTsthU0001::RTestMmTsthU0001()
|
|
|
52 |
{
|
|
|
53 |
iTestStepName = _L("MM-TSTH-U-0001");
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
// preamble
|
|
|
57 |
TVerdict RTestMmTsthU0001::OpenL()
|
|
|
58 |
{
|
|
|
59 |
return iTestStepResult = EPass;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
// postamble
|
|
|
63 |
void RTestMmTsthU0001::Close()
|
|
|
64 |
{
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
// Do the test step.
|
|
|
68 |
TVerdict RTestMmTsthU0001::DoTestStepL()
|
|
|
69 |
{
|
|
|
70 |
TVerdict currentVerdict = EPass;
|
|
|
71 |
|
|
|
72 |
INFO_PRINTF1(_L("Unit test for TestFrameworkMain"));
|
|
|
73 |
|
|
|
74 |
CTestFrameworkMain* theTest = CTestFrameworkMain::NewLC();
|
|
|
75 |
|
|
|
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
|
|
|
80 |
|
|
|
81 |
// check a log has been constructed. if it is not NULL, we've passed
|
|
|
82 |
CLog* theLog = theTest->LogClient();
|
|
|
83 |
if(theLog != NULL)
|
|
|
84 |
INFO_PRINTF1(_L("CTestFramework constructed correctly"));
|
|
|
85 |
|
|
|
86 |
CleanupStack::PopAndDestroy(theTest);
|
|
|
87 |
|
|
|
88 |
// we pass if we haven't left
|
|
|
89 |
return iTestStepResult = currentVerdict; // should be EPass if we've got here
|
|
|
90 |
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
|