author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1998-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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32test\server\t_mvdr.cpp |
|
15 |
// Manual test creates a set of directories and moves them from one to another |
|
16 |
// Checks rename operation on directories. Removable media should be checked |
|
17 |
// afterwards with disk verification utility. |
|
18 |
// |
|
19 |
// |
|
20 |
||
21 |
||
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
22 |
#define __E32TEST_EXTENSION__ |
0 | 23 |
#include <e32test.h> |
24 |
#include <f32file.h> |
|
25 |
||
26 |
// -------- local test data -------- |
|
27 |
||
28 |
RTest test(_L("t_mvdr")); |
|
29 |
||
30 |
RFs TheFs; |
|
31 |
RFile TheFile; |
|
32 |
||
33 |
#ifdef __WINS__ |
|
34 |
_LIT(KSessionPath, "X:\\"); |
|
35 |
#else |
|
36 |
_LIT(KSessionPath, "D:\\"); |
|
37 |
#endif |
|
38 |
||
39 |
GLDEF_C TInt E32Main() |
|
40 |
{ |
|
41 |
CTrapCleanup* cleanup; |
|
42 |
cleanup = CTrapCleanup::New(); |
|
43 |
__UHEAP_MARK; |
|
44 |
||
45 |
test.Title(); |
|
46 |
test.Start(_L("Starting T_MVDR")); |
|
47 |
||
48 |
test(TheFs.Connect() == KErrNone); |
|
49 |
||
50 |
test(TheFs.SetSessionPath(KSessionPath) == KErrNone); |
|
51 |
||
52 |
CFileMan *fm = 0; |
|
53 |
TRAPD(r, fm = CFileMan::NewL(TheFs)); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
54 |
test_KErrNone(r); |
0 | 55 |
|
56 |
const TInt KMaxDirs = 32; |
|
57 |
||
58 |
TInt i; |
|
59 |
for (i = 0; i < KMaxDirs; ++i) |
|
60 |
{ |
|
61 |
TBuf<16> dirName(KSessionPath); |
|
62 |
dirName.AppendFormat(_L("testdir.%03x\\"), i); |
|
63 |
test(TheFs.MkDir(dirName) == KErrNone); |
|
64 |
} |
|
65 |
||
66 |
TInt ctr = 0x0ff; |
|
67 |
for (i = 0; i < KMaxDirs; ++i) |
|
68 |
{ |
|
69 |
test.Printf(_L("moving directories from testdir.%03x\r"), i); |
|
70 |
||
71 |
TInt j; |
|
72 |
for (j = 0; j < KMaxDirs; ++j) |
|
73 |
{ |
|
74 |
TBuf<32> srcDirName(KSessionPath); |
|
75 |
srcDirName.AppendFormat(_L("testdir.%03x\\movedir.%03x\\"), i, ++ctr); |
|
76 |
test(TheFs.MkDir(srcDirName) == KErrNone); |
|
77 |
||
78 |
TBuf<32> dstDirName(KSessionPath); |
|
79 |
dstDirName.AppendFormat(_L("testdir.%03x\\movedir.%03x\\"), j, ++ctr); |
|
80 |
srcDirName.SetLength(srcDirName.Length() - 1); |
|
81 |
dstDirName.SetLength(dstDirName.Length() - 1); |
|
82 |
r = fm->Move(srcDirName, dstDirName); |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
test_KErrNone(r); |
0 | 84 |
} |
85 |
} |
|
86 |
||
87 |
delete fm; |
|
88 |
||
89 |
TheFs.Close(); |
|
90 |
test.End(); |
|
91 |
test.Close(); |
|
92 |
||
93 |
__UHEAP_MARKEND; |
|
94 |
delete cleanup; |
|
95 |
||
96 |
return KErrNone; |
|
97 |
} |
|
98 |