1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/server/t_file64bit.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,181 @@
1.4 +/**
1.5 +* Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* File Name: f32test/server/t_file64bit.h
1.19 +* Include file for t_file64bit.cpp (PREQ 1725).
1.20 +*
1.21 +*
1.22 +*/
1.23 +
1.24 +
1.25 +
1.26 +
1.27 +
1.28 +#if !defined(__T_FILE64BIT_H__)
1.29 +#define __T_FILE64BIT_H__
1.30 +
1.31 +const TInt64 KKB = 1 << 10;
1.32 +const TInt64 K2KB = 2 * KKB;
1.33 +const TInt64 K4KB = 4 * KKB;
1.34 +const TInt64 K32KB = 8 * K4KB;
1.35 +const TInt64 KGB = 1 << 30;
1.36 +const TInt64 K2GB = 2 * KGB;
1.37 +const TInt64 K3GB = 3 * KGB;
1.38 +const TInt64 K4GB = 4 * KGB;
1.39 +const TInt64 K9GB = 9 * KGB;
1.40 +const TInt64 K12GB = 12 * KGB;
1.41 +const TInt64 K1GBMinusOne = KGB - 1;
1.42 +const TInt64 KSize1GMinus4K = KGB - K4KB;
1.43 +const TInt64 K2GBMinusOne = K2GB - 1;
1.44 +const TInt64 K2GBMinusTen = K2GB - 10;
1.45 +const TInt64 K2GBMinus100 = K2GB - 100;
1.46 +const TInt64 KSize2GMinus4K = K2GB - K4KB;
1.47 +const TInt64 K2GBPlusTen = K2GB + 10;
1.48 +const TInt64 K2GBPlus16 = K2GB + 16;
1.49 +const TInt64 K2GBPlus80 = K2GB + 80;
1.50 +const TInt64 K2GBPlus98 = K2GB + 98;
1.51 +const TInt64 K2GBPlus100 = K2GB + 100;
1.52 +const TInt64 K2GBPlus200 = K2GB + 100;
1.53 +const TInt64 K2GBPlus600 = K2GB + 600;
1.54 +const TInt64 K2GBPlus300 = K2GB + 300;
1.55 +const TInt64 K2GBPlus500 = K2GB + 500;
1.56 +const TInt64 K3GBMinusOne = K3GB - 1;
1.57 +const TInt64 KSize3GMinus4K = K3GB - K4KB;
1.58 +const TInt64 K4GBMinusOne = K4GB - 1;
1.59 +const TInt64 K4GBMinusTwo = K4GB - 2;
1.60 +const TInt64 K4GBMinusTen = K4GB - 10;
1.61 +const TInt64 K4GBMinus100 = K4GB - 100;
1.62 +const TInt64 KSize3GMinus1Minus4K = K3GB -1 - K4KB;
1.63 +const TInt64 KSize4GMinus1Minus4K = K4GB - 1 - K4KB;
1.64 +const TInt64 KSize2GMinus1Minus4K = K2GB - 2 - K4KB;
1.65 +const TInt64 K4GBPlusOne = K4GB + 1;
1.66 +const TInt64 K4GBPlusTen = K4GB + 10;
1.67 +
1.68 +
1.69 +const TInt KBUFSIZE = 10;
1.70 +const TInt KMAXBUFSIZE = 2*KKB;
1.71 +const TInt KWRITEBUFSIZE = KKB;
1.72 +LOCAL_D TBuf8<0x63> pattern;
1.73 +
1.74 +// Maximum bytes per cluster recommended in FAT32
1.75 +const TInt KMaxClusterSize = K32KB;
1.76 +
1.77 +//-------------------------------------------------------------------------------------------------------------------
1.78 +
1.79 +_LIT(KFsName_FAT32, "Fat32");
1.80 +_LIT(KFsName_NGFS, "NGFS");
1.81 +_LIT(KFile2GBMinusOne, "File2GBMinusOne.txt");
1.82 +_LIT(KFile2GB, "File2GB.txt");
1.83 +_LIT(KFile3GB, "File3GB.txt");
1.84 +_LIT(KFile4GBMinusOne, "File4GBMinusOne.txt");
1.85 +_LIT( KClientFileName, "File4GBMinusOne.txt");
1.86 +_LIT(KServerName, "FHServer64bit");
1.87 +TInt gFilesInDirectory = 4;
1.88 +
1.89 +TVolumeInfo gDriveVolumeInfo;
1.90 +TInt gDrive;
1.91 +// Static function prototypes.
1.92 +LOCAL_C void TestOpenFiles();
1.93 +LOCAL_C void TestAdoptFiles();
1.94 +
1.95 +LOCAL_C void TestReadFile();
1.96 +LOCAL_C void TestWriteFile();
1.97 +LOCAL_C void TestFileAccess();
1.98 +LOCAL_C void TestLockUnLock();
1.99 +LOCAL_C void TestCopyMoveDirectory();
1.100 +
1.101 +
1.102 +class CFileManObserver : public CBase, public MFileManObserver
1.103 + {
1.104 +public:
1.105 + CFileManObserver(CFileMan* aFileMan);
1.106 +
1.107 + TControl NotifyFileManStarted();
1.108 + TControl NotifyFileManOperation();
1.109 + TControl NotifyFileManEnded();
1.110 +private:
1.111 + CFileMan* iFileMan;
1.112 +public:
1.113 + TInt iNotifyEndedSuccesses;
1.114 + TInt iNotifyEndedFailures;
1.115 + };
1.116 +
1.117 +
1.118 +class RFsTest : public RFs
1.119 + {
1.120 +public:
1.121 + RFsTest& Replace(const TDesC &anOldName, const TDesC &aNewName);
1.122 + RFsTest& ReadFileSection(const TDesC& aName, TInt64 aPos, TDes8& aBuffer, TInt aLen);
1.123 + RFsTest& GetDir(const TDesC &aName, TUint anEntryAttMask, TUint anEntrySortKey, CDir *&anEntryList);
1.124 + RFsTest& GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,CDir*& aDirList);
1.125 + RFsTest& GetDir(const TDesC& aName,const TUidType& anEntryUid,TUint anEntrySortKey,CDir*& aFileList);
1.126 + };
1.127 +LOCAL_D RFsTest TestRFs;
1.128 +
1.129 +class RFileTest : public RFile64
1.130 + {
1.131 +public:
1.132 + RFileTest(const TDesC& aName);
1.133 + RFileTest& Create(const TDesC& aName,TUint aFileMode);
1.134 + RFileTest& Replace(const TDesC& aName);
1.135 + RFileTest& Replace(const TDesC& aName, TUint aFileMode);
1.136 + RFileTest& Open(const TDesC& aName);
1.137 + RFileTest& Open(const TDesC& aName, TUint aFileMode);
1.138 + RFileTest& Temp(const TDesC& aPath,TFileName& aName,TUint aFileMode);
1.139 + void Close();
1.140 + RFileTest& Lock(TInt64 aPos,TInt64 aLen=1);
1.141 + RFileTest& LockE(TInt64 aPos,TInt64 aLen=1);
1.142 + RFileTest& UnLock(TInt64 aPos,TInt64 aLen=1);
1.143 + RFileTest& UnLockE(TInt64 aPos,TInt64 aLen=1);
1.144 +
1.145 + RFileTest& Write(const TDesC8& aDes);
1.146 + RFileTest& Write(const TDesC8& aDes, TRequestStatus& aStatus);
1.147 + RFileTest& Write(const TDesC8& aDes, TInt aLength);
1.148 + RFileTest& Write(const TDesC8& aDes, TInt aLength, TRequestStatus &aStatus);
1.149 + RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TInt aLen=1);
1.150 + RFileTest& WriteE(TInt64 aPos,const TDesC8& aDes,TInt aLen=1);
1.151 + RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TInt aLen,TRequestStatus &aStatus);
1.152 + RFileTest& WriteP(TInt64 aPos,const TDesC8& aDes);
1.153 + RFileTest& Write(TInt64 aPos,const TDesC8& aDes,TRequestStatus& aStatus);
1.154 + RFileTest& WriteU(TUint aPos,const TDesC8& aDes);
1.155 + RFileTest& WriteU(TUint aPos,const TDesC8& aDes,TRequestStatus& aStatus);
1.156 + RFileTest& WriteU(TUint aPos,const TDesC8& aDes, TInt aLength);
1.157 + RFileTest& WriteU(TUint aPos,const TDesC8& aDes, TInt aLength,TRequestStatus& aStatus);
1.158 +
1.159 +
1.160 + RFileTest& Read(TDes8& aDes);
1.161 + RFileTest& Read(TDes8& aDes, TRequestStatus& aStatus);
1.162 + RFileTest& Read(TDes8 &aDes, TInt aLen);
1.163 + RFileTest& Read(TDes8 &aDes, TInt aLength, TRequestStatus &aStatus);
1.164 + RFileTest& Read(TInt64 aPos,TDes8& aDes,TInt aLen=1);
1.165 + RFileTest& ReadE(TInt64 aPos,TDes8& aDes,TInt aLen=1);
1.166 + RFileTest& Read(TInt64 aPos,TDes8& aDes);
1.167 + RFileTest& Read(TInt64 aPos,TDes8& aDes,TInt aLen, TRequestStatus& aStatus);
1.168 + RFileTest& ReadP(TInt64 aPos,TDes8& aDes);
1.169 + RFileTest& Read(TInt64 aPos,TDes8& aDes,TRequestStatus& aStatus);
1.170 + RFileTest& ReadU(TUint aPos,TDes8& aDes,TRequestStatus& aStatus);
1.171 + RFileTest& ReadU(TUint aPos,TDes8& aDes);
1.172 + RFileTest& ReadU(TUint aPos,TDes8& aDes, TInt aLength);
1.173 + RFileTest& ReadU(TUint aPos,TDes8& aDes, TInt aLength,TRequestStatus& aStatus);
1.174 +
1.175 + RFileTest& SetSize(TInt64 aSize);
1.176 + RFileTest& SetSizeE(TInt64 aSize);
1.177 + RFileTest& Size(TInt64& aSize);
1.178 + RFileTest& Seek(TSeek aMode,TInt64& aPos);
1.179 +private:
1.180 + TName iName;
1.181 + };
1.182 +LOCAL_D RFileTest TestRFile1(_L("File 1"));
1.183 +LOCAL_D RFileTest TestRFile2(_L("File 2"));
1.184 +#endif