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_clobbr.cpp
22 GLDEF_D RTest test(_L("T_CLOBBR"));
24 GLDEF_C void CallTestsL(void)
26 // Test writing to a file and changing its size
29 test.Next(_L("Write file & change size"));
32 TInt r=file.Replace(TheFs,_L("test.dat"),EFileWrite);
35 r=file.Write(0,_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"));
39 test(r==KErrNone&&buf1.Length()==36);
40 if (buf1!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
41 test.Printf(_L("1). *BAD*\n"));
47 test(r==KErrNone&&buf2.Length()==0x40);
49 if (buf2!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
50 test.Printf(_L("2). *BAD*\n"));
56 test(r==KErrNone&&buf3.Length()==0x40);
58 if (buf3!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
59 test.Printf(_L("3). *BAD*\n"));
61 r=file.Write(0,_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"));
65 test(r==KErrNone&&buf4.Length()==0x40);
67 if (buf4!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
68 test.Printf(_L("4). *BAD*\n"));
73 test(r==KErrNone&&buf5.Length()==0x40);
75 if (buf5!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
76 test.Printf(_L("5). *BAD*\n"));
81 test(r==KErrNone&&buf6.Length()==0x40);
83 if (buf6!=_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))
84 test.Printf(_L("6). *BAD*\n"));
87 #if !defined(_UNICODE)
88 test.Printf(_L("\n"));
89 test.Printf(_L("1). %S\n"),&buf1);
90 test.Printf(_L("2). %S\n"),&buf2);
91 test.Printf(_L("3). %S\n"),&buf3);
92 test.Printf(_L("4). %S\n"),&buf4);
93 test.Printf(_L("5). %S\n"),&buf5);
94 test.Printf(_L("6). %S\n"),&buf6);