1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/ext/t_testext.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,125 @@
1.4 +// Copyright (c) 2005-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 +// f32test\ext\t_testext.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __TEST_EXT_H__
1.22 +#define __TEST_EXT_H__
1.23 +
1.24 +#include <f32fsys.h>
1.25 +
1.26 +//#define TESTEXT_DEBUG
1.27 +
1.28 +#if (defined(_DEBUG) || defined(_DEBUG_RELEASE)) && defined(TESTEXT_DEBUG)
1.29 +#define __PRINT(t) {RDebug::Print(t);}
1.30 +#define __PRINT1(t,a) {RDebug::Print(t,a);}
1.31 +#define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
1.32 +#else
1.33 +#define __PRINT(t)
1.34 +#define __PRINT1(t,a)
1.35 +#define __PRINT2(t,a,b)
1.36 +#endif
1.37 +
1.38 +#define EExtCustom (KMaxTInt/2)
1.39 +
1.40 +
1.41 +/**
1.42 +This is the test proxy drive extension base class.
1.43 +Test proxy drives of specific file system should derive from this base class.
1.44 +@internalTechnology
1.45 +*/
1.46 +class CTestProxyDrive : public CBaseExtProxyDrive
1.47 + {
1.48 +public:
1.49 + enum TTestCmd
1.50 + {
1.51 + ESetEvent = EExtCustom,
1.52 + EMark,
1.53 + EUnmark,
1.54 + EUnmarkAll,
1.55 + EIsMarked,
1.56 + EDiskSize,
1.57 + ETestCmdEnd = EExtCustom + 100
1.58 + };
1.59 + enum TBadSectorEvent
1.60 + {
1.61 + ENone, ENext, EDeterministic, ERandom
1.62 + };
1.63 +
1.64 +protected:
1.65 + CTestProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount);
1.66 + virtual ~CTestProxyDrive();
1.67 +
1.68 +public:
1.69 + // Derived functions from CBaseExtProxyDrive
1.70 + // Commented out because they are not changed. Sub-classes reimplement them
1.71 + // if interested.
1.72 +// virtual TInt Initialise();
1.73 +// virtual TInt Dismounted();
1.74 +// virtual TInt Enlarge(TInt aLength);
1.75 +// virtual TInt ReduceSize(TInt aPos, TInt aLength);
1.76 +// virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags);
1.77 +// virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset);
1.78 +// virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg);
1.79 +// virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags);
1.80 +// virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset);
1.81 +// virtual TInt Write(TInt64 aPos,const TDesC8& aSrc);
1.82 +// virtual TInt Caps(TDes8& anInfo);
1.83 +// virtual TInt Format(TFormatInfo& anInfo);
1.84 +// virtual TInt Format(TInt64 aPos,TInt aLength);
1.85 +// virtual TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle=KCurrentThreadHandle);
1.86 +// virtual TInt ForceRemount(TUint aFlags=0);
1.87 +// virtual TInt Unlock(TMediaPassword &aPassword, TBool aStorePassword);
1.88 +// virtual TInt Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword);
1.89 +// virtual TInt Clear(TMediaPassword &aPassword);
1.90 +// virtual TInt ErasePassword();
1.91 + virtual TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2);
1.92 + virtual TInt GetLastErrorInfo(TDes8& aErrorInfo);
1.93 +
1.94 +protected:
1.95 + /**
1.96 + Return a pointer to a specified interface extension - to allow future extension of this class without breaking
1.97 + binary compatibility.
1.98 + @param aInterfaceId Interface identifier of the interface to be retrieved.
1.99 + @param aInterface A reference to a pointer that retrieves the specified interface.
1.100 + @param aInput An arbitrary input argument.
1.101 + @return KErrNone If the interface is supported, KErrNotSupported otherwise.
1.102 + */
1.103 +// virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
1.104 +
1.105 +protected:
1.106 + void InitL();
1.107 + TInt SetEvent(TInt aType, TInt aValue);
1.108 + TInt Mark(TInt aSector);
1.109 + TInt Unmark(TInt aSector);
1.110 + TInt UnmarkAll();
1.111 + TBool IsMarked(TInt aSector) const;
1.112 + TBool CheckEvent(TInt64 aPos, TInt aLength);
1.113 + virtual void DoInitL() = 0;
1.114 + virtual TBool DoCheckEvent(TInt64 aPos, TInt aLength) = 0;
1.115 + virtual TInt DoControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2) = 0;
1.116 +
1.117 +protected:
1.118 + CMountCB* iMount; // in CProxyDrive
1.119 + TUint8* iMap;
1.120 + TInt iTotalSectors;
1.121 + TBool iMountInitialised;
1.122 + TInt iEventType;
1.123 + TInt iCount;
1.124 + TInt iSuccessBytes;
1.125 + TErrorInfo::TReasonCode iLastErrorReason;
1.126 + };
1.127 +
1.128 +#endif