os/kernelhwsrv/kerneltest/e32test/hcr/d_hcrut.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2008-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 the License "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
// Hardware Configuration Respoitory Tests
sl@0
    15
//
sl@0
    16
sl@0
    17
#ifndef D_HCRUT_H
sl@0
    18
#define D_HCRUT_H
sl@0
    19
sl@0
    20
#include <e32cmn.h>
sl@0
    21
#include <e32ver.h>
sl@0
    22
#include <drivers/hcr.h>
sl@0
    23
sl@0
    24
#ifndef __KERNEL_MODE__
sl@0
    25
#include <e32std.h>
sl@0
    26
#endif
sl@0
    27
sl@0
    28
sl@0
    29
/**
sl@0
    30
Interface to the fast-trace memory buffer.
sl@0
    31
*/
sl@0
    32
class RHcrTest : public RBusLogicalChannel
sl@0
    33
	{
sl@0
    34
	
sl@0
    35
public:
sl@0
    36
		
sl@0
    37
#ifndef __KERNEL_MODE__
sl@0
    38
	inline TInt Open()
sl@0
    39
		{
sl@0
    40
		return DoCreate(Name(),TVersion(0,1,1),KNullUnit,NULL,NULL,EOwnerThread);
sl@0
    41
		}
sl@0
    42
sl@0
    43
	inline TUint Test_SanityTestWordSettings()
sl@0
    44
		{
sl@0
    45
		return DoControl(ECtrlSanityTestWordSettings);
sl@0
    46
		}
sl@0
    47
sl@0
    48
	inline TUint Test_SanityTestLargeSettings()
sl@0
    49
		{
sl@0
    50
		return DoControl(ECtrlSanityTestLargeSettings);
sl@0
    51
		}
sl@0
    52
		
sl@0
    53
	inline TUint Test_SwitchRepository()
sl@0
    54
		{
sl@0
    55
		return DoControl(ECtrlSwitchRepository);
sl@0
    56
		}
sl@0
    57
	
sl@0
    58
	inline TUint Test_FindCompiledSettingsInCategory(HCR::TCategoryUid aCatUid,
sl@0
    59
	        TInt32* aFirst, TInt32* aLast)
sl@0
    60
	    {
sl@0
    61
	    TAny* args[3];
sl@0
    62
	    args[0] = (TAny*) aCatUid;
sl@0
    63
	    args[1] = (TAny*) aFirst;
sl@0
    64
	    args[2] = (TAny*) aLast;
sl@0
    65
sl@0
    66
	    return DoControl(ECtrlCompiledFindSettingsInCategory, (TAny*)args);
sl@0
    67
	    }
sl@0
    68
	
sl@0
    69
	inline TUint Test_FindFileSettingsInCategory(HCR::TCategoryUid aCatUid,
sl@0
    70
	        TInt32* aFirst, TInt32* aLast)
sl@0
    71
	    {
sl@0
    72
	    TAny* args[3];
sl@0
    73
	    args[0] = (TAny*) aCatUid;
sl@0
    74
	    args[1] = (TAny*) aFirst;
sl@0
    75
	    args[2] = (TAny*) aLast;
sl@0
    76
	    
sl@0
    77
	    return DoControl(ECtrlFileFindSettingsInCategory, (TAny*)args);
sl@0
    78
	    }
sl@0
    79
	
sl@0
    80
	inline TUint Test_SwitchFileRepository(const TText* aRepName)
sl@0
    81
	    {
sl@0
    82
	    TAny* args[1];
sl@0
    83
	    args[0] = (TAny*) aRepName;
sl@0
    84
	    return DoControl(ECtrlSwitchFileRepository, (TAny*)args);
sl@0
    85
	    }
sl@0
    86
		
sl@0
    87
sl@0
    88
	inline TUint Test_CheckIntegrity()
sl@0
    89
		{
sl@0
    90
		return DoControl(ECtrlCheckOverrideReposIntegrity);
sl@0
    91
		}
sl@0
    92
		
sl@0
    93
	inline TUint Test_CheckContent()
sl@0
    94
		{
sl@0
    95
		return DoControl(ECtrlCheckOverrideRepos102400Content);
sl@0
    96
		}
sl@0
    97
sl@0
    98
	inline TUint Test_NegativeTestsLargeValues(TInt& aExpectedError)
sl@0
    99
  		{
sl@0
   100
  		TAny* args[1];
sl@0
   101
  		args[0] = (TAny*) aExpectedError;
sl@0
   102
  		return DoControl(ECtrlNegativeTestsLargeValues, (TAny*) args);
sl@0
   103
  		}
sl@0
   104
  	inline TUint Test_TRepositoryGetWordValue(HCR::TCategoryUid& aCategory, HCR::TElementId& aKey,TInt& type)
sl@0
   105
  		{
sl@0
   106
  		TAny* args[3];
sl@0
   107
  		args[0] = (TAny*) aCategory;
sl@0
   108
  		args[1] = (TAny*) aKey;
sl@0
   109
  		args[2] = (TAny*) type;
sl@0
   110
  		return DoControl(ECtrlGetWordSetting, (TAny*) args);
sl@0
   111
  		}
sl@0
   112
sl@0
   113
sl@0
   114
sl@0
   115
#endif
sl@0
   116
sl@0
   117
	inline static const TDesC& Name();
sl@0
   118
sl@0
   119
private:
sl@0
   120
	enum TControl
sl@0
   121
		{
sl@0
   122
		ECtrlUndefined = 0,
sl@0
   123
		
sl@0
   124
		ECtrlSanityTestWordSettings,
sl@0
   125
		ECtrlSanityTestLargeSettings,
sl@0
   126
		
sl@0
   127
		ECtrlGetWordSetting,
sl@0
   128
		ECtrlGetLargeSetting,
sl@0
   129
		ECtrlGetManyWordSettings,
sl@0
   130
		ECtrlGetManyLargeSettings,
sl@0
   131
		
sl@0
   132
		ECtrlSwitchRepository,
sl@0
   133
sl@0
   134
		ECtrlNegativeTestsLargeValues, 
sl@0
   135
		
sl@0
   136
		ECtrlFreePhyscialRam,
sl@0
   137
        ECtrlCheckOverrideReposIntegrity,
sl@0
   138
		ECtrlCheckOverrideRepos102400Content,
sl@0
   139
sl@0
   140
		ECtrlSwitchFileRepository,
sl@0
   141
		ECtrlFileFindSettingsInCategory,
sl@0
   142
		ECtrlCompiledFindSettingsInCategory
sl@0
   143
		};
sl@0
   144
		
sl@0
   145
	friend class DHcrTestChannel;
sl@0
   146
	friend class DHcrTestFactory;
sl@0
   147
	};
sl@0
   148
sl@0
   149
inline const TDesC& RHcrTest::Name()
sl@0
   150
	{
sl@0
   151
	_LIT(KTestDriver,"d_hcrut");
sl@0
   152
	return KTestDriver;
sl@0
   153
	}
sl@0
   154
sl@0
   155
#endif // D_HCRUT_H