os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigfullstep.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file te_createconfigfullstep.cpp
sl@0
    18
*/
sl@0
    19
 
sl@0
    20
#include "te_createconfigfullstep.h"
sl@0
    21
#include "te_clearconfig.h"
sl@0
    22
#include "uloggerdatatypes.h"
sl@0
    23
sl@0
    24
using namespace Ulogger;
sl@0
    25
sl@0
    26
CCreateConfigFUllTestStep::~CCreateConfigFUllTestStep()
sl@0
    27
/**
sl@0
    28
 * Destructor
sl@0
    29
 */
sl@0
    30
	{
sl@0
    31
	}
sl@0
    32
sl@0
    33
CCreateConfigFUllTestStep::CCreateConfigFUllTestStep()
sl@0
    34
/**
sl@0
    35
 * Constructor
sl@0
    36
 */
sl@0
    37
	{
sl@0
    38
	// **MUST** call SetTestStepName in the constructor as the controlling
sl@0
    39
	// framework uses the test step name immediately following construction to set
sl@0
    40
	// up the step's unique logging ID.
sl@0
    41
	SetTestStepName(KCreateConfigFullStep);
sl@0
    42
	}
sl@0
    43
 
sl@0
    44
 
sl@0
    45
/**
sl@0
    46
 * Override of base class virtual
sl@0
    47
 * @return - TVerdict code
sl@0
    48
 * 
sl@0
    49
 */
sl@0
    50
TVerdict CCreateConfigFUllTestStep::doTestStepPreambleL()
sl@0
    51
	{
sl@0
    52
	return TestStepResult();
sl@0
    53
	}
sl@0
    54
sl@0
    55
/**
sl@0
    56
 * Override of base class virtual
sl@0
    57
 * @return - TVerdict code
sl@0
    58
 */
sl@0
    59
TVerdict CCreateConfigFUllTestStep::doTestStepPostambleL()
sl@0
    60
	{
sl@0
    61
	return TestStepResult();	
sl@0
    62
	}
sl@0
    63
sl@0
    64
/**
sl@0
    65
 * Test 
sl@0
    66
 * @return - TVerdict code
sl@0
    67
 */
sl@0
    68
TVerdict CCreateConfigFUllTestStep::doTestStepL()
sl@0
    69
	{
sl@0
    70
	RULogger logger;
sl@0
    71
sl@0
    72
	logger.Connect();
sl@0
    73
	CClearConfig configIni;
sl@0
    74
sl@0
    75
	configIni.ClearL(logger);
sl@0
    76
sl@0
    77
	_LIT8(KTextplugin,"uloggerfileplugin");						
sl@0
    78
	logger.ActivateOutputPlugin(KTextplugin);
sl@0
    79
sl@0
    80
	_LIT(KTextsetting, "output_path");
sl@0
    81
	_LIT(KTextvalue, "c:\\logs\\Ulogger.log");
sl@0
    82
sl@0
    83
	_LIT(KTextsetting2, "max_size");
sl@0
    84
	_LIT(KTextvalue2, "10000000");
sl@0
    85
sl@0
    86
	const TPtrC  settingptr(KTextsetting);
sl@0
    87
	const TPtrC  valueptr(KTextvalue);
sl@0
    88
sl@0
    89
	const TPtrC  settingptr2(KTextsetting2);
sl@0
    90
	const TPtrC  valueptr2(KTextvalue2);
sl@0
    91
sl@0
    92
	TPluginConfiguration setpluginsettings1;
sl@0
    93
	setpluginsettings1.SetKey(settingptr);
sl@0
    94
	setpluginsettings1.SetValue(valueptr);
sl@0
    95
sl@0
    96
	TPluginConfiguration setpluginsettings2;
sl@0
    97
	setpluginsettings2.SetKey(settingptr2);
sl@0
    98
	setpluginsettings2.SetValue(valueptr2);			
sl@0
    99
sl@0
   100
	logger.SetPluginConfigurations(KTextplugin, setpluginsettings1);
sl@0
   101
	logger.SetPluginConfigurations(KTextplugin, setpluginsettings2);
sl@0
   102
sl@0
   103
	_LIT8(KTextplugin2,"uloggerserialplugin");			
sl@0
   104
	_LIT(KTextsetting3, "output_port");	
sl@0
   105
	_LIT(KTextvalue3, "1");
sl@0
   106
sl@0
   107
	const TPtrC settingptr3(KTextsetting3);
sl@0
   108
	const TPtrC valueptr3(KTextvalue3);
sl@0
   109
sl@0
   110
	TPluginConfiguration setpluginsettings3;
sl@0
   111
	setpluginsettings3.SetKey(settingptr3);
sl@0
   112
	setpluginsettings3.SetValue(valueptr3);		
sl@0
   113
sl@0
   114
	logger.SetPluginConfigurations(KTextplugin2, setpluginsettings3);
sl@0
   115
sl@0
   116
	CArrayFixFlat<TUint8> *setfilter = new (ELeave)CArrayFixFlat<TUint8>(1);
sl@0
   117
	setfilter->AppendL(3);
sl@0
   118
	logger.SetPrimaryFiltersEnabled(*setfilter, true);
sl@0
   119
sl@0
   120
	RArray<TUint32> setfilter2;
sl@0
   121
	setfilter2.Append((TUint32)2223);
sl@0
   122
	logger.SetSecondaryFiltersEnabled(setfilter2, true);
sl@0
   123
sl@0
   124
	logger.SetSecondaryFilteringEnabled(false);
sl@0
   125
sl@0
   126
	SetTestStepResult(EPass);
sl@0
   127
sl@0
   128
	return TestStepResult();	
sl@0
   129
	}