diff -r 000000000000 -r a41df078684a kerneltest/e32test/pccd/t_multislot.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kerneltest/e32test/pccd/t_multislot.cpp Mon Oct 19 15:55:17 2009 +0100 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 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: +* +*/ +#include +#include + +static RTest test(_L("Testing t_multislot")); +_LIT(KYes, "yes"); +_LIT(KNo, "no"); +static RFs fs; + +// this function was copied from t_sdpartition.cpp +TInt FindMmcLocalDriveNumber(TChar aDriveChar, TInt& aLocalDriveNum, TInt aDriveNum) + { + TInt r = fs.CharToDrive(aDriveChar, aDriveNum); + test(r==KErrNone); + + TDriveInfo driveInfo; + r = fs.Drive(driveInfo, aDriveNum); + test(r==KErrNone); + + + TVolumeInfo vi; + r = fs.Volume(vi, aDriveNum); + test(r==KErrNone); + + + TMediaSerialNumber serialNum; + r = fs.GetMediaSerialNumber(serialNum, aDriveNum); + test(r==KErrNone); + + + test.Printf(_L("Drive %C size %ld\n"), (char) aDriveChar, vi.iSize); + TInt len = serialNum.Length(); + test.Printf(_L("Serial number (len %d) :"), len); + TInt n; + for (n=0; n buf; + for (TInt m=n; m hexBuf; + hexBuf.Format(_L("%02X "),serialNum[m]); + buf.Append(hexBuf); + } + buf.Append(_L("\n")); + test.Printf(buf); + } + + TBusLocalDrive drv; + TBool chg(EFalse); + aLocalDriveNum = -1; + TInt serialNumbersMatched = 0; + for (n=0; n")); + test.Getch(); + // Get second local drive number for same logical drive (should be different local drive number). + test(FindMmcLocalDriveNumber(driveChar,SecondlocDrvNum,driveNum)==KErrNone); + if(FirstlocDrvNum!=SecondlocDrvNum) + { + pass=ETrue; + break; + } + // else perhaps this wasn't a multislot drive + } + test(pass); + test.End(); + test.Close(); + + fs.Close(); + return KErrNone; + } +