InputFileTest.h

00001 /*
00002  *  Copyright (C) 2010  Regents of the University of Michigan
00003  *
00004  *   This program is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 #include <string>
00018 #include "InputFile.h"
00019 
00020 
00021 // This test class is only for when zlib is available.
00022 #ifdef __ZLIB_AVAILABLE__
00023 
00024 class IFILE_Test : public InputFile
00025 {
00026 public:
00027     void test();
00028 
00029     static const int TEST_FILE_SIZE;
00030     static const int BGZF_TEST_FILE_SIZE;
00031     static const std::string TEST_FILE_CONTENTS;
00032 
00033 private:
00034     void test_readFromFile(const char* extension);
00035 
00036     // Tested together because they are used to test each other.
00037     void test_ifeof_ifrewind(const char* extension);
00038 
00039     // Tested together to verify they can be successfully be called after the
00040     // other has been called.
00041     void test_ifread_ifgetc(const char* extension);
00042 
00043     void test_ifclose(const char* extension);
00044 
00045     void test_ifseek(const char* extension);
00046 
00047     void test_noExistRead(const char *extension);
00048 
00049     void openFile(const char* extension);
00050     void openLargeFile(const char* extension);
00051     void openNoExistFile(const char* extension);
00052 
00053     // Buffer used for reading into.
00054     static const int MAX_TEST_BUFFER_SIZE = 100;
00055     char myTestBuffer[MAX_TEST_BUFFER_SIZE];
00056 
00057 };
00058 
00059 #endif
Generated on Wed Nov 17 15:38:29 2010 for StatGen Software by  doxygen 1.6.3