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 // File Name: f32test\bench\t_fat_perf_main.cpp
15 // This file is intentionally created although t_main.cpp exists
16 // to start our tests.This file contains only necessary code to
17 // start our tests, whereas t_main.cpp creates test directory
18 // \\F32-TST\\, which will affect 'LeafDirCache' test cases
23 #define __E32TEST_EXTENSION__
33 TFileName gSessionPath;
37 void SetSessionPath(const TDesC& aPathName)
39 // Set the session path and update gSessionPath
43 TInt r=TheFs.SetSessionPath(aPathName);
45 r=TheFs.SessionPath(gSessionPath);
51 // Return the current drive number
56 TInt r=TheFs.CharToDrive(gSessionPath[0],driveNum);
61 LOCAL_C void PushLotsL()
63 // Expand the cleanup stack
68 CleanupStack::PushL((CBase*)NULL);
69 CleanupStack::Pop(1000);
72 LOCAL_C void DoTests(TInt aDrive)
74 // Do testing on aDrive
78 gSessionPath=_L("?:\\");
80 TInt r=TheFs.DriveToChar(aDrive,driveLetter);
82 gSessionPath[0]=(TText)driveLetter;
83 r=TheFs.SetSessionPath(gSessionPath);
86 TheFs.ResourceCountMarkStart();
89 TheFs.ResourceCountMarkEnd();
92 test.Printf(_L("Error: Leave %d\n"),r);
99 void ParseCommandArguments()
102 User::CommandLine(cmd);
104 TPtrC token=lex.NextToken();
105 TFileName thisfile=RProcess().FileName();
106 if (token.MatchF(thisfile)==0)
108 token.Set(lex.NextToken());
110 test.Printf(_L("CLP=%S"),&token);
112 if (token.Length()!=0)
114 gDriveToTest=token[0];
115 gDriveToTest.UpperCase();
127 CTrapCleanup* cleanup;
128 cleanup=CTrapCleanup::New();
129 TRAPD(r,PushLotsL());
133 test.Start(_L("Starting tests..."));
135 ParseCommandArguments(); //need this for drive letter to test
141 r=TheFs.CharToDrive(gDriveToTest,theDrive);