This source file includes following definitions.
- setup
- teardown
- START_PARAMETRIZED_TEST
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 #define TEST_SUITE_NAME "/src/filemanager"
27
28 #include "tests/mctest.h"
29
30 #include "src/vfs/local/local.c"
31
32 #include "src/filemanager/filegui.c"
33
34
35
36
37
38 static void
39 setup (void)
40 {
41 str_init_strings (NULL);
42
43 vfs_init ();
44 vfs_init_localfs ();
45 vfs_setup_work_dir ();
46 }
47
48
49
50
51 static void
52 teardown (void)
53 {
54 vfs_shut ();
55 str_uninit_strings ();
56 }
57
58
59
60
61
62 static const struct test_is_wildcarded_ds
63 {
64 const char *input_value;
65 gboolean expected_result;
66 } test_is_wildcarded_ds[] =
67 {
68 {
69 "blabla",
70 FALSE
71 },
72 {
73 "bla?bla",
74 TRUE
75 },
76 {
77 "bla*bla",
78 TRUE
79 },
80 {
81 "bla\\*bla",
82 FALSE
83 },
84
85 {
86 "bla\\\\*bla",
87 TRUE
88 },
89 {
90 "bla\\1bla",
91 TRUE
92 },
93 {
94 "bla\\\\1bla",
95 FALSE
96 },
97 {
98 "bla\\\t\\\\1bla",
99 FALSE
100 },
101 {
102 "bla\\\t\\\\\\1bla",
103 TRUE
104 },
105 {
106 "bla\\9bla",
107 TRUE
108 },
109 {
110 "blabla\\",
111 FALSE
112 },
113 {
114 "blab\\?la",
115 FALSE
116 },
117 {
118 "blab\\\\?la",
119 TRUE
120 },
121 };
122
123
124
125
126 START_PARAMETRIZED_TEST (test_is_wildcarded, test_is_wildcarded_ds)
127
128 {
129
130 gboolean actual_result;
131
132
133 actual_result = is_wildcarded (data->input_value);
134
135 ck_assert_int_eq (actual_result, data->expected_result);
136 }
137
138 END_PARAMETRIZED_TEST
139
140
141
142
143 int
144 main (void)
145 {
146 TCase *tc_core;
147
148 tc_core = tcase_create ("Core");
149
150 tcase_add_checked_fixture (tc_core, setup, teardown);
151
152
153 mctest_add_parameterized_test (tc_core, test_is_wildcarded, test_is_wildcarded_ds);
154
155
156 return mctest_run_all (tc_core);
157 }
158
159