Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
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.
25 // -------- local test data --------
27 RTest test(_L("t_mvdr"));
33 _LIT(KSessionPath, "X:\\");
35 _LIT(KSessionPath, "D:\\");
38 GLDEF_C TInt E32Main()
40 CTrapCleanup* cleanup;
41 cleanup = CTrapCleanup::New();
45 test.Start(_L("Starting T_MVDR"));
47 test(TheFs.Connect() == KErrNone);
49 test(TheFs.SetSessionPath(KSessionPath) == KErrNone);
52 TRAPD(r, fm = CFileMan::NewL(TheFs));
55 const TInt KMaxDirs = 32;
58 for (i = 0; i < KMaxDirs; ++i)
60 TBuf<16> dirName(KSessionPath);
61 dirName.AppendFormat(_L("testdir.%03x\\"), i);
62 test(TheFs.MkDir(dirName) == KErrNone);
66 for (i = 0; i < KMaxDirs; ++i)
68 test.Printf(_L("moving directories from testdir.%03x\r"), i);
71 for (j = 0; j < KMaxDirs; ++j)
73 TBuf<32> srcDirName(KSessionPath);
74 srcDirName.AppendFormat(_L("testdir.%03x\\movedir.%03x\\"), i, ++ctr);
75 test(TheFs.MkDir(srcDirName) == KErrNone);
77 TBuf<32> dstDirName(KSessionPath);
78 dstDirName.AppendFormat(_L("testdir.%03x\\movedir.%03x\\"), j, ++ctr);
79 srcDirName.SetLength(srcDirName.Length() - 1);
80 dstDirName.SetLength(dstDirName.Length() - 1);
81 r = fm->Move(srcDirName, dstDirName);