2 src/filemanager - tests for is_wildcarded() function
4 Copyright (C) 2011-2024
5 Free Software Foundation, Inc.
8 Slava Zanko <slavazanko@gmail.com>, 2015
10 This file is part of the Midnight Commander.
12 The Midnight Commander is free software: you can redistribute it
13 and/or modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation, either version 3 of the License,
15 or (at your option) any later version.
17 The Midnight Commander is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #define TEST_SUITE_NAME "/src/filemanager"
28 #include "tests/mctest.h"
30 #include "src/vfs/local/local.c"
32 #include "src/filemanager/filegui.c"
35 /* --------------------------------------------------------------------------------------------- */
41 str_init_strings (NULL
);
45 vfs_setup_work_dir ();
48 /* --------------------------------------------------------------------------------------------- */
55 str_uninit_strings ();
58 /* --------------------------------------------------------------------------------------------- */
60 /* @DataSource("test_is_wildcarded_ds") */
62 static const struct test_is_wildcarded_ds
64 const char *input_value
;
65 gboolean expected_result
;
66 } test_is_wildcarded_ds
[] =
124 /* @Test(dataSource = "test_is_wildcarded_ds") */
126 START_PARAMETRIZED_TEST (test_is_wildcarded
, test_is_wildcarded_ds
)
130 gboolean actual_result
;
133 actual_result
= is_wildcarded (data
->input_value
);
135 ck_assert_int_eq (actual_result
, data
->expected_result
);
138 END_PARAMETRIZED_TEST
141 /* --------------------------------------------------------------------------------------------- */
148 tc_core
= tcase_create ("Core");
150 tcase_add_checked_fixture (tc_core
, setup
, teardown
);
152 /* Add new tests here: *************** */
153 mctest_add_parameterized_test (tc_core
, test_is_wildcarded
, test_is_wildcarded_ds
);
154 /* *********************************** */
156 return mctest_run_all (tc_core
);
159 /* --------------------------------------------------------------------------------------------- */