]> git.draconx.ca Git - cdecl99.git/blob - test/test.h
c1be21a445fb4164025411e76c1ba3366af529d2
[cdecl99.git] / test / test.h
1 /*
2  * Copyright © 2012, 2020 Nick Bowler
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 <https://www.gnu.org/licenses/>.
16  */
17
18 #ifndef CDECL_TEST_H_
19 #define CDECL_TEST_H_
20
21 #include <stddef.h>
22 #include <stdbool.h>
23 #include <limits.h>
24 #include <assert.h>
25
26 #ifndef _
27 #  define _(x) (x)
28 #endif
29
30 struct cdecl_declspec;
31 struct option;
32 struct cdecl;
33
34 void *malloc_nofail(size_t size);
35 void *realloc_nofail(void *ptr, size_t size);
36 void test_print_specifiers(struct cdecl_declspec *spec);
37 void test_print_decl(struct cdecl *decl);
38 void test_explain_decl(struct cdecl *decl);
39
40 bool strict_strtoul(unsigned long *val, const char *str, int base);
41
42 void test_print_version(const char *program);
43 void test_print_options(const struct option *lopts);
44
45 #endif