First public contribution.
1 // Copyright (c) 2004-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 "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.
16 #ifndef __CFILEURITEST_H__
17 #define __CFILEURITEST_H__
27 #include "IpuTestUtils.h"
28 #include "ctestbase.h"
30 // CFileUriTest - test class for the Uri family of classes for the file URI implementation
32 class CFileUriTest : public CTestBase
35 // Static factory c'tor. Leaves pointer to created object on the cleanup stack.
37 // Rtn: pointer to newly created object - ownership transfered to caller.
39 static CFileUriTest* NewLC(CIpuTestHarness* aTestHarness);
41 // Static factory c'tor.
43 // Rtn: pointer to newly created object - ownership transfered to caller.
45 static CFileUriTest* NewL(CIpuTestHarness* aTestHarness);
51 // Runs the defined tests.
59 CFileUriTest(CIpuTestHarness* aTestHarness);
61 // Non-trivial c'tor. Second part of 2-phase construction - does all allocation.
71 void TestFileUriCreationL(const TDesC16& aFullFileName, const TDesC16& aExpectedUri, TUint aFlags) const;
72 void TestPrivateFileUriCreationL(const TDesC16& aRelativeFileName, const TDriveNumber aDrive, const TDesC16& aExpectedUri, TUint aFlags) const;
73 void TestFileUriComponentExtractionL(const TDesC16& aFileName, const TDesC16& aPath, const TDesC16& aExpectedFileName, const TDesC16& aExpectedDrive, TUint aFlags) const;
74 void TestPrivateFileUriComponentExtractionL(const TDesC16& aFileName, const TDriveNumber aDrive, const TDesC16& aPath, const TDesC16& aExpectedFileName, TUint aFlags) const;
75 void TestFileUriCreationWithOldAPIAndComponentExtractionL(const TDesC16& aFileName, const TDesC16& aPath, const TDesC16& aExpectedFileName) const;
76 void TestFileUriNameExtractionL(const TDesC& aUri, const TDesC& aFilename, const TDesC& aPath);
77 void TestFileUriNameExtractionL(const TDesC8& aUri, const TDesC& aFilename, const TDesC& aPath);
79 private: // Attributes
83 CIpuTestHarness* iTestHarness;
86 #endif // __CFILEURITEST_H__