//
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description: 
//
//!	@file
//!	@SYMTestSuiteName		pbase-f32-sfsrv-publicapi-any
//!	@SYMScriptTestEnvironment	This test script requires a basic ROM.
//!	@SYMScriptAuthor 		Dmitri Trofimov, Sergei Tveritin.
//!	@SYMCreationDate		11/11/2007  
//!	@SYMScriptDescription		The test script contains API tests for the following functions of TParsePtr class:
//!	TParsePtr(TDes &aName);
//!	TDes &NameBuf();
//!	const TDesC &NameBufC() const;


LOAD_SUITE	T_SfSrv
//DELAY		5000


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0047
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0047
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		TParsePtr() test.
//!				Uses API elements: TParsePtr()
//! @SYMTestActions		1. Create TParsePtr object passing "c:\path1\path2\file.ext" as parameter.
//!				2. Delete TParsePtr object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Function does not leave nor panic.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT	TParsePtr	TParsePtr1	
			COMMAND		TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0001command1new
			COMMAND		TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0047


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0048
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0048
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		TParsePtr() test, where name passed in constructor are NUUL.
//!				Uses API elements: TParsePtr()
//! @SYMTestActions		1. Create TParsePtr object passing "0" as parameter.
//!				2. Delete TParsePtr object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Function does not leave nor panic.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT	TParsePtr	TParsePtr1	
			COMMAND		TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0002command1new
			COMMAND		TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0048


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0049
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0049
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		TParsePtr() negative test, where name passed in constructor contain illegal path construction.
//!				Uses API elements: TParsePtr()
//! @SYMTestActions		1. Create TParsePtr object passing "c::\file.ext" as parameter.
//!				2. Delete TParsePtr object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Function return panic code FSCLIENT=24.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT	TParsePtr	TParsePtr1	
			COMMAND		TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0003command1new
			COMMAND		TParsePtr1	~		
	END_TEST_BLOCK	!PanicCode=24 !PanicString="FSCLIENT panic"	
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0049


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0050
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0050
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		TParsePtr() test, where name passed in constructor contain wildcards.
//!				Uses API elements: TParsePtr()
//! @SYMTestActions		1. Create TParsePtr object passing "c:\file?.*" as parameter.
//!				2. Delete TParsePtr object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Function does not leave nor panic.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT	TParsePtr	TParsePtr1	
			COMMAND		TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0004command1new
			COMMAND		TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0050

START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0051
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0051
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		PopDir() test. This test for successful removal of the last directory from the path.
//!					Uses API elements:  PopDir()
//! @SYMTestActions		1. Create TParsePtr object setting up the  following path name: "c\dir\filename.ext". 
//!				2. Call PopDir().
//!				3. Call FullName(). Expecting 'c:\dir1\filename.ext'
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	PopDir() returns KErrNone. The value returned by FullName() is the same as expected.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT	TParsePtr	TParsePtr1	
			COMMAND		TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0005command2Set
			COMMAND		TParsePtr1	PopDir			
			COMMAND		TParsePtr1	FullName	PBASE-F32-ParsePtr-PublicApi-0005command4FullName
			COMMAND		TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0051


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0052
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0052
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		AddDir() test. This tests for successful adding of directory to the end of path.
//!					Uses API elements:  AddDir()
//! @SYMTestActions		1. Create TParsePtr object setting path to "c:\dir1\dir2\filename.ext".
//!				2. Call AddDir() passing "dir3" string.
//!				3. Call FullName(). Expecting 'c:\dir1\dir2\dir3\filename.ext'
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	AddDir() returns KErrNone. The value returned by FullName() is the same as expected.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT	TParsePtr	TParsePtr1	
			COMMAND		TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0006command2Set
			COMMAND		TParsePtr1	AddDir		PBASE-F32-ParsePtr-PublicApi-0006command3AddDir
			COMMAND		TParsePtr1	FullName	PBASE-F32-ParsePtr-PublicApi-0006command4FullName
			COMMAND		TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0052


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0053
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0053
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		AddDir() negative test. This tests for the function to return error KErrBadName in case the directory to add begins with slash "\".
//!				ses API elements:  AddDir()
//! @SYMTestActions		1. Create TParsePtr object  setting path to "c:\dir1\dir2\filename.ext".
//!				2. Call AddDir() passing "\dir3" string.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	AddDir() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT		TParsePtr	TParsePtr1	
			COMMAND			TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0007command2Set
			COMMAND	!Error=-28	TParsePtr1	AddDir		PBASE-F32-ParsePtr-PublicApi-0007command3AddDir
			COMMAND			TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0053


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0054
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0054
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		AddDir() test, where name of directory contains the wildcard.
//!					Uses API elements:  AddDir()
//! @SYMTestActions		1. Create TParsePtr object  setting path to "c:\dir1\dir2\filename.ext".
//!				2. Call AddDir() passing a "dir*"
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	AddDir() returns KErrNone.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT	TParsePtr	TParsePtr1	
			COMMAND		TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0008command2Set
			COMMAND		TParsePtr1	AddDir		PBASE-F32-ParsePtr-PublicApi-0008command3AddDir
			COMMAND		TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0054


START_TESTCASE 			PBASE-F32-ParsePtr-PublicApi-0055
//! @SYMTestCaseID		PBASE-F32-ParsePtr-PublicApi-0055
//! @SYMAPI			TParsePtr
//! @SYMTestCaseDesc		AddDir() negative test, where name of directory ended with a "\".
//!					Uses API elements:  AddDir()
//! @SYMTestActions		1. Create TParsePtr object  setting path to "c:\dir1\dir2\filename.ext".
//!				2. Call AddDir() passing  "dir3\".
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	AddDir() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-ParsePtr-PublicApi.ini
			CREATE_OBJECT		TParsePtr	TParsePtr1	
			COMMAND			TParsePtr1	new		PBASE-F32-ParsePtr-PublicApi-0009command2Set
			COMMAND	!Error=-28	TParsePtr1	AddDir		PBASE-F32-ParsePtr-PublicApi-0009command3AddDir
			COMMAND			TParsePtr1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-ParsePtr-PublicApi-0055
