1 /** 2 * @file 3 * Common code for file tests 4 * 5 * @authors 6 * Copyright (C) 2019 Richard Russon <rich@flatcap.org> 7 * 8 * @copyright 9 * This program is free software: you can redistribute it and/or modify it under 10 * the terms of the GNU General Public License as published by the Free Software 11 * Foundation, either version 2 of the License, or (at your option) any later 12 * version. 13 * 14 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * details. 18 * 19 * You should have received a copy of the GNU General Public License along with 20 * this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef TEST_FILE_COMMON_H 24 #define TEST_FILE_COMMON_H 25 26 #include "acutest.h" 27 #include <stdio.h> 28 #include "mutt/lib.h" 29 30 extern const char *file_lines[]; 31 32 FILE *file_set_up(const char *funcname); 33 void file_tear_down(FILE *fp, const char *funcname); 34 size_t file_num_test_lines(void); 35 36 #define SET_UP() (file_set_up(__func__)) 37 #define TEAR_DOWN(fp) (file_tear_down((fp), __func__)) 38 39 struct TestValue 40 { 41 char *first; 42 char *second; 43 int retval; 44 }; 45 46 #endif /* TEST_FILE_COMMON_H */ 47