Debian Codegraph @

check/internal-tests/symbols_t.c

raw
1 /*
2 * FCML - Free Code Manipulation Library.
3 * Copyright (C) 2010-2020 Slawomir Wojtasiak
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include <stdlib.h>
21
22 #include "symbols_t.h"
23
24 #include <fcml_symbols.h>
25
26 fcml_bool fcml_tf_symbols_suite_init(void) {
27 return FCML_TRUE;
28 }
29
30 fcml_bool fcml_tf_symbols_suite_cleanup(void) {
31 return FCML_TRUE;
32 }
33
34 void fcml_tf_symbols_alloc() {
35 fcml_st_symbol_table table = fcml_fn_symbol_table_alloc();
36 STF_ASSERT_PTR_NOT_NULL( table );
37 if( table ) {
38 fcml_st_symbol *symbol = fcml_fn_symbol_alloc( "MAX_PATH", 256 );
39 STF_ASSERT_PTR_NOT_NULL( symbol );
40 if( symbol ) {
41 STF_ASSERT_EQUAL( fcml_fn_symbol_add( table, symbol ), FCML_CEH_GEC_NO_ERROR );
42 }
43 fcml_fn_symbol_table_free( table );
44 }
45 }
46
47 fcml_stf_test_case fctl_ti_symbols[] = {
48 { "fcml_tf_symbols_alloc", fcml_tf_symbols_alloc },
49 FCML_STF_NULL_TEST
50 };
51
52 fcml_stf_test_suite fctl_si_symbols = {
53 "suite-symbols", fcml_tf_symbols_suite_init, fcml_tf_symbols_suite_cleanup, fctl_ti_symbols
54 };
55
56