sl@0
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __CFILEURITEST_H__
|
sl@0
|
17 |
#define __CFILEURITEST_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
// System includes
|
sl@0
|
20 |
//
|
sl@0
|
21 |
#include <e32base.h>
|
sl@0
|
22 |
#include <uri8.h>
|
sl@0
|
23 |
#include <uri16.h>
|
sl@0
|
24 |
|
sl@0
|
25 |
// Local includes
|
sl@0
|
26 |
//
|
sl@0
|
27 |
#include "IpuTestUtils.h"
|
sl@0
|
28 |
#include "ctestbase.h"
|
sl@0
|
29 |
|
sl@0
|
30 |
// CFileUriTest - test class for the Uri family of classes for the file URI implementation
|
sl@0
|
31 |
//
|
sl@0
|
32 |
class CFileUriTest : public CTestBase
|
sl@0
|
33 |
{
|
sl@0
|
34 |
public:
|
sl@0
|
35 |
// Static factory c'tor. Leaves pointer to created object on the cleanup stack.
|
sl@0
|
36 |
//
|
sl@0
|
37 |
// Rtn: pointer to newly created object - ownership transfered to caller.
|
sl@0
|
38 |
//
|
sl@0
|
39 |
static CFileUriTest* NewLC(CIpuTestHarness* aTestHarness);
|
sl@0
|
40 |
|
sl@0
|
41 |
// Static factory c'tor.
|
sl@0
|
42 |
//
|
sl@0
|
43 |
// Rtn: pointer to newly created object - ownership transfered to caller.
|
sl@0
|
44 |
//
|
sl@0
|
45 |
static CFileUriTest* NewL(CIpuTestHarness* aTestHarness);
|
sl@0
|
46 |
|
sl@0
|
47 |
// D'tor
|
sl@0
|
48 |
//
|
sl@0
|
49 |
~CFileUriTest();
|
sl@0
|
50 |
|
sl@0
|
51 |
// Runs the defined tests.
|
sl@0
|
52 |
//
|
sl@0
|
53 |
void DoTestsL();
|
sl@0
|
54 |
|
sl@0
|
55 |
private: // Methods
|
sl@0
|
56 |
|
sl@0
|
57 |
// Default c'tor.
|
sl@0
|
58 |
//
|
sl@0
|
59 |
CFileUriTest(CIpuTestHarness* aTestHarness);
|
sl@0
|
60 |
|
sl@0
|
61 |
// Non-trivial c'tor. Second part of 2-phase construction - does all allocation.
|
sl@0
|
62 |
//
|
sl@0
|
63 |
void ConstructL();
|
sl@0
|
64 |
|
sl@0
|
65 |
|
sl@0
|
66 |
//
|
sl@0
|
67 |
//
|
sl@0
|
68 |
// File Uri Tests
|
sl@0
|
69 |
//
|
sl@0
|
70 |
//
|
sl@0
|
71 |
void TestFileUriCreationL(const TDesC16& aFullFileName, const TDesC16& aExpectedUri, TUint aFlags) const;
|
sl@0
|
72 |
void TestPrivateFileUriCreationL(const TDesC16& aRelativeFileName, const TDriveNumber aDrive, const TDesC16& aExpectedUri, TUint aFlags) const;
|
sl@0
|
73 |
void TestFileUriComponentExtractionL(const TDesC16& aFileName, const TDesC16& aPath, const TDesC16& aExpectedFileName, const TDesC16& aExpectedDrive, TUint aFlags) const;
|
sl@0
|
74 |
void TestPrivateFileUriComponentExtractionL(const TDesC16& aFileName, const TDriveNumber aDrive, const TDesC16& aPath, const TDesC16& aExpectedFileName, TUint aFlags) const;
|
sl@0
|
75 |
void TestFileUriCreationWithOldAPIAndComponentExtractionL(const TDesC16& aFileName, const TDesC16& aPath, const TDesC16& aExpectedFileName) const;
|
sl@0
|
76 |
void TestFileUriNameExtractionL(const TDesC& aUri, const TDesC& aFilename, const TDesC& aPath);
|
sl@0
|
77 |
void TestFileUriNameExtractionL(const TDesC8& aUri, const TDesC& aFilename, const TDesC& aPath);
|
sl@0
|
78 |
|
sl@0
|
79 |
private: // Attributes
|
sl@0
|
80 |
|
sl@0
|
81 |
// Test harness
|
sl@0
|
82 |
//
|
sl@0
|
83 |
CIpuTestHarness* iTestHarness;
|
sl@0
|
84 |
};
|
sl@0
|
85 |
|
sl@0
|
86 |
#endif // __CFILEURITEST_H__
|