|
1 // Copyright (c) 2006-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 // |
|
15 |
|
16 /** |
|
17 @file te_createconfigfullstep.cpp |
|
18 */ |
|
19 |
|
20 #include "te_createconfigfullstep.h" |
|
21 #include "te_clearconfig.h" |
|
22 #include "uloggerdatatypes.h" |
|
23 |
|
24 using namespace Ulogger; |
|
25 |
|
26 CCreateConfigFUllTestStep::~CCreateConfigFUllTestStep() |
|
27 /** |
|
28 * Destructor |
|
29 */ |
|
30 { |
|
31 } |
|
32 |
|
33 CCreateConfigFUllTestStep::CCreateConfigFUllTestStep() |
|
34 /** |
|
35 * Constructor |
|
36 */ |
|
37 { |
|
38 // **MUST** call SetTestStepName in the constructor as the controlling |
|
39 // framework uses the test step name immediately following construction to set |
|
40 // up the step's unique logging ID. |
|
41 SetTestStepName(KCreateConfigFullStep); |
|
42 } |
|
43 |
|
44 |
|
45 /** |
|
46 * Override of base class virtual |
|
47 * @return - TVerdict code |
|
48 * |
|
49 */ |
|
50 TVerdict CCreateConfigFUllTestStep::doTestStepPreambleL() |
|
51 { |
|
52 return TestStepResult(); |
|
53 } |
|
54 |
|
55 /** |
|
56 * Override of base class virtual |
|
57 * @return - TVerdict code |
|
58 */ |
|
59 TVerdict CCreateConfigFUllTestStep::doTestStepPostambleL() |
|
60 { |
|
61 return TestStepResult(); |
|
62 } |
|
63 |
|
64 /** |
|
65 * Test |
|
66 * @return - TVerdict code |
|
67 */ |
|
68 TVerdict CCreateConfigFUllTestStep::doTestStepL() |
|
69 { |
|
70 RULogger logger; |
|
71 |
|
72 logger.Connect(); |
|
73 CClearConfig configIni; |
|
74 |
|
75 configIni.Clear(logger); |
|
76 |
|
77 _LIT8(KTextplugin,"uloggerfileplugin"); |
|
78 logger.ActivateOutputPlugin(KTextplugin); |
|
79 |
|
80 _LIT(KTextsetting, "output_path"); |
|
81 _LIT(KTextvalue, "c:\\logs\\Ulogger.log"); |
|
82 |
|
83 _LIT(KTextsetting2, "max_size"); |
|
84 _LIT(KTextvalue2, "10000000"); |
|
85 |
|
86 const TPtrC settingptr(KTextsetting); |
|
87 const TPtrC valueptr(KTextvalue); |
|
88 |
|
89 const TPtrC settingptr2(KTextsetting2); |
|
90 const TPtrC valueptr2(KTextvalue2); |
|
91 |
|
92 TPluginConfiguration setpluginsettings1; |
|
93 setpluginsettings1.SetKey(settingptr); |
|
94 setpluginsettings1.SetValue(valueptr); |
|
95 |
|
96 TPluginConfiguration setpluginsettings2; |
|
97 setpluginsettings2.SetKey(settingptr2); |
|
98 setpluginsettings2.SetValue(valueptr2); |
|
99 |
|
100 logger.SetPluginConfigurations(KTextplugin, setpluginsettings1); |
|
101 logger.SetPluginConfigurations(KTextplugin, setpluginsettings2); |
|
102 |
|
103 _LIT8(KTextplugin2,"uloggerserialplugin"); |
|
104 _LIT(KTextsetting3, "output_port"); |
|
105 _LIT(KTextvalue3, "1"); |
|
106 |
|
107 const TPtrC settingptr3(KTextsetting3); |
|
108 const TPtrC valueptr3(KTextvalue3); |
|
109 |
|
110 TPluginConfiguration setpluginsettings3; |
|
111 setpluginsettings3.SetKey(settingptr3); |
|
112 setpluginsettings3.SetValue(valueptr3); |
|
113 |
|
114 logger.SetPluginConfigurations(KTextplugin2, setpluginsettings3); |
|
115 |
|
116 CArrayFixFlat<TUint8> *setfilter = new (ELeave)CArrayFixFlat<TUint8>(1); |
|
117 setfilter->AppendL(3); |
|
118 logger.SetPrimaryFiltersEnabled(*setfilter, true); |
|
119 |
|
120 RArray<TUint32> setfilter2; |
|
121 setfilter2.Append((TUint32)2223); |
|
122 logger.SetSecondaryFiltersEnabled(setfilter2, true); |
|
123 |
|
124 logger.SetSecondaryFilteringEnabled(false); |
|
125 |
|
126 SetTestStepResult(EPass); |
|
127 |
|
128 return TestStepResult(); |
|
129 } |