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