0
|
1 |
// Copyright (c) 2007-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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#ifndef SDBASE_H
|
|
17 |
#define SDBASE_H
|
|
18 |
|
|
19 |
#include <testexecuteserverbase.h>
|
|
20 |
#include <testexecutestepbase.h>
|
|
21 |
#include "d_mmcif.h"
|
|
22 |
|
|
23 |
#define SYMBIAN_TEST_LE2(a,b) (((b) << 8) + (a))
|
|
24 |
#define SYMBIAN_TEST_LE4(a,b,c,d) (((d) << 24) + ((c) << 16) + ((b) << 8) + (a))
|
|
25 |
#define SYMBIAN_TEST_CEIL(a,b) ((a) % (b) ? 1 + ((a) - (a) % (b)) / (b) : (a) / (b))
|
|
26 |
#define SYMBIAN_TEST_IP(a,b) ((a) % (b) ? 1 + ((a) - (a) % (b)) / (b) : (a) / (b))
|
|
27 |
|
|
28 |
/*
|
|
29 |
Base class for all test steps
|
|
30 |
*/
|
|
31 |
class CBaseTestSDBase : public CTestStep
|
|
32 |
{
|
|
33 |
public:
|
|
34 |
virtual TVerdict doTestStepPreambleL() = 0;
|
|
35 |
virtual TVerdict doTestStepPostambleL();
|
|
36 |
|
|
37 |
protected:
|
|
38 |
// The following four functions can be called in the test preamble.
|
|
39 |
TBool InitDriveLetter(); // Initialise attribute iDrive
|
|
40 |
TBool InitDeviceDriver(); // Load D_MMCIF device driver for direct disk access
|
|
41 |
TBool InitFileServer(); // Initialise attribute iFs
|
|
42 |
TBool InitFileMan(); // Initialise attribute iFileMan
|
|
43 |
|
|
44 |
// Direct disk access. InitDeviceDriver() must be called first
|
|
45 |
TInt ReadSector(TInt aSector, TDes8& aSectorBuffer);
|
|
46 |
TInt WriteSector(TInt aSector, const TDesC8& aSectorBuffer);
|
|
47 |
|
|
48 |
TMmcCardInfo iCardInfo;
|
|
49 |
TInt iCardSizeInSectors;
|
|
50 |
|
|
51 |
// Call InitFileServer() before using iFs
|
|
52 |
RFs iFs;
|
|
53 |
|
|
54 |
// Call InitFileMan() before using iFileMan
|
|
55 |
CFileMan *iFileMan;
|
|
56 |
|
|
57 |
// The drive number assigned to the SD card. Call InitDriveLetter() first
|
|
58 |
TInt iDrive;
|
|
59 |
|
|
60 |
private:
|
|
61 |
RMmcCntrlIf iDriver;
|
|
62 |
};
|
|
63 |
|
|
64 |
#endif // SDBASE_H
|