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 // e32test\misc\t_kill.cpp
21 #include "../misc/prbs.h"
23 RTest test(_L("T_KILL"));
25 _LIT(KFileName1,"D:\\File1");
26 _LIT(KFileName2,"D:\\File2");
28 LOCAL_D TBuf8<1024> Cluster;
29 LOCAL_D TBuf8<2048> WriteBuf;
31 GLDEF_C TInt E32Main()
34 test.Start(_L("Connect to file server"));
39 test.Next(_L("Delete old files"));
40 r=fs.Delete(KFileName1);
41 test(r==KErrNone || r==KErrNotFound);
42 r=fs.Delete(KFileName2);
43 test(r==KErrNone || r==KErrNotFound);
45 test.Next(_L("Create file 1"));
47 r=file1.Create(fs,KFileName1,EFileWrite);
50 test.Next(_L("Create file 2"));
52 r=file2.Create(fs,KFileName2,EFileWrite);
55 Cluster.SetLength(512);
56 test.Next(_L("Write 1024 bytes to file 1"));
57 r=file1.Write(Cluster);
60 test.Next(_L("Write 1024 bytes to file 2"));
61 r=file2.Write(Cluster);
64 test.Next(_L("Write 1024 bytes to file 1"));
65 r=file1.Write(Cluster);
72 test.Next(_L("Rewind file 1"));
73 r=file1.Seek(ESeekStart,p);
75 TInt size=WriteBuf.MaxLength();
76 WriteBuf.SetLength(size);
77 test.Next(_L("Get 2K of random data"));
79 for (i=0; i<size; i++)
80 WriteBuf[i]=static_cast<TUint8>(Random(seed));
81 test.Next(_L("Press a key to write to file 1"));
84 file1.Write(WriteBuf,stat);