TestFileSystemManager.h

Go to the documentation of this file.
00001 
00002 //
00003 // This source file is a part of ParCompMark
00004 // Parallel Compositing Benchmark Framework
00005 //
00006 // for latest info see http://parcompmark.sourceforge.net
00007 
00008 //
00009 // Copyright (C) 2006 IT2 ParCompMark Dev. Team
00010 // 
00011 // This program is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License
00013 // as published by the Free Software Foundation; either version 2
00014 // of the License, or (at your option) any later version.
00015 // 
00016 // This program is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 // GNU General Public License for more details.
00020 // 
00021 // You should have received a copy of the GNU General Public License
00022 // along with this program; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00024 
00027 
00028 #ifndef __TEST_FILESYSTEMMANAGER_H__
00029 #  define __TEST_FILESYSTEMMANAGER_H__
00030 
00031 //
00032 // CppUnit include
00033 //
00034 #  include <cppunit/extensions/HelperMacros.h>
00035 
00036 //
00037 // Tested class include
00038 //
00039 #  define PARCOMPMARK_TEST
00040 #  include "../../include/PCMFileSystemManager.h"
00041 #  undef PARCOMPMARK_TEST
00042 
00043 //
00044 // Opening namespace of the tested project
00045 //
00046 using namespace ParCompMark;
00047 
00048 namespace ParCompMarkTest
00049 {
00050 
00056   class TestFileSystemManager:public CppUnit::TestFixture
00057   {
00058 
00059         // First, we declare the suite, passing the class name to the macro:
00061         CPPUNIT_TEST_SUITE(TestFileSystemManager);
00062 
00063         // Then, we declare each test case of the fixture:
00065         CPPUNIT_TEST(test_constructor_cstd__string_cstd__string);
00066         CPPUNIT_TEST(test_destructor);
00067         CPPUNIT_TEST(test_initialize);
00068         CPPUNIT_TEST(test_finalize);
00069         CPPUNIT_TEST(test_getInstance);
00070         CPPUNIT_TEST(test_existsDirectory_cstd__string);
00071         CPPUNIT_TEST(test_createDirectory_cstd__string);
00072         CPPUNIT_TEST(test_findDataDirectory);
00073         CPPUNIT_TEST(test_existsLibrary_cstd__string_cstd__vector___std__string__);
00074         CPPUNIT_TEST(test_findLibraryPath_cstd__string_cstd__vector___std__string__);
00075         CPPUNIT_TEST(test_listDirectory_cstd__string);
00076         CPPUNIT_TEST(test_listDataDirectory_cstd__string);
00077         CPPUNIT_TEST(test_existsFile_cstd__string);
00078         CPPUNIT_TEST(test_existsAppFile_cstd__string);
00079         CPPUNIT_TEST(test_existsDataFile_cchar_p);
00080         CPPUNIT_TEST(test_openFileC_cstd__string_cFileOperation);
00081         CPPUNIT_TEST(test_openAppFileC_cstd__string_cFileOperation);
00082         CPPUNIT_TEST(test_openDataFileC_cstd__string_cFileOperation);
00083         CPPUNIT_TEST(test_openFileCpp_cstd__string_cFileOperation);
00084         CPPUNIT_TEST(test_openAppFileCpp_cstd__string_cFileOperation);
00085         CPPUNIT_TEST(test_openDataFileCpp_cstd__string_cFileOperation);
00086         CPPUNIT_TEST(test_getPathDataFile_cstd__string);
00087         CPPUNIT_TEST(test_readTextFile_cstd__string);
00088         CPPUNIT_TEST(test_readAppTextFile_cstd__string);
00089         CPPUNIT_TEST(test_readDataTextFile_cstd__string);
00090         CPPUNIT_TEST(test_closeFile_FileSystemManager__CppFilePointer);
00091         CPPUNIT_TEST(test_closeFile_FileSystemManager__CFilePointer);
00092         CPPUNIT_TEST(test__findHomeDirectory);
00093         CPPUNIT_TEST(test__replaceHomeChar_cstd__string);
00094         CPPUNIT_TEST(test__translateToAbsolutePath_cstd__string);
00095         CPPUNIT_TEST(test__createAppDirectory);
00096 
00097         // Finally, we end the suite declaration:
00099         CPPUNIT_TEST_SUITE_END();
00100 
00101    public:
00102 
00104         void setUp();
00105 
00107         void tearDown();
00108 
00109    protected:
00110 
00111         //
00112         // Constructor & destructor tests
00113         //
00114 
00118         void test_constructor_cstd__string_cstd__string();
00119 
00123         void test_destructor();
00124 
00125         //
00126         // Class method tests
00127         //
00128 
00132         void test_getInstance();
00133 
00137         void test_closeFile_FileSystemManager__CppFilePointer();
00138 
00142         void test_closeFile_FileSystemManager__CFilePointer();
00143 
00144         //
00145         // Method tests
00146         //
00147 
00151         void test_initialize();
00152 
00156         void test_finalize();
00157 
00161         void test_existsDirectory_cstd__string();
00162 
00166         void test_createDirectory_cstd__string();
00167 
00171         void test_findDataDirectory();
00172 
00176         void test_existsLibrary_cstd__string_cstd__vector___std__string__();
00177 
00181         void test_findLibraryPath_cstd__string_cstd__vector___std__string__();
00182 
00186         void test_listDirectory_cstd__string();
00187 
00191         void test_listDataDirectory_cstd__string();
00192 
00196         void test_existsFile_cstd__string();
00197 
00201         void test_existsAppFile_cstd__string();
00202 
00206         void test_existsDataFile_cchar_p();
00207 
00211         void test_openFileC_cstd__string_cFileOperation();
00212 
00216         void test_openAppFileC_cstd__string_cFileOperation();
00217 
00221         void test_openDataFileC_cstd__string_cFileOperation();
00222 
00226         void test_openFileCpp_cstd__string_cFileOperation();
00227 
00231         void test_openAppFileCpp_cstd__string_cFileOperation();
00232 
00236         void test_openDataFileCpp_cstd__string_cFileOperation();
00237 
00241         void test_getPathDataFile_cstd__string();
00242 
00246         void test_readTextFile_cstd__string();
00247 
00251         void test_readAppTextFile_cstd__string();
00252 
00256         void test_readDataTextFile_cstd__string();
00257 
00261         void test__findHomeDirectory();
00262 
00266         void test__replaceHomeChar_cstd__string();
00267 
00271         void test__translateToAbsolutePath_cstd__string();
00272 
00276         void test__createAppDirectory();
00277 
00278   };
00279 
00280 }
00281 
00282 #endif