Debian Codegraph @

check/internal-tests/common_utils_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 "common_utils_t.h"
21
22 #include <fcml_common_utils.h>
23
24 fcml_bool fcml_tf_common_utils_suite_init(void) {
25 return FCML_TRUE;
26 }
27
28 fcml_bool fcml_tf_common_utils_suite_cleanup(void) {
29 return FCML_TRUE;
30 }
31
32 void fcml_tf_common_utils_instruction_cloning(void) {
33
34 fcml_st_instruction instruction = {0};
35 instruction.mnemonic = "adc";
36
37 fcml_st_instruction *cloned = (fcml_st_instruction*)fcml_fn_cu_clone_instruction( &instruction );
38 STF_ASSERT_PTR_NOT_NULL( cloned );
39 STF_ASSERT_STRING_EQUAL( "adc", cloned->mnemonic );
40
41 fcml_fn_cu_free_instruction( cloned );
42 }
43
44 fcml_stf_test_case fcml_ti_common_utils[] = {
45 { "fcml_tf_common_utils_instruction_cloning", fcml_tf_common_utils_instruction_cloning },
46 FCML_STF_NULL_TEST
47 };
48
49 fcml_stf_test_suite fcml_si_common_utils = {
50 "suite-fcml-common-utils", fcml_tf_common_utils_suite_init, fcml_tf_common_utils_suite_cleanup, fcml_ti_common_utils
51 };
52