filemanager/tsrc/unit/ut_fminternalfmutils/src/ut_fminternalfmutils.h
changeset 46 d58987eac7e8
equal deleted inserted replaced
37:15bc28c9dd51 46:d58987eac7e8
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *       test application for File manager internal apis.
       
    16 */
       
    17 
       
    18 #ifndef UT_FMINTERNALFMUTILS_H_
       
    19 #define UT_FMINTERNALFMUTILS_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include <QStringList>
       
    23 #include <hbtranslator.h>
       
    24 #include <QTranslator>
       
    25 class TestFmInternalFmUtils :public QObject
       
    26 {
       
    27     Q_OBJECT
       
    28 private slots:    
       
    29     void initTestCase();    
       
    30     
       
    31     void testGetDriveNameFromPath(); //test the getDriveNameFromPath() and fillPathWithSplash() functions.
       
    32     
       
    33     void testGetDriveLetterFromPath(); // test the getDriveLetterFromPath() function.
       
    34     
       
    35     void testFormatStorageSize(); // test the formatStorageSize() function.
       
    36     
       
    37     void testIsDriveYes(); // test isDrive() function with normal drive path
       
    38     void testIsDriveNo(); // test isDrive() function with an unnormal drive path
       
    39     
       
    40     void testFormatPathWithEmptyPath(); // test formatPath() with empty path
       
    41     void testFormatPath(); // test formatPath() using path with "/" or "\"
       
    42     
       
    43     void testFillPathWithSplashUseEmptyPath(); // fillPathWithSplash()
       
    44     void testFillPathWithSplashHasSplash(); // fillPathWithSplash()
       
    45     void testFillPathWithSplashWithoutSplash(); // fillPathWithSplash()
       
    46     
       
    47     void testRemovePathSplashUseEmptyPath(); // removePathSplash()
       
    48     void testRemovePathSplashHasSplash(); // removePathSplash()
       
    49     void testRemovePathSplashWithoutSplash(); // removePathSplash()
       
    50     
       
    51     void testGetDriveListAll();//getDriveList()
       
    52     void testGetDriveListPart();//getDriveList()
       
    53     
       
    54     void testFillDriveVolumeEmptyName(); // fillDriveVolume()
       
    55     void testFillDriveVolumeDefaultVolume(); // fillDriveVolume()
       
    56     void testFillDriveVolume(); // fillDriveVolume()
       
    57     
       
    58     void testGetDefaultVolumeName(); // test getDefaultVolumeName() funtion
       
    59     
       
    60     void testGetVolumeNameWithDefaultNameIfNull();
       
    61     
       
    62     void testisPathEqualWithSamePath(); // test isPathEqual() with same path parameter
       
    63     void testisPathEqualWithDiffPath(); // test isPathEqual() with different path parameter
       
    64     
       
    65     void testcheckFolderFileNameNormal(); // test checkFolderFileName() with valid name
       
    66     void testcheckFolderFileNameUnNormal(); //test checkFolderFileName() with invalid name
       
    67     
       
    68     void testCheckNewFolderOrFileUnNormal(); // test checkNewFolderOrFile() function
       
    69     void testCheckNewFolderOrFileIlegel();
       
    70     void testCheckNewFolderOrFileNo();
       
    71     
       
    72     void testIsSubLevelPathYes(); // test isSubLevelPath() function
       
    73     void testIsSubLevelPathNo();
       
    74     
       
    75     void testRemoveDrivePwdNormal(); // test the removeDrivePwd() function
       
    76     void testRemoveDrivePwdUnNormal(); 
       
    77     
       
    78     void testSetDrivePwdNormal(); // test the setDrivePwd() function.
       
    79     void testSetDrivePwdUnNormal(); 
       
    80     
       
    81     void testCheckDrivePwd(); // test the checkDrivePwd() function.
       
    82     void testEmptyPwd(); 
       
    83     
       
    84     void testRenameDriveWithBadName(); // test renameDrive() function with bad names.
       
    85     void testRenameDriveWithNormalName(); // test renameDrive() function with normal names.
       
    86     
       
    87     void testCheckDriveAccessFilter(); // test the checkDriveAccessFilter() function.
       
    88     
       
    89     void testCheckDriveToFolderFilterC(); // test the checkDriveToFolderFilter() function.
       
    90     void testCheckDriveToFolderFilterNormal();
       
    91     
       
    92     void testCheckFolderToDriveFilterC(); // test CheckFolderToDriveFilter() function.
       
    93     void testCheckFolderToDriveFilterNormal();
       
    94     
       
    95     void testIsPathAccessableEmpty();
       
    96     void testIsPathAccessableOK();
       
    97     void testIsPathAccessableNo();
       
    98     
       
    99     void testIsDriveAvailable(); // test the isDriveAvailable() function.
       
   100     
       
   101     void testIsDefaultFolder(); // test the isDefaultFolder() function.
       
   102     
       
   103     void testCreateDefaultFolders(); // test the createDefaultFolders() function.
       
   104     
       
   105     void testSetFileAttributes(); // test teh setFileAttributes() function.
       
   106     
       
   107     void testHasEnoughSpaceYes(); // test the hasEnoughSpace() function.
       
   108     void testHasEnoughSpaceNo();
       
   109     
       
   110     void testMoveInsideDrive(); // test the moveInsideDrive() function.
       
   111     
       
   112     void testLaunchFile(); // test the launchFile() funtion.
       
   113     
       
   114     void testSendFiles();
       
   115     
       
   116     void testGetBurConfigPath();
       
   117     
       
   118     void testGetFileTypeWithSupportType(); // test the GetFileType() function using file manager supported types. 
       
   119     void testGetFileTypeWithUnSupportType();
       
   120     
       
   121     void testIsDriveCYes();
       
   122     void testIsDriveCNo();
       
   123     
       
   124     void testGetMaxFileNameLength();
       
   125     
       
   126     void testCheckMaxPathLength();
       
   127     
       
   128     void cleanupTestCase();    
       
   129 private:
       
   130     QString mFilePath;
       
   131     QStringList mDrives; // all drives
       
   132     QStringList mDrives1;// drives which type is USB or MemCard
       
   133     QStringList mDrives2;// drives except USB and MemCard
       
   134     
       
   135     QTranslator mTranslator;
       
   136 };
       
   137 #endif /* UT_FMINTERNALFMUTILS_H_ */