diff -r 000000000000 -r bde4ae8d615e os/kernelhwsrv/kerneltest/f32test/fsstress/t_sess.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/kernelhwsrv/kerneltest/f32test/fsstress/t_sess.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,182 @@ +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// f32test\fsstress\t_sess.cpp +// +// + +#include "t_sess.h" + +#include "t_server.h" +#include "t_chlffs.h" + +GLDEF_D RTest test(_L("T_SESS")); +GLDEF_D TFileName gTestSessionPath; + +// These objects are too large to be placed on the stack - ~15 sessions is enough +// to cause a stack overflow on ARM4. +const TInt KMaxNumberSessions=25; +RFs gSession[KMaxNumberSessions]; +TSessionTest gTestObject[KMaxNumberSessions]; + + +LOCAL_C void SetSessionPath(RFs aFs,TChar aDriveLetter) +// +// Set the session path for a RFs connection to aDrive +// + { + gTestSessionPath=(_L("?:\\SESSION_TEST\\")); + gTestSessionPath[0]=(TText)aDriveLetter; + TInt r=aFs.SetSessionPath(gTestSessionPath); + test(r==KErrNone); + r=aFs.MkDirAll(gTestSessionPath); + test(r==KErrNone || r==KErrAlreadyExists); + } + + +GLDEF_C void CallTestsL() +// +// This test makes a number of fileserver connections (sessions) +// The fileserver is stressed by running these sessions concurrently, swapping +// between them whilst testing various fileserver API functions +// Further testing of the fileserver is performed by closing connections one by +// one whilst ensuring their closure does not affect the other connected sessions +// + { + test.Title(); + + TChar driveLetter; + if (IsSessionDriveLFFS(TheFs,driveLetter)) + { + test.Printf(_L("CallTestsL: Skipped: test does not run on LFFS.\n")); + return; + } + + test.Start(_L("Starting T_SESSION tests...")); + +// Create an array of fileserver sessions +// Create an array of TSessionTest objects + + TInt i=0; + + TInt r; + for (; i