sl@0: // sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: //! @file sl@0: //! @SYMTestSuiteName pbase-f32-sfsrv-publicapi-any sl@0: //! @SYMScriptTestEnvironment This test script requires a basic ANY. sl@0: //! @SYMScriptAuthor Dmitri Trofimov sl@0: //! @SYMCreationDate 10/04/2007 sl@0: //! @SYMScriptDescription The test script contains API tests for the following functions of TParse class: sl@0: //! TParse(); sl@0: //! TInt Set(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault); sl@0: //! TInt SetNoWild(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault); sl@0: //! TDes &NameBuf(); sl@0: //! const TDesC &NameBufC() const; sl@0: sl@0: sl@0: LOAD_SUITE T_SfSrv sl@0: //DELAY 5000 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0047 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0047 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc TParse() test or successful object creation. sl@0: //! Uses API elements: TParse() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults Function does not leave nor panic. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0047 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0048 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0048 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc Set() test for successful setting up the TParse object. sl@0: //! Uses API elements: TParse(), Set() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call Set() passing "test.txt" The file specification to be parsed. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults Set() returns KErrNone. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0002command2Set sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0048 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0049 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0049 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc Set() test for setting up the TParse object with wildcard in filename. sl@0: //! Uses API elements: TParse(), Set() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call Set() passing "test.*" The file specification to be parsed. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults Set() returns KErrNone. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0003command2Set sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0049 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0050 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0050 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc Set() test for setting up the TParse object with wildcard in filename. sl@0: //! Uses API elements: TParse(), Set() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call Set() passing "test.???" The file specification to be parsed. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults Set() returns KErrNone. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0004command2Set sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0050 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0051 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0051 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc SetNoWild() test for successful setting up the TParse object. sl@0: //! Uses API elements: SetNoWild() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call SetNoWild() passing "test.txt" as name, "b:\rel" as related file specification, "c:\def\test.txt" as default file specification. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetNoWild() returns KErrNone. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0005command2SetNoWild sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0051 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0052 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0052 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc SetNoWild() negative test where file specification to be parsed contain wildcard. sl@0: //! Uses API elements: SetNoWild() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call SetNoWild() passing "c:\base\file.*" as parameter of file specification and check that the function return KErrBadName. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetNoWild() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0006command2SetNoWild sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0052 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0053 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0053 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc SetNoWild() negative test where file specification to be parsed contain wildcard. sl@0: //! Uses API elements: SetNoWild() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call SetNoWild() passing "c:\base\file.tx?" as parameter of file specification and check that ne function eturn KErrBadName sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetNoWild() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0007command2SetNoWild sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0053 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0054 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0054 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc SetNoWild() negative test where related file name specification to be parsed contain wildcard. sl@0: //! Uses API elements: SetNoWild() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.*" as related file specification. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetNoWild() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0008command2SetNoWild sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0054 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0055 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0055 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc SetNoWild() negative test where related file name specification to be parsed contain wildcard. sl@0: //! Uses API elements: SetNoWild() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.ex?" as related file specification. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetNoWild() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0009command2SetNoWild sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0055 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0056 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0056 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc SetNoWild() negative test where default file name specification to be parsed contain wildcard. sl@0: //! Uses API elements: SetNoWild() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.*" as default file specification. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetNoWild() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0010command2SetNoWild sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0056 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0057 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0057 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc SetNoWild() negative test where default file name specification to be parsed contain wildcard. sl@0: //! Uses API elements: SetNoWild() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call SetNoWild() passing "c:file" as name, "c:\base\file.ex?" as default file specification. sl@0: //! 3. Delete TParse object. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetNoWild() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND !Error=-28 TParse1 SetNoWild PBASE-F32-Parse-PublicApi-0011command2SetNoWild sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0057 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0058 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0058 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc PopDir() test. This test for successful removal of the last directory from the path. sl@0: //! Uses API elements: PopDir() sl@0: //! @SYMTestActions 1. Create TParse object '. sl@0: //! 2. Call Set() for setting up the following path name: "c\dir1\dir2\filename.ext" sl@0: //! 3. Call PopDir(). sl@0: //! 4. Call FullName(). Expecting 'c:\dir1\filename.ext' sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults PopDir() returns KErrNone. The value returned by FullName() is the same as expected. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0012command2Set sl@0: COMMAND TParse1 PopDir sl@0: COMMAND TParse1 FullName PBASE-F32-Parse-PublicApi-0012command4FullName sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0058 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0059 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0059 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc AddDir() test. This tests for successful adding of directory to the end of path. sl@0: //! Uses API elements: AddDir() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call Set() setting path to "c:\dir1\filename.ext" sl@0: //! 3. Call AddDir() passing "dir2" string. sl@0: //! 4. Call FullName(). Expecting 'c:\dir1\dir2\filename.ext' sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults AddDir() returns KErrNone. The value returned by FullName() is the same as expected. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0013command2Set sl@0: COMMAND TParse1 AddDir PBASE-F32-Parse-PublicApi-0013command3AddDir sl@0: COMMAND TParse1 FullName PBASE-F32-Parse-PublicApi-0013command4FullName sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0059 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0060 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0060 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc AddDir() negative test. This tests for the function to return error KErrBadName in case the directory to add begins with slash "\". sl@0: //! ses API elements: AddDir() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call Set() setting path to "c:\dir1\dir2\filename.ext" sl@0: //! 3. Call AddDir() passing "\dir3" string. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults AddDir() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0014command2Set sl@0: COMMAND !Error=-28 TParse1 AddDir PBASE-F32-Parse-PublicApi-0014command3AddDir sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0060 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0061 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0061 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc AddDir() test, where name of directory contains the wildcard. sl@0: //! Uses API elements: AddDir() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call Set() setting path to "c:\dir1\dir2\filename.ext" sl@0: //! 3. Call AddDir() passing a "dir*" string. sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults AddDir() returns KErrNone. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0015command2Set sl@0: COMMAND TParse1 AddDir PBASE-F32-Parse-PublicApi-0015command3AddDir sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0061 sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-Parse-PublicApi-0062 sl@0: //! @SYMTestCaseID PBASE-F32-Parse-PublicApi-0062 sl@0: //! @SYMAPI TParse sl@0: //! @SYMTestCaseDesc AddDir() negative test, where name of directory ended with a "\". sl@0: //! Uses API elements: AddDir() sl@0: //! @SYMTestActions 1. Create TParse object. sl@0: //! 2. Call Set() setting path to "c:\dir1\dir2\filename.ext" sl@0: //! 3. Call AddDir() passing name of directory ended with a "dir\". sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults AddDir() returns KErrBadName. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-Parse-PublicApi.ini sl@0: CREATE_OBJECT TParse TParse1 sl@0: COMMAND TParse1 new sl@0: COMMAND TParse1 Set PBASE-F32-Parse-PublicApi-0016command2Set sl@0: COMMAND !Error=-28 TParse1 AddDir PBASE-F32-Parse-PublicApi-0016command3AddDir sl@0: COMMAND TParse1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-Parse-PublicApi-0062