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\server\b_rep.cpp
22 GLDEF_D RTest test(_L("B_REP"));
23 LOCAL_D RFile TheFile;
24 GLDEF_D TFileName nameBuf1=_L("B_REP Test File.PAR");
25 GLDEF_D TBuf8<0x200> testPat1;
26 GLDEF_D TBuf8<0x200> chkPat1;
28 const TInt noTimes=500;
36 buf.SetLength(sizeof(TInt));
38 for (TInt numb=0;numb<noTimes;numb++)
41 test.Printf(_L("%d\r"),numb);
43 // Replace file and write data
44 r=TheFile.Replace(TheFs,nameBuf1,EFileStream);
46 r=TheFile.Write(testPat1);
49 Mem::Copy(&buf[0],&numb,sizeof(TInt));
53 // Seek to 0 and check data
55 r=TheFile.Seek(ESeekStart,pos);
58 r=TheFile.Read(chkPat1,len);
60 test(chkPat1==testPat1);
61 r=TheFile.Read(testBuf,sizeof(TInt));
63 TInt chkNumb=*((TInt*)testBuf.Ptr());
66 // Close, then re-open file and check data
68 r=TheFile.Open(TheFs,nameBuf1,EFileStream);
70 r=TheFile.Read(chkPat1,len);
72 test(chkPat1==testPat1);
73 r=TheFile.Read(testBuf,sizeof(TInt));
75 chkNumb=*((TInt*)testBuf.Ptr());
79 test.Printf(_L("\n"));
80 r=TheFs.Delete(nameBuf1);
84 GLDEF_C void CallTestsL(void)
86 testPat1=_L8("TextProcessorPa");
90 testPat1.Append(0x16);
95 testPat1.Append(0x10);
97 test.Start(_L("Root"));
101 test.Next(_L("Subdirectory"));
102 gSessionPath=_L("\\F32-TST\\TEST1\\");
103 TInt r=TheFs.SetSessionPath(gSessionPath);
105 r=TheFs.MkDirAll(gSessionPath);
106 test(r==KErrNone || r==KErrAlreadyExists);