31 |
30 |
32 test.Next(_L("Format the disk")); |
31 test.Next(_L("Format the disk")); |
33 RFormat format; |
32 RFormat format; |
34 TFileName sessionPath; |
33 TFileName sessionPath; |
35 TInt r=TheFs.SessionPath(sessionPath); |
34 TInt r=TheFs.SessionPath(sessionPath); |
36 test_KErrNone(r); |
35 test(r==KErrNone); |
37 TInt count; |
36 TInt count; |
38 r=format.Open(TheFs,sessionPath,EHighDensity,count); |
37 r=format.Open(TheFs,sessionPath,EHighDensity,count); |
39 test_KErrNone(r); |
38 test(r==KErrNone); |
40 // test(count==100); |
39 // test(count==100); |
41 // TRequestStatus status; |
40 // TRequestStatus status; |
42 // TPckgBuf<TInt> step; |
41 // TPckgBuf<TInt> step; |
43 // do { |
42 // do { |
44 // format.Next(step,status); |
43 // format.Next(step,status); |
66 TUint size=0x340000; // 3.25MB |
65 TUint size=0x340000; // 3.25MB |
67 |
66 |
68 test.Printf(_L("FileSize = 0x%x\n"),size); |
67 test.Printf(_L("FileSize = 0x%x\n"),size); |
69 RFile file; |
68 RFile file; |
70 TInt r=file.Replace(TheFs,_L("\\F32-TST\\GOBBLE.DAT"),EFileRead); |
69 TInt r=file.Replace(TheFs,_L("\\F32-TST\\GOBBLE.DAT"),EFileRead); |
71 test_KErrNone(r); |
70 test(r==KErrNone); |
72 r=file.SetSize(size); |
71 r=file.SetSize(size); |
73 test_Value(r, r == KErrNone || r==KErrDiskFull); |
72 test(r==KErrNone || r==KErrDiskFull); |
74 if (r==KErrDiskFull) |
73 if (r==KErrDiskFull) |
75 { |
74 { |
76 TFileName sessionPath; |
75 TFileName sessionPath; |
77 r=TheFs.SessionPath(sessionPath); |
76 r=TheFs.SessionPath(sessionPath); |
78 test_KErrNone(r); |
77 test(r==KErrNone); |
79 test.Printf(_L("Error %S diskfull\n"),&sessionPath); |
78 test.Printf(_L("Error %S diskfull\n"),&sessionPath); |
80 // Reintroduce when we can detect that the test is being run manually |
79 // Reintroduce when we can detect that the test is being run manually |
81 // test.Getch(); |
80 // test.Getch(); |
82 } |
81 } |
83 file.Close(); |
82 file.Close(); |
124 bfDir.Append(bfDrv); |
123 bfDir.Append(bfDrv); |
125 _LIT(KTstDir, "t\\"); |
124 _LIT(KTstDir, "t\\"); |
126 bfDir.Append(KTstDir); |
125 bfDir.Append(KTstDir); |
127 test.Printf(_L("creating directory \"%S\".\n"), &bfDir); |
126 test.Printf(_L("creating directory \"%S\".\n"), &bfDir); |
128 r = TheFs.MkDir(bfDir); |
127 r = TheFs.MkDir(bfDir); |
129 test_KErrNone(r); |
128 test(r == KErrNone); |
130 |
129 |
131 TBuf<3 + 3 + 8 + 1 + 3> bfFlNm(bfDir); |
130 TBuf<3 + 3 + 8 + 1 + 3> bfFlNm(bfDir); |
132 TInt ctr = 0; // create files until KErrDiskFull |
131 TInt ctr = 0; // create files until KErrDiskFull |
133 do |
132 do |
134 { |
133 { |
139 _L("\rcreating %S @ %08x (total %08x)"), |
138 _L("\rcreating %S @ %08x (total %08x)"), |
140 &bfFlNm, KFileSize, ctr * KFileSize); |
139 &bfFlNm, KFileSize, ctr * KFileSize); |
141 |
140 |
142 RFile f; |
141 RFile f; |
143 r = f.Create(TheFs, bfFlNm, EFileShareExclusive | EFileStream | EFileWrite); |
142 r = f.Create(TheFs, bfFlNm, EFileShareExclusive | EFileStream | EFileWrite); |
144 test_Value(r, r == KErrNone || r == KErrDiskFull); |
143 test(r == KErrNone || r == KErrDiskFull); |
145 if (r == KErrNone) |
144 if (r == KErrNone) |
146 { |
145 { |
147 r = f.SetSize(KFileSize); |
146 r = f.SetSize(KFileSize); |
148 test_Value(r, r == KErrNone || r == KErrDiskFull); |
147 test(r == KErrNone || r == KErrDiskFull); |
149 } |
148 } |
150 f.Close(); |
149 f.Close(); |
151 |
150 |
152 ++ctr; |
151 ++ctr; |
153 } while (r != KErrDiskFull); |
152 } while (r != KErrDiskFull); |
183 test.Title(); |
182 test.Title(); |
184 test.Start(_L("Starting T_OOM test")); |
183 test.Start(_L("Starting T_OOM test")); |
185 |
184 |
186 TDriveInfo driveInfo; |
185 TDriveInfo driveInfo; |
187 TInt r=TheFs.Drive(driveInfo); |
186 TInt r=TheFs.Drive(driveInfo); |
188 test_KErrNone(r); |
187 test(r==KErrNone); |
189 if (driveInfo.iType==EMediaNotPresent) |
188 if (driveInfo.iType==EMediaNotPresent) |
190 { |
189 { |
191 test.Printf(_L("ERROR: MEDIA NOT PRESENT\n")); |
190 test.Printf(_L("ERROR: MEDIA NOT PRESENT\n")); |
192 // Reintroduce when we can detect that the test is being run manually |
191 // Reintroduce when we can detect that the test is being run manually |
193 // test.Getch(); |
192 // test.Getch(); |
194 return; |
193 return; |
195 } |
194 } |
196 |
195 |
197 TFileName sessionPath; |
196 TFileName sessionPath; |
198 r=TheFs.SessionPath(sessionPath); |
197 r=TheFs.SessionPath(sessionPath); |
199 test_KErrNone(r); |
198 test(r==KErrNone); |
200 r=TheFs.MkDirAll(sessionPath); |
199 r=TheFs.MkDirAll(sessionPath); |
201 test_Value(r, r == KErrCorrupt || r==KErrAlreadyExists || r==KErrNone); |
200 test(r==KErrCorrupt || r==KErrAlreadyExists || r==KErrNone); |
202 if (r==KErrCorrupt) |
201 if (r==KErrCorrupt) |
203 FormatFat(); |
202 FormatFat(); |
204 if (r==KErrAlreadyExists) |
203 if (r==KErrAlreadyExists) |
205 { |
204 { |
206 test.Next(_L("Remove test directory")); |
205 test.Next(_L("Remove test directory")); |
207 CFileMan* fman=CFileMan::NewL(TheFs); |
206 CFileMan* fman=CFileMan::NewL(TheFs); |
208 TInt ret=fman->RmDir(sessionPath); |
207 TInt ret=fman->RmDir(sessionPath); |
209 test_KErrNone(ret); |
208 test(ret==KErrNone); |
210 delete fman; |
209 delete fman; |
211 } |
210 } |
212 if (r!=KErrNone) |
211 if (r!=KErrNone) |
213 { |
212 { |
214 r=TheFs.MkDirAll(sessionPath); |
213 r=TheFs.MkDirAll(sessionPath); |
215 test_KErrNone(r); |
214 test(r==KErrNone); |
216 } |
215 } |
217 |
216 |
218 Test1(); |
217 Test1(); |
219 |
218 |
220 TestRAMDriveLimit(); |
219 TestRAMDriveLimit(); |