Update contrib.
1 // Copyright (c) 1997-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\misc\drvread.cpp
22 RTest test(_L("DriveRead"));
24 TRequestStatus KeyStat;
32 TInt r=D.Connect(Drive, Changed);
38 if (KeyStat==KRequestPending)
40 User::WaitForRequest(KeyStat);
41 TKeyCode k=C->KeyCode();
46 void ReadDrive(TAny* aDest, const TInt64& aPos, TInt aSize)
49 TPtr8 p((TUint8*)aDest, 0, aSize);
50 TInt r=D.Read(pos, aSize, p);
62 User::CommandLine(cmdBuf);
65 test(cmd.Val(Drive)==KErrNone);
67 test(cmd.Val(*(TUint32*)&increment,EHex)==KErrNone);
69 TInt block_size=0x10000;
70 TUint8* buf=(TUint8*)User::Alloc(block_size);
75 TLocalDriveCapsV2 caps;
76 TPckg<TLocalDriveCapsV2> capsPckg(caps);
77 TInt r=D.Caps(capsPckg);
79 TInt64 drive_size=caps.iSize;
81 TUint32 fc=User::NTickCount();
82 test.Printf(_L("Drive size = %x%08x\n"),I64HIGH(drive_size),I64LOW(drive_size));
89 ReadDrive(buf, pos, block_size);
90 pos+=TInt64(increment);
91 if (pos+TInt64(block_size) > drive_size)
93 if ((User::NTickCount()-fc)>1000)
95 fc=User::NTickCount();
96 test.Printf(_L("Pos=%x%08x\n"),I64HIGH(pos),I64LOW(pos));