Update contrib.
1 // Copyright (c) 1996-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 // f32test\manager\t_locdrv.cpp
20 const TUint KMaxDriveFileLen=0x00020000;
22 LOCAL_D RTest test(_L("T_LOCDRV"));
24 GLDEF_C TInt E32Main()
26 TBusLocalDrive TheLocalDrives[KMaxLocalDrives];
30 test.Start(_L("Test Local Drive Sw"));
32 test.Next(_L("Connect - all drives"));
34 for (; i<KMaxLocalDrives; i++)
35 TheLocalDrives[i].Connect(i,isBoolean);
37 test.Next(_L("Caps - all drives"));
39 for (i=0;i<KMaxLocalDrives;i++)
41 TInt r=TheLocalDrives[i].Caps(info);
42 if (r==KErrNotSupported)
43 test.Printf(_L("Drive %c: Not Supported\r\n"),(i+'A'));
45 test.Printf(_L("Drive %c size: %d\r\n"),(i+'A'),info.iSize );
48 test.Printf(_L("Drive %c: Error %d\r\n"),(i+'A'),r);
53 TBuf8<256> wrBuf(0x100);
54 TBuf8<256> rdBuf(0X100);
56 for (TInt j=0 ; j<0x100 ; j++)
58 for (i=0;i<KMaxLocalDrives;i++)
61 TInt r=TheLocalDrives[i].Write((KMaxDriveFileLen-0x100),wrBuf);
62 test((r==KErrNone)||(r==KErrNotSupported));
63 r=TheLocalDrives[i].Read((KMaxDriveFileLen-0x100),0x100,rdBuf);
64 test((r==KErrNone)||(r==KErrNotSupported));
65 r=rdBuf.Compare(wrBuf);
66 test((r==KErrNone)||(r==KErrNotFound));
67 test.Printf( _L("Drive %c Rd/Wr\r\n"),(i+'A'));
70 test.Next(_L("Drive A: Format"));
71 for (i=0 ; i<0x100 ; i++)
74 TFormatInfo formatInfo;
76 TInt r=TheLocalDrives[0].Format(formatInfo);
77 test((r==KErrNone)||(r==KErrNotSupported));
78 r=TheLocalDrives[0].Read((KMaxDriveFileLen-0x100),0x100,rdBuf);
79 test((r==KErrNone)||(r==KErrNotSupported));
80 r=rdBuf.Compare(wrBuf);
81 test((r==KErrNone)||(r==KErrNotFound));