stif/inc/StifKernelTestClass.inl
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 17:25:56 +0300
branchRCL_3
changeset 32 8f8df8006c40
parent 0 a03f92240627
child 30 86a2e675b80a
permissions -rw-r--r--
Revision: 201023 Kit: 2010125

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
* 
* Description:
*
*/


#ifndef STIFKERNELTESTCLASS_INL
#define STIFKERNELTESTCLASS_INL

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// RStifKernelTestClass::Open
// Open driver.
// -----------------------------------------------------------------------------
//
TInt RStifKernelTestClass::Open( const TVersion& aVer, const TDesC& aDriverName )
    {       
    return DoCreate( aDriverName, aVer, KNullUnit, NULL, NULL );    
    }

// -----------------------------------------------------------------------------
// RStifKernelTestClass::VersionRequired
// Get version info.
// -----------------------------------------------------------------------------
//
TVersion RStifKernelTestClass::VersionRequired() const
    {
    return TVersion( EMajorVersionNumber, EMinorVersionNumber, EBuildVersionNumber );
    }
    
// -----------------------------------------------------------------------------
// RStifKernelTestClass::RunMethod
// DoControl call to the kernel side for test case execution
// -----------------------------------------------------------------------------
//
                                    
TInt RStifKernelTestClass::RunMethod( const TDesC8&  aMethodName,
                                      const TDesC8&  aMethodParams,
                                      TInt&          aResult,
                                      TDes8&         aResultDes )                                   
    {      
    TStifRunMethodInfo methodInfo;
    if( ( aMethodName.Length() > methodInfo.iMethodName.MaxLength() ) ||
        ( aMethodParams.Length() > methodInfo.iMethodParams.MaxLength() ) ) 
        {
        return KErrArgument;
        }
    methodInfo.iMethodName.Copy( aMethodName );
    methodInfo.iMethodParams.Copy( aMethodParams );
    
    TPckg<TStifRunMethodInfo> methodInfoPckg( methodInfo );
    TInt ret = DoControl( ERunMethod, ( TAny* )&methodInfoPckg );
    
    if( ret != KErrNone )
        {
        return ret;
        }
    
    aResult = methodInfo.iResult;
    aResultDes.Copy( methodInfo.iMethodResultDes.Left( aResultDes.MaxLength() ) );
    return KErrNone;
    }

#endif      // STIFKERNELTESTCLASS_INL
            
// End of File