os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigfullstep.cpp
First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 @file te_createconfigfullstep.cpp
20 #include "te_createconfigfullstep.h"
21 #include "te_clearconfig.h"
22 #include "uloggerdatatypes.h"
24 using namespace Ulogger;
26 CCreateConfigFUllTestStep::~CCreateConfigFUllTestStep()
33 CCreateConfigFUllTestStep::CCreateConfigFUllTestStep()
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);
46 * Override of base class virtual
47 * @return - TVerdict code
50 TVerdict CCreateConfigFUllTestStep::doTestStepPreambleL()
52 return TestStepResult();
56 * Override of base class virtual
57 * @return - TVerdict code
59 TVerdict CCreateConfigFUllTestStep::doTestStepPostambleL()
61 return TestStepResult();
66 * @return - TVerdict code
68 TVerdict CCreateConfigFUllTestStep::doTestStepL()
73 CClearConfig configIni;
75 configIni.ClearL(logger);
77 _LIT8(KTextplugin,"uloggerfileplugin");
78 logger.ActivateOutputPlugin(KTextplugin);
80 _LIT(KTextsetting, "output_path");
81 _LIT(KTextvalue, "c:\\logs\\Ulogger.log");
83 _LIT(KTextsetting2, "max_size");
84 _LIT(KTextvalue2, "10000000");
86 const TPtrC settingptr(KTextsetting);
87 const TPtrC valueptr(KTextvalue);
89 const TPtrC settingptr2(KTextsetting2);
90 const TPtrC valueptr2(KTextvalue2);
92 TPluginConfiguration setpluginsettings1;
93 setpluginsettings1.SetKey(settingptr);
94 setpluginsettings1.SetValue(valueptr);
96 TPluginConfiguration setpluginsettings2;
97 setpluginsettings2.SetKey(settingptr2);
98 setpluginsettings2.SetValue(valueptr2);
100 logger.SetPluginConfigurations(KTextplugin, setpluginsettings1);
101 logger.SetPluginConfigurations(KTextplugin, setpluginsettings2);
103 _LIT8(KTextplugin2,"uloggerserialplugin");
104 _LIT(KTextsetting3, "output_port");
105 _LIT(KTextvalue3, "1");
107 const TPtrC settingptr3(KTextsetting3);
108 const TPtrC valueptr3(KTextvalue3);
110 TPluginConfiguration setpluginsettings3;
111 setpluginsettings3.SetKey(settingptr3);
112 setpluginsettings3.SetValue(valueptr3);
114 logger.SetPluginConfigurations(KTextplugin2, setpluginsettings3);
116 CArrayFixFlat<TUint8> *setfilter = new (ELeave)CArrayFixFlat<TUint8>(1);
117 setfilter->AppendL(3);
118 logger.SetPrimaryFiltersEnabled(*setfilter, true);
120 RArray<TUint32> setfilter2;
121 setfilter2.Append((TUint32)2223);
122 logger.SetSecondaryFiltersEnabled(setfilter2, true);
124 logger.SetSecondaryFilteringEnabled(false);
126 SetTestStepResult(EPass);
128 return TestStepResult();