1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/hcr/d_hcrut.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,155 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Hardware Configuration Respoitory Tests
1.18 +//
1.19 +
1.20 +#ifndef D_HCRUT_H
1.21 +#define D_HCRUT_H
1.22 +
1.23 +#include <e32cmn.h>
1.24 +#include <e32ver.h>
1.25 +#include <drivers/hcr.h>
1.26 +
1.27 +#ifndef __KERNEL_MODE__
1.28 +#include <e32std.h>
1.29 +#endif
1.30 +
1.31 +
1.32 +/**
1.33 +Interface to the fast-trace memory buffer.
1.34 +*/
1.35 +class RHcrTest : public RBusLogicalChannel
1.36 + {
1.37 +
1.38 +public:
1.39 +
1.40 +#ifndef __KERNEL_MODE__
1.41 + inline TInt Open()
1.42 + {
1.43 + return DoCreate(Name(),TVersion(0,1,1),KNullUnit,NULL,NULL,EOwnerThread);
1.44 + }
1.45 +
1.46 + inline TUint Test_SanityTestWordSettings()
1.47 + {
1.48 + return DoControl(ECtrlSanityTestWordSettings);
1.49 + }
1.50 +
1.51 + inline TUint Test_SanityTestLargeSettings()
1.52 + {
1.53 + return DoControl(ECtrlSanityTestLargeSettings);
1.54 + }
1.55 +
1.56 + inline TUint Test_SwitchRepository()
1.57 + {
1.58 + return DoControl(ECtrlSwitchRepository);
1.59 + }
1.60 +
1.61 + inline TUint Test_FindCompiledSettingsInCategory(HCR::TCategoryUid aCatUid,
1.62 + TInt32* aFirst, TInt32* aLast)
1.63 + {
1.64 + TAny* args[3];
1.65 + args[0] = (TAny*) aCatUid;
1.66 + args[1] = (TAny*) aFirst;
1.67 + args[2] = (TAny*) aLast;
1.68 +
1.69 + return DoControl(ECtrlCompiledFindSettingsInCategory, (TAny*)args);
1.70 + }
1.71 +
1.72 + inline TUint Test_FindFileSettingsInCategory(HCR::TCategoryUid aCatUid,
1.73 + TInt32* aFirst, TInt32* aLast)
1.74 + {
1.75 + TAny* args[3];
1.76 + args[0] = (TAny*) aCatUid;
1.77 + args[1] = (TAny*) aFirst;
1.78 + args[2] = (TAny*) aLast;
1.79 +
1.80 + return DoControl(ECtrlFileFindSettingsInCategory, (TAny*)args);
1.81 + }
1.82 +
1.83 + inline TUint Test_SwitchFileRepository(const TText* aRepName)
1.84 + {
1.85 + TAny* args[1];
1.86 + args[0] = (TAny*) aRepName;
1.87 + return DoControl(ECtrlSwitchFileRepository, (TAny*)args);
1.88 + }
1.89 +
1.90 +
1.91 + inline TUint Test_CheckIntegrity()
1.92 + {
1.93 + return DoControl(ECtrlCheckOverrideReposIntegrity);
1.94 + }
1.95 +
1.96 + inline TUint Test_CheckContent()
1.97 + {
1.98 + return DoControl(ECtrlCheckOverrideRepos102400Content);
1.99 + }
1.100 +
1.101 + inline TUint Test_NegativeTestsLargeValues(TInt& aExpectedError)
1.102 + {
1.103 + TAny* args[1];
1.104 + args[0] = (TAny*) aExpectedError;
1.105 + return DoControl(ECtrlNegativeTestsLargeValues, (TAny*) args);
1.106 + }
1.107 + inline TUint Test_TRepositoryGetWordValue(HCR::TCategoryUid& aCategory, HCR::TElementId& aKey,TInt& type)
1.108 + {
1.109 + TAny* args[3];
1.110 + args[0] = (TAny*) aCategory;
1.111 + args[1] = (TAny*) aKey;
1.112 + args[2] = (TAny*) type;
1.113 + return DoControl(ECtrlGetWordSetting, (TAny*) args);
1.114 + }
1.115 +
1.116 +
1.117 +
1.118 +#endif
1.119 +
1.120 + inline static const TDesC& Name();
1.121 +
1.122 +private:
1.123 + enum TControl
1.124 + {
1.125 + ECtrlUndefined = 0,
1.126 +
1.127 + ECtrlSanityTestWordSettings,
1.128 + ECtrlSanityTestLargeSettings,
1.129 +
1.130 + ECtrlGetWordSetting,
1.131 + ECtrlGetLargeSetting,
1.132 + ECtrlGetManyWordSettings,
1.133 + ECtrlGetManyLargeSettings,
1.134 +
1.135 + ECtrlSwitchRepository,
1.136 +
1.137 + ECtrlNegativeTestsLargeValues,
1.138 +
1.139 + ECtrlFreePhyscialRam,
1.140 + ECtrlCheckOverrideReposIntegrity,
1.141 + ECtrlCheckOverrideRepos102400Content,
1.142 +
1.143 + ECtrlSwitchFileRepository,
1.144 + ECtrlFileFindSettingsInCategory,
1.145 + ECtrlCompiledFindSettingsInCategory
1.146 + };
1.147 +
1.148 + friend class DHcrTestChannel;
1.149 + friend class DHcrTestFactory;
1.150 + };
1.151 +
1.152 +inline const TDesC& RHcrTest::Name()
1.153 + {
1.154 + _LIT(KTestDriver,"d_hcrut");
1.155 + return KTestDriver;
1.156 + }
1.157 +
1.158 +#endif // D_HCRUT_H