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-rem sl@0: //! @SYMScriptTestEnvironment This test script requires a basic ROM. sl@0: //! @SYMScriptAuthor Dmitri Trofimov sl@0: //! @SYMScriptDescription The test script contains API tests for the following functions of TFindFile class: sl@0: //! @SYMCreationDate 17/12/2006 sl@0: //! TFindFile(RFs &aFs); sl@0: //! TInt FindByDir(const TDesC &aFileName, const TDesC &aDirPath); sl@0: //! TInt FindWildByDir(const TDesC &aFileName, const TDesC &aDirPath, CDir *&aDir); sl@0: //! TInt Find(); sl@0: //! TInt FindWild(CDir *&aDirList); sl@0: //! const TDesC &File() const; sl@0: //! TInt SetFindMask(TUint aMask); sl@0: sl@0: LOAD_SUITE T_SfSrv sl@0: DELAY 5000 sl@0: sl@0: sl@0: START_TESTCASE SETUP_FILES sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini sl@0: CREATE_OBJECT RFs RFs1 sl@0: CREATE_OBJECT CFileMan CFileMan1 sl@0: COMMAND RFs1 new sl@0: COMMAND RFs1 Connect sl@0: COMMAND RFs1 MkDirAll test_dir sl@0: COMMAND RFs1 MkDirAll test_dir1 sl@0: COMMAND RFs1 MkDirAll test_rem_dir sl@0: COMMAND RFs1 MkDirAll test_rem_dir1 sl@0: COMMAND CFileMan1 NewL fileman_fs sl@0: COMMAND CFileMan1 Copy test_file1 sl@0: COMMAND CFileMan1 Close sl@0: COMMAND CFileMan1 Copy test_rem_file1 sl@0: COMMAND CFileMan1 Close sl@0: COMMAND CFileMan1 ~ sl@0: COMMAND RFs1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE SETUP_FILES sl@0: sl@0: sl@0: START_TESTCASE PBASE-F32-FindFile-PublicApi-0019 sl@0: //! @SYMTestCaseID PBASE-F32-FindFile-PublicApi-0019 sl@0: //! @SYMAPI TFindFile sl@0: //! @SYMTestCaseDesc Find() test. This tests for successful finding of file after FindByDir() call. sl@0: //! Uses API elements: FindByDir(), Find(), File() sl@0: //! @SYMTestActions 1. Create RFs object. sl@0: //! 2. Create RDir object. sl@0: //! 3. Create TFindFile object passing a reference to the connected file session as a parameter. sl@0: //! 4. Call FindByDir() passing file name "Test1.txt" and path "\base\t_sfsrv\t_findfile\test1\" as arguments. sl@0: //! 5. Call File() with checking that value is '\base\t_sfsrv\t_findfile\test1\Test1.txt' sl@0: //! 60.Call Find(). sl@0: //! 71.Call File() with checking that value is 'x:\base\t_sfsrv\t_findfile\test1\Test1.txt' sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults Find() returns KErrNone. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini sl@0: CREATE_OBJECT RFs RFs1 sl@0: CREATE_OBJECT RDir RDir1 sl@0: CREATE_OBJECT TFindFile TFindFile1 sl@0: COMMAND RFs1 new sl@0: COMMAND RDir1 new sl@0: COMMAND RFs1 Connect sl@0: COMMAND TFindFile1 new PBASE-F32-FindFile-PublicApi-0019-command4new sl@0: COMMAND TFindFile1 FindByDir PBASE-F32-FindFile-PublicApi-0019-command5FindByDir sl@0: COMMAND TFindFile1 File correct_file_path sl@0: COMMAND TFindFile1 Find sl@0: COMMAND TFindFile1 File rem_correct_file_path sl@0: COMMAND TFindFile1 ~ sl@0: COMMAND RDir1 ~ sl@0: COMMAND RFs1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-FindFile-PublicApi-0019 sl@0: sl@0: START_TESTCASE PBASE-F32-FindFile-PublicApi-0023 sl@0: //! @SYMTestCaseID PBASE-F32-FindFile-PublicApi-0023 sl@0: //! @SYMAPI TFindFile sl@0: //! @SYMTestCaseDesc FindWild() test. This test for successful finding of file ather FindWildByDir() call. sl@0: //! Uses API elements: FindWildByDir(), FindWild() sl@0: //! @SYMTestActions 1. Create RFs object. sl@0: //! 2. Call Connect(). sl@0: //! 3. Create TFindFile object passing a reference to the connected file session as a parameter. sl@0: //! 4. Call FindWildByDir() passing file name "Test1.*" and path "\base\t_sfsrv\t_findfile\test1\" as arguments. sl@0: //! 5. Call FindWild(). sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults FindWild() returns KErrNone. FindWild find file on another RAM drive. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini sl@0: CREATE_OBJECT RFs RFs1 sl@0: CREATE_OBJECT TFindFile TFindFile1 sl@0: CREATE_OBJECT TEntry TEntry1 sl@0: CREATE_OBJECT CDir CDir1 sl@0: COMMAND RFs1 new sl@0: COMMAND RFs1 Connect sl@0: COMMAND TFindFile1 new PBASE-F32-FindFile-PublicApi-0023-command4new sl@0: COMMAND TFindFile1 FindWildByDir PBASE-F32-FindFile-PublicApi-0023-command5FindWildByDir sl@0: COMMAND TFindFile1 FindWild common_dir_wrapper sl@0: COMMAND TFindFile1 ~ sl@0: COMMAND RFs1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-FindFile-PublicApi-0023 sl@0: sl@0: START_TESTCASE PBASE-F32-FindFile-PublicApi-0026 sl@0: //! @SYMTestCaseID PBASE-F32-FindFile-PublicApi-0026 sl@0: //! @SYMAPI TFindFile sl@0: //! @SYMTestCaseDesc FindByDir() test. This tests for function to return correct data. sl@0: //! Uses API elements: FindByDir(), SetFindMask(), File() sl@0: //! @SYMTestActions 1. Create RFs object. sl@0: //! 2. Call Connect(). sl@0: //! 3. Call SetFindMask() with invalid parameter . sl@0: //! 4. Call SetFindMask() KDriveAttRemovable as passed parameter. sl@0: //! 5. Create TFindFile object passing a reference to the connected file session as a parameter. sl@0: //! 6. Call FindByDir() passing file name "Test1.txt" and path "\base\t_sfsrv\t_findfile\test1\" as arguments. sl@0: //! 7. Call Find() to switch path to removable drive sl@0: //! 8. Call File() with checking that value is 'X:\base\t_sfsrv\t_findfile\test1\Test1.txt' sl@0: //! sl@0: //! @SYMTestStatus Implemented sl@0: //! @SYMTestPriority Critical sl@0: //! @SYMTestExpectedResults SetFindMask() with invalid parameter returns KErrArgument. and File returns a path on removable drive. sl@0: //! @SYMTestType CIT sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini sl@0: CREATE_OBJECT RFs RFs1 sl@0: CREATE_OBJECT TFindFile TFindFile1 sl@0: CREATE_OBJECT TEntry TEntry1 sl@0: CREATE_OBJECT CDir CDir1 sl@0: COMMAND RFs1 new sl@0: COMMAND RFs1 Connect sl@0: COMMAND TFindFile1 new PBASE-F32-FindFile-PublicApi-0026-command4new sl@0: COMMAND !Error=-6 TFindFile1 SetFindMask PBASE-F32-FindFile-PublicApi-0026__mask_params sl@0: COMMAND TFindFile1 SetFindMask find_mask_params sl@0: COMMAND TFindFile1 FindByDir PBASE-F32-FindFile-PublicApi-0026-command5FindByDir sl@0: COMMAND TFindFile1 Find sl@0: COMMAND TFindFile1 ~ sl@0: COMMAND RFs1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE PBASE-F32-FindFile-PublicApi-0026 sl@0: sl@0: sl@0: START_TESTCASE REMOVE_FILES sl@0: START_TEST_BLOCK 100 T_SfSrv \base\PBASE-F32-FindFile-PublicApi.ini sl@0: CREATE_OBJECT RFs RFs1 sl@0: CREATE_OBJECT CFileMan CFileMan1 sl@0: COMMAND RFs1 new sl@0: COMMAND RFs1 Connect sl@0: COMMAND CFileMan1 NewL fileman_fs sl@0: COMMAND CFileMan1 Delete all_files1 sl@0: COMMAND CFileMan1 Delete all_rem_files1 sl@0: COMMAND RFs1 RmDir test_dir1 sl@0: COMMAND RFs1 RmDir test_dir sl@0: COMMAND RFs1 RmDir test_rem_dir1 sl@0: COMMAND RFs1 RmDir test_rem_dir sl@0: COMMAND CFileMan1 ~ sl@0: COMMAND RFs1 ~ sl@0: END_TEST_BLOCK sl@0: END_TESTCASE REMOVE_FILES