libStatGen Software  1
InputFileTest.h
1 /*
2  * Copyright (C) 2010 Regents of the University of Michigan
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #include <string>
18 #include "InputFile.h"
19 
20 
21 class IFILE_Test : public InputFile
22 {
23 public:
24  void test();
25 
26  static const int TEST_FILE_SIZE;
27  static const int BGZF_TEST_FILE_SIZE;
28  static const std::string TEST_FILE_CONTENTS;
29 
30 private:
31  void testAll(const char* extension);
32  void test_readFromFile(const char* extension);
33  void test_readTilChar(const char* extension);
34 
35  // Tested together because they are used to test each other.
36  void test_ifeof_ifrewind(const char* extension);
37 
38  // Tested together to verify they can be successfully be called after the
39  // other has been called.
40  void test_ifread_ifgetc(const char* extension);
41 
42  void test_ifclose(const char* extension);
43 
44  void test_ifseek(const char* extension);
45 
46  void test_noExistRead(const char *extension);
47 
48  void openFile(const char* extension);
49  void openLargeFile(const char* extension);
50  void openNoExistFile(const char* extension);
51 
52  // Buffer used for reading into.
53  static const int MAX_TEST_BUFFER_SIZE = 100;
54  char myTestBuffer[MAX_TEST_BUFFER_SIZE];
55 
56 };
IFILE_Test
Definition: InputFileTest.h:21
InputFile.h
InputFile
Class for easily reading/writing files without having to worry about file type (uncompressed,...
Definition: InputFile.h:36