1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef STIFKERNELTESTCLASS_INL |
|
20 #define STIFKERNELTESTCLASS_INL |
|
21 |
|
22 // ============================ MEMBER FUNCTIONS =============================== |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // RStifKernelTestClass::Open |
|
26 // Open driver. |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 TInt RStifKernelTestClass::Open( const TVersion& aVer, const TDesC& aDriverName ) |
|
30 { |
|
31 return DoCreate( aDriverName, aVer, KNullUnit, NULL, NULL ); |
|
32 } |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // RStifKernelTestClass::VersionRequired |
|
36 // Get version info. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 TVersion RStifKernelTestClass::VersionRequired() const |
|
40 { |
|
41 return TVersion( EMajorVersionNumber, EMinorVersionNumber, EBuildVersionNumber ); |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // RStifKernelTestClass::RunMethod |
|
46 // DoControl call to the kernel side for test case execution |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 |
|
50 TInt RStifKernelTestClass::RunMethod( const TDesC8& aMethodName, |
|
51 const TDesC8& aMethodParams, |
|
52 TInt& aResult, |
|
53 TDes8& aResultDes ) |
|
54 { |
|
55 TStifRunMethodInfo methodInfo; |
|
56 if( ( aMethodName.Length() > methodInfo.iMethodName.MaxLength() ) || |
|
57 ( aMethodParams.Length() > methodInfo.iMethodParams.MaxLength() ) ) |
|
58 { |
|
59 return KErrArgument; |
|
60 } |
|
61 methodInfo.iMethodName.Copy( aMethodName ); |
|
62 methodInfo.iMethodParams.Copy( aMethodParams ); |
|
63 |
|
64 TPckg<TStifRunMethodInfo> methodInfoPckg( methodInfo ); |
|
65 TInt ret = DoControl( ERunMethod, ( TAny* )&methodInfoPckg ); |
|
66 |
|
67 if( ret != KErrNone ) |
|
68 { |
|
69 return ret; |
|
70 } |
|
71 |
|
72 aResult = methodInfo.iResult; |
|
73 aResultDes.Copy( methodInfo.iMethodResultDes.Left( aResultDes.MaxLength() ) ); |
|
74 return KErrNone; |
|
75 } |
|
76 |
|
77 #endif // STIFKERNELTESTCLASS_INL |
|
78 |
|
79 // End of File |
|