os/ossrv/genericservices/httputils/Test/t_fileuri/CFileUriTest.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericservices/httputils/Test/t_fileuri/CFileUriTest.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,86 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __CFILEURITEST_H__
    1.20 +#define __CFILEURITEST_H__
    1.21 +
    1.22 +// System includes
    1.23 +//
    1.24 +#include <e32base.h>
    1.25 +#include <uri8.h>
    1.26 +#include <uri16.h>
    1.27 +
    1.28 +// Local includes
    1.29 +//
    1.30 +#include "IpuTestUtils.h"
    1.31 +#include "ctestbase.h"
    1.32 +
    1.33 +// CFileUriTest - test class for the Uri family of classes for the file URI implementation
    1.34 +//
    1.35 +class CFileUriTest : public CTestBase
    1.36 +	{
    1.37 +public:
    1.38 +	// Static factory c'tor. Leaves pointer to created object on the cleanup stack.
    1.39 +	//
    1.40 +	// Rtn: pointer to newly created object - ownership transfered to caller.
    1.41 +	//
    1.42 +	static CFileUriTest* NewLC(CIpuTestHarness* aTestHarness);
    1.43 +
    1.44 +	// Static factory c'tor.
    1.45 +	//
    1.46 +	// Rtn: pointer to newly created object - ownership transfered to caller.
    1.47 +	//
    1.48 +	static CFileUriTest* NewL(CIpuTestHarness* aTestHarness);
    1.49 +
    1.50 +	// D'tor
    1.51 +	//
    1.52 +	~CFileUriTest();
    1.53 +
    1.54 +	// Runs the defined tests.
    1.55 +	//
    1.56 +	void DoTestsL();
    1.57 +
    1.58 +private:	// Methods
    1.59 +
    1.60 +	// Default c'tor.
    1.61 +	//
    1.62 +	CFileUriTest(CIpuTestHarness* aTestHarness);
    1.63 +
    1.64 +	// Non-trivial c'tor. Second part of 2-phase construction - does all allocation.
    1.65 +	//
    1.66 +	void ConstructL();
    1.67 +
    1.68 +
    1.69 +//
    1.70 +//
    1.71 +//	File Uri Tests
    1.72 +//
    1.73 +//
    1.74 +	void TestFileUriCreationL(const TDesC16& aFullFileName, const TDesC16& aExpectedUri, TUint aFlags) const;
    1.75 +	void TestPrivateFileUriCreationL(const TDesC16& aRelativeFileName, const TDriveNumber aDrive, const TDesC16& aExpectedUri, TUint aFlags) const;
    1.76 +	void TestFileUriComponentExtractionL(const TDesC16& aFileName, const TDesC16& aPath, const TDesC16& aExpectedFileName, const TDesC16& aExpectedDrive, TUint aFlags) const;
    1.77 +	void TestPrivateFileUriComponentExtractionL(const TDesC16& aFileName, const TDriveNumber aDrive, const TDesC16& aPath, const TDesC16& aExpectedFileName, TUint aFlags) const;
    1.78 +	void TestFileUriCreationWithOldAPIAndComponentExtractionL(const TDesC16& aFileName, const TDesC16& aPath, const TDesC16& aExpectedFileName) const;
    1.79 +	void TestFileUriNameExtractionL(const TDesC& aUri, const TDesC& aFilename, const TDesC& aPath);
    1.80 +	void TestFileUriNameExtractionL(const TDesC8& aUri, const TDesC& aFilename, const TDesC& aPath);
    1.81 +
    1.82 +private:	// Attributes
    1.83 +
    1.84 +	// Test harness
    1.85 +	//
    1.86 +	CIpuTestHarness*	iTestHarness;
    1.87 +	};
    1.88 +
    1.89 +#endif	// __CFILEURITEST_H__