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_proc.cpp
25 GLDEF_D RTest test(_L("T_PROC"));
27 LOCAL_C TInt ThreadMain(TAny* /*aPtr*/)
29 // Startup function for thread
34 TInt r=localFs.Connect();
36 User::Panic(_L("tm0"), r);
38 r=localFs.SetSessionPath(gSessionPath);
40 User::Panic(_L("tm1"), r);
45 TBuf<4> dirBuf=_L("?:\\");
46 dirBuf[0] = (TText)gDriveToTest;
47 r=f.Open(localFs,dirBuf,EQuickFormat,count);
49 r=f.Open(localFs,_L("Y:\\"),EQuickFormat,count);
52 User::Panic(_L("tm2"), r);
56 r = RFs::CharToDrive(gSessionPath[0], drv);
58 User::Panic(_L("tm3"), r);
62 r=raw.Open(localFs,drv);
64 User::Panic(_L("tm4"), r);
70 LOCAL_C void testThreads()
72 // Run a process that opens a file, format, directory and check that when
73 // the process closes they are all still accessible.
78 TInt r=thread.Create(_L("Thread1"),ThreadMain,KDefaultStackSize,KMinHeapSize,0x10000,NULL);
80 TRequestStatus reqStat;
81 thread.Logon(reqStat);
84 User::WaitForRequest(reqStat);
87 TBuf<13> dirBuf=_L("?:\\F32-TST\\");
88 dirBuf[0] = (TText)gDriveToTest;
89 r=TheFs.MkDir(dirBuf);
91 r=TheFs.MkDir(_L("Y:\\F32-TST\\"));
93 test(r==KErrNone || r==KErrAlreadyExists);
96 r=f.Open(TheFs,_L("THREADFILE.TEST"),EFileRead);
97 test(r==KErrNotFound || r==KErrPathNotFound || r==KErrNone);
100 r=f.Replace(TheFs,_L("THREADFILE.TEST"),EFileRead|EFileWrite);
105 LOCAL_C void DoTests()
110 // TInt r=TheFs.SessionPath(gSessionPath);
111 // test(r==KErrNone);
116 GLDEF_C void CallTestsL(void)
118 // Test the file server.
125 if (IsSessionDriveLFFS(TheFs,driveLetter))
127 test.Printf(_L("Skipped: test does not run on LFFS.\n"));
130 test.Start(_L("Starting T_PROC test"));
132 test(HAL::Get(HAL::EMachineUid,uid)==KErrNone);
134 if(uid==HAL::EMachineUid_Cogent || uid==HAL::EMachineUid_IQ80310 || uid==HAL::EMachineUid_Integrator || uid==HAL::EMachineUid_X86PC)
136 test.Printf(_L("WARNING: d: not tested on cogent or IQ80310 or Integrator\n"));