os/ossrv/genericservices/httputils/Test/t_fileuri/CFileUriTest.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __CFILEURITEST_H__
    17 #define __CFILEURITEST_H__
    18 
    19 // System includes
    20 //
    21 #include <e32base.h>
    22 #include <uri8.h>
    23 #include <uri16.h>
    24 
    25 // Local includes
    26 //
    27 #include "IpuTestUtils.h"
    28 #include "ctestbase.h"
    29 
    30 // CFileUriTest - test class for the Uri family of classes for the file URI implementation
    31 //
    32 class CFileUriTest : public CTestBase
    33 	{
    34 public:
    35 	// Static factory c'tor. Leaves pointer to created object on the cleanup stack.
    36 	//
    37 	// Rtn: pointer to newly created object - ownership transfered to caller.
    38 	//
    39 	static CFileUriTest* NewLC(CIpuTestHarness* aTestHarness);
    40 
    41 	// Static factory c'tor.
    42 	//
    43 	// Rtn: pointer to newly created object - ownership transfered to caller.
    44 	//
    45 	static CFileUriTest* NewL(CIpuTestHarness* aTestHarness);
    46 
    47 	// D'tor
    48 	//
    49 	~CFileUriTest();
    50 
    51 	// Runs the defined tests.
    52 	//
    53 	void DoTestsL();
    54 
    55 private:	// Methods
    56 
    57 	// Default c'tor.
    58 	//
    59 	CFileUriTest(CIpuTestHarness* aTestHarness);
    60 
    61 	// Non-trivial c'tor. Second part of 2-phase construction - does all allocation.
    62 	//
    63 	void ConstructL();
    64 
    65 
    66 //
    67 //
    68 //	File Uri Tests
    69 //
    70 //
    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);
    78 
    79 private:	// Attributes
    80 
    81 	// Test harness
    82 	//
    83 	CIpuTestHarness*	iTestHarness;
    84 	};
    85 
    86 #endif	// __CFILEURITEST_H__