//
// 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 ANY.
//!	@SYMScriptAuthor 		Dmitri Trofimov
//!	@SYMCreationDate		10/04/2007  
//!	@SYMScriptDescription		The test script contains API tests for the following functions of TParse class:
//!	TParse();
//!	TInt Set(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault);
//!	TInt SetNoWild(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault);
//!	TDes &NameBuf();
//!	const TDesC &NameBufC() const;


LOAD_SUITE	T_SfSrv
//DELAY		5000


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0047
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0047
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		TParse() test or successful object creation.
//!				Uses API elements: TParse()
//! @SYMTestActions		1. Create TParse object.
//!				2. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Function does not leave nor panic.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0047


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0048
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0048
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		Set() test for successful setting up the TParse object. 
//!					Uses API elements: TParse(), Set()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call Set() passing "test.txt" The file specification to be parsed. 
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Set() returns KErrNone.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND		TParse1	Set		PBASE-F32-Parse-PublicApi-0002command2Set
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0048


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0049
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0049
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		Set() test for setting up the TParse object with wildcard in filename. 
//!					Uses API elements: TParse(), Set()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call Set() passing "test.*" The file specification to be parsed. 
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Set() returns KErrNone.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND		TParse1	Set		PBASE-F32-Parse-PublicApi-0003command2Set
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0049


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0050
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0050
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		Set() test for setting up the TParse object with wildcard in filename. 
//!					Uses API elements: TParse(), Set()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call Set() passing "test.???" The file specification to be parsed. 
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	Set() returns KErrNone.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND		TParse1	Set		PBASE-F32-Parse-PublicApi-0004command2Set
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0050


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0051
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0051
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		SetNoWild() test for successful setting up the TParse object.
//!					Uses API elements: SetNoWild()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call SetNoWild() passing "test.txt" as name, "b:\rel" as related file specification, "c:\def\test.txt" as default file specification.
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	SetNoWild() returns KErrNone.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND		TParse1	SetNoWild		PBASE-F32-Parse-PublicApi-0005command2SetNoWild
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0051


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0052
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0052
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		SetNoWild() negative test where file specification to be parsed contain wildcard.
//!					Uses API elements: SetNoWild()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call SetNoWild() passing "c:\base\file.*" as parameter of file specification and check that the function return KErrBadName.
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	SetNoWild() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND	!Error=-28		TParse1	SetNoWild		PBASE-F32-Parse-PublicApi-0006command2SetNoWild
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0052


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0053
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0053
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		SetNoWild() negative test where file specification to be parsed contain wildcard.
//!						Uses API elements: SetNoWild()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call SetNoWild() passing "c:\base\file.tx?" as parameter of file specification and check that ne function eturn KErrBadName
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	SetNoWild() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND	!Error=-28		TParse1	SetNoWild		PBASE-F32-Parse-PublicApi-0007command2SetNoWild
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0053


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0054
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0054
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		SetNoWild() negative test where related file name specification to be parsed contain wildcard.
//!					Uses API elements: SetNoWild()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call SetNoWild() passing "c:file" as name, "c:\base\file.*" as related file specification.
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	SetNoWild() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND	!Error=-28		TParse1	SetNoWild		PBASE-F32-Parse-PublicApi-0008command2SetNoWild
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0054


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0055
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0055
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		SetNoWild() negative test where related file name specification to be parsed contain wildcard.
//!					Uses API elements: SetNoWild()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call SetNoWild() passing "c:file" as name, "c:\base\file.ex?" as related file specification.
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	SetNoWild() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND	!Error=-28		TParse1	SetNoWild		PBASE-F32-Parse-PublicApi-0009command2SetNoWild
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0055


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0056
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0056
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		SetNoWild() negative test where default file name specification to be parsed contain wildcard.
//!					Uses API elements: SetNoWild()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call SetNoWild() passing "c:file" as name, "c:\base\file.*" as default file specification.
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	SetNoWild() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND	!Error=-28		TParse1	SetNoWild		PBASE-F32-Parse-PublicApi-0010command2SetNoWild
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0056


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0057
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0057
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		SetNoWild() negative test where default file name specification to be parsed contain wildcard.
//!					Uses API elements: SetNoWild()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call SetNoWild() passing "c:file" as name, "c:\base\file.ex?" as default file specification.
//!				3. Delete TParse object.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	SetNoWild() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT	TParse		TParse1	
			COMMAND		TParse1		new		
			COMMAND	!Error=-28		TParse1	SetNoWild		PBASE-F32-Parse-PublicApi-0011command2SetNoWild
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0057


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0058
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0058
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		PopDir() test. This test for successful removal of the last directory from the path.
//!					Uses API elements:  PopDir()
//! @SYMTestActions		1. Create TParse object  '. 
//!				2. Call Set() for setting up the  following path name: "c\dir1\dir2\filename.ext"
//!				3. Call PopDir().
//!				4. 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-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND		TParse1 Set		PBASE-F32-Parse-PublicApi-0012command2Set
			COMMAND		TParse1	PopDir			
			COMMAND		TParse1	FullName	PBASE-F32-Parse-PublicApi-0012command4FullName
			COMMAND		TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0058


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0059
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0059
//! @SYMAPI			TParse
//! @SYMTestCaseDesc		AddDir() test. This tests for successful adding of directory to the end of path.
//!					Uses API elements:  AddDir()
//! @SYMTestActions		1. Create TParse object.
//!				2. Call Set() setting path to "c:\dir1\filename.ext"
//!				3. Call AddDir() passing "dir2" string.
//!				4. Call FullName(). Expecting 'c:\dir1\dir2\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-Parse-PublicApi.ini
			CREATE_OBJECT	TParse	TParse1	
			COMMAND		TParse1	new		
			COMMAND		TParse1	Set		PBASE-F32-Parse-PublicApi-0013command2Set
			COMMAND		TParse1	AddDir		PBASE-F32-Parse-PublicApi-0013command3AddDir
			COMMAND		TParse1	FullName	PBASE-F32-Parse-PublicApi-0013command4FullName
			COMMAND		TParse1	~
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0059


START_TESTCASE 			PBASE-F32-Parse-PublicApi-0060
//! @SYMTestCaseID		PBASE-F32-Parse-PublicApi-0060
//! @SYMAPI			TParse
//! @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 TParse object.
//!				2. Call Set() setting path to "c:\dir1\dir2\filename.ext"
//!				3. Call AddDir() passing "\dir3" string.
//!
//! @SYMTestStatus		Implemented
//! @SYMTestPriority		Critical
//! @SYMTestExpectedResults	AddDir() returns KErrBadName.
//! @SYMTestType		CIT
	START_TEST_BLOCK	100	T_SfSrv	\base\PBASE-F32-Parse-PublicApi.ini
			CREATE_OBJECT		TParse	TParse1	
			COMMAND			TParse1	new
			COMMAND			TParse1 Set	PBASE-F32-Parse-PublicApi-0014command2Set
			COMMAND	!Error=-28	TParse1	AddDir	PBASE-F32-Parse-PublicApi-0014command3AddDir
			COMMAND			TParse1	~		
	END_TEST_BLOCK
END_TESTCASE			PBASE-F32-Parse-PublicApi-0060


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


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