|
1 // Copyright (c) 2007-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 // UloggerFilePluginTest.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "uloggersysstarttest.h" |
|
19 using namespace Ulogger; |
|
20 |
|
21 |
|
22 |
|
23 /* |
|
24 * TestStart: Test the start method ??? |
|
25 * |
|
26 * Expected Verdict: PASS/FAIL/PANIC |
|
27 * |
|
28 * Prerequisites: |
|
29 * |
|
30 * Description: Invoke CULoggerSysStarter::Start() and check that the start metod works |
|
31 * |
|
32 */ |
|
33 void CSysStart0Step::TestStart() |
|
34 { |
|
35 INFO_PRINTF1(_L("Checking that CSysStart0Step::Start works fine")); |
|
36 |
|
37 INFO_PRINTF1(_L("Writing 'Test' to the log using CULoggerSysStarter::Write()")); |
|
38 Ulogger::SysStart(); |
|
39 |
|
40 } |
|
41 |
|
42 |
|
43 |
|
44 CSysStart0Step::~CSysStart0Step() |
|
45 { |
|
46 } |
|
47 |
|
48 CSysStart0Step::CSysStart0Step() |
|
49 /** |
|
50 * Constructor |
|
51 */ |
|
52 { |
|
53 // **MUST** call SetTestStepName in the constructor as the controlling |
|
54 // framework uses the test step name immediately following construction to set |
|
55 // up the step's unique logging ID. |
|
56 SetTestStepName(KSysStart0Step); |
|
57 } |
|
58 |
|
59 TVerdict CSysStart0Step::doTestStepPreambleL() |
|
60 { |
|
61 CTe_sysstartSuiteStepBase::doTestStepPreambleL(); |
|
62 |
|
63 INFO_PRINTF1(_L("Connecting to file server")); |
|
64 SetTestStepResult(EPass); |
|
65 return TestStepResult(); |
|
66 } |
|
67 |
|
68 TVerdict CSysStart0Step::doTestStepL() |
|
69 /** |
|
70 * @return - TVerdict code |
|
71 * Override of base class pure virtual |
|
72 * Our implementation only gets called if the base class doTestStepPreambleL() did |
|
73 * not leave. That being the case, the current test result value will be EPass. |
|
74 */ |
|
75 { |
|
76 if (TestStepResult()==EPass) |
|
77 { |
|
78 TestStart(); |
|
79 |
|
80 if(iErrors == 0) |
|
81 SetTestStepResult(EPass); |
|
82 else |
|
83 { |
|
84 SetTestStepResult(EFail); |
|
85 TBuf<64> buf; |
|
86 INFO_PRINTF1(_L("********")); |
|
87 buf.AppendFormat(_L("%d errors were found!"), iErrors); |
|
88 INFO_PRINTF1(buf); |
|
89 INFO_PRINTF1(_L("********")); |
|
90 } |
|
91 } |
|
92 return TestStepResult(); |
|
93 } |
|
94 |
|
95 TVerdict CSysStart0Step::doTestStepPostambleL() |
|
96 /** |
|
97 * @return - TVerdict code |
|
98 * Override of base class virtual |
|
99 */ |
|
100 { |
|
101 CTe_sysstartSuiteStepBase::doTestStepPostambleL(); |
|
102 SetTestStepResult(EPass); |
|
103 return TestStepResult(); |
|
104 } |