summaryrefslogtreecommitdiff
path: root/src/tests/evil
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-04-18 14:48:12 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-04-18 14:48:17 -0400
commita3f4f615999455ba76b5f8aa3315faa1e2803c58 (patch)
treebbf32353cb48b07a5d33639f0c907df1d6e05b46 /src/tests/evil
parent6ee2df55aabec87d0a21e881c44c32999abb10f2 (diff)
Evil tests: remove tests of functions provided by mingw-w64
Summary: mingw-w64 developpers already tests basename and dirname Test Plan: compilation Reviewers: zmike, raster Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8649
Diffstat (limited to 'src/tests/evil')
-rw-r--r--src/tests/evil/evil_suite.c1
-rw-r--r--src/tests/evil/evil_suite.h1
-rw-r--r--src/tests/evil/evil_test_libgen.c308
3 files changed, 0 insertions, 310 deletions
diff --git a/src/tests/evil/evil_suite.c b/src/tests/evil/evil_suite.c
index e510ee4fc5..b29dbc702b 100644
--- a/src/tests/evil/evil_suite.c
+++ b/src/tests/evil/evil_suite.c
@@ -31,7 +31,6 @@ static const Efl_Test_Case etc[] = {
31 { "Dlfcn", evil_test_dlfcn }, 31 { "Dlfcn", evil_test_dlfcn },
32 /* { "Fcntl", evil_test_fcntl }, */ 32 /* { "Fcntl", evil_test_fcntl }, */
33 /* { "Langinfo", evil_test_langinfo }, */ 33 /* { "Langinfo", evil_test_langinfo }, */
34 { "Libgen", evil_test_libgen },
35 { "Main", evil_test_main }, 34 { "Main", evil_test_main },
36 /* { "Mman", evil_test_mman }, */ 35 /* { "Mman", evil_test_mman }, */
37 /* { "Pwd", evil_test_pwd }, */ 36 /* { "Pwd", evil_test_pwd }, */
diff --git a/src/tests/evil/evil_suite.h b/src/tests/evil/evil_suite.h
index 3c215e2484..a9599b6ee8 100644
--- a/src/tests/evil/evil_suite.h
+++ b/src/tests/evil/evil_suite.h
@@ -24,7 +24,6 @@
24void evil_test_dlfcn(TCase *tc); 24void evil_test_dlfcn(TCase *tc);
25/* void evil_test_fcntl(TCase *tc); */ 25/* void evil_test_fcntl(TCase *tc); */
26/* void evil_test_langinfo(TCase *tc); */ 26/* void evil_test_langinfo(TCase *tc); */
27void evil_test_libgen(TCase *tc);
28void evil_test_main(TCase *tc); 27void evil_test_main(TCase *tc);
29/* void evil_test_mman(TCase *tc); */ 28/* void evil_test_mman(TCase *tc); */
30/* void evil_test_pwd(TCase *tc); */ 29/* void evil_test_pwd(TCase *tc); */
diff --git a/src/tests/evil/evil_test_libgen.c b/src/tests/evil/evil_test_libgen.c
deleted file mode 100644
index 263e6de836..0000000000
--- a/src/tests/evil/evil_test_libgen.c
+++ /dev/null
@@ -1,308 +0,0 @@
1/* EVIL - EFL library for Windows port
2 * Copyright (C) 2017 Vincent Torri
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifdef HAVE_CONFIG_H
20# include "config.h"
21#endif
22
23#include <stdlib.h>
24#include <string.h>
25#include <libgen.h>
26
27#include "evil_suite.h"
28
29EFL_START_TEST(evil_libgen_null)
30{
31 char *dname;
32 char *bname;
33
34 dname = dirname(NULL);
35 fail_if(strcmp(dname, ".") != 0);
36 bname = basename(NULL);
37 fail_if(strcmp(bname, ".") != 0);
38}
39EFL_END_TEST
40
41EFL_START_TEST(evil_libgen_empty)
42{
43 const char *path = "";
44 char *dirc;
45 char *basec;
46 char *dname;
47 char *bname;
48
49 dirc = strdup(path);
50 fail_if(dirc == NULL);
51 basec = strdup(path);
52 fail_if(basec == NULL);
53
54 dname = dirname(dirc);
55 fail_if(strcmp(dname, ".") != 0);
56 bname = basename(basec);
57 fail_if(strcmp(bname, ".") != 0);
58
59 free(dirc);
60 free(basec);
61}
62EFL_END_TEST
63
64EFL_START_TEST(evil_libgen_path)
65{
66 const char *path = "/usr/lib";
67 char *dirc;
68 char *basec;
69 char *dname;
70 char *bname;
71
72 dirc = strdup(path);
73 fail_if(dirc == NULL);
74 basec = strdup(path);
75 fail_if(basec == NULL);
76
77 dname = dirname(dirc);
78 fail_if(strcmp(dname, "/usr") != 0);
79 bname = basename(basec);
80 fail_if(strcmp(bname, "lib") != 0);
81
82 free(dirc);
83 free(basec);
84}
85EFL_END_TEST
86
87EFL_START_TEST(evil_libgen_path_with_slash)
88{
89 const char *path = "/usr/";
90 char *dirc;
91 char *basec;
92 char *dname;
93 char *bname;
94
95 dirc = strdup(path);
96 fail_if(dirc == NULL);
97 basec = strdup(path);
98 fail_if(basec == NULL);
99
100 dname = dirname(dirc);
101 fail_if(strcmp(dname, "/") != 0);
102 bname = basename(basec);
103 fail_if(strcmp(bname, "usr") != 0);
104
105 free(dirc);
106 free(basec);
107}
108EFL_END_TEST
109
110EFL_START_TEST(evil_libgen_folder)
111{
112 const char *path = "usr";
113 char *dirc;
114 char *basec;
115 char *dname;
116 char *bname;
117
118 dirc = strdup(path);
119 fail_if(dirc == NULL);
120 basec = strdup(path);
121 fail_if(basec == NULL);
122
123 dname = dirname(dirc);
124 fail_if(strcmp(dname, ".") != 0);
125 bname = basename(basec);
126 fail_if(strcmp(bname, "usr") != 0);
127
128 free(dirc);
129 free(basec);
130}
131EFL_END_TEST
132
133EFL_START_TEST(evil_libgen_slash)
134{
135 const char *path = "/";
136 char *dirc;
137 char *basec;
138 char *dname;
139 char *bname;
140
141 dirc = strdup(path);
142 fail_if(dirc == NULL);
143 basec = strdup(path);
144 fail_if(basec == NULL);
145
146 dname = dirname(dirc);
147 fail_if(strcmp(dname, "/") != 0);
148 bname = basename(basec);
149 fail_if(strcmp(bname, "/") != 0);
150
151 free(dirc);
152 free(basec);
153}
154EFL_END_TEST
155
156EFL_START_TEST(evil_libgen_dot)
157{
158 const char *path = ".";
159 char *dirc;
160 char *basec;
161 char *dname;
162 char *bname;
163
164 dirc = strdup(path);
165 fail_if(dirc == NULL);
166 basec = strdup(path);
167 fail_if(basec == NULL);
168
169 dname = dirname(dirc);
170 fail_if(strcmp(dname, ".") != 0);
171 bname = basename(basec);
172 fail_if(strcmp(bname, ".") != 0);
173
174 free(dirc);
175 free(basec);
176}
177EFL_END_TEST
178
179EFL_START_TEST(evil_libgen_dot_dot)
180{
181 const char *path = "..";
182 char *dirc;
183 char *basec;
184 char *dname;
185 char *bname;
186
187 dirc = strdup(path);
188 fail_if(dirc == NULL);
189 basec = strdup(path);
190 fail_if(basec == NULL);
191
192 dname = dirname(dirc);
193 fail_if(strcmp(dname, ".") != 0);
194 bname = basename(basec);
195 fail_if(strcmp(bname, "..") != 0);
196
197 free(dirc);
198 free(basec);
199}
200EFL_END_TEST
201
202EFL_START_TEST(evil_libgen_win_dir_1)
203{
204 const char *path = "c:/foo/bar";
205 char *dirc;
206 char *basec;
207 char *dname;
208 char *bname;
209
210 dirc = strdup(path);
211 fail_if(dirc == NULL);
212 basec = strdup(path);
213 fail_if(basec == NULL);
214
215 dname = dirname(dirc);
216 fail_if(strcmp(dname, "c:/foo") != 0);
217 bname = basename(basec);
218fail_if(strcmp(bname, "bar") != 0);
219
220 free(dirc);
221 free(basec);
222}
223EFL_END_TEST
224
225EFL_START_TEST(evil_libgen_win_dir_2)
226{
227 const char *path = "c:/foo\\bar";
228 char *dirc;
229 char *basec;
230 char *dname;
231 char *bname;
232
233 dirc = strdup(path);
234 fail_if(dirc == NULL);
235 basec = strdup(path);
236 fail_if(basec == NULL);
237
238 dname = dirname(dirc);
239 fail_if(strcmp(dname, "c:/foo") != 0);
240 bname = basename(basec);
241 fail_if(strcmp(bname, "bar") != 0);
242
243 free(dirc);
244 free(basec);
245}
246EFL_END_TEST
247
248EFL_START_TEST(evil_libgen_win_dir_3)
249{
250 const char *path = "c:\\foo/bar";
251 char *dirc;
252 char *basec;
253 char *dname;
254 char *bname;
255
256 dirc = strdup(path);
257 fail_if(dirc == NULL);
258 basec = strdup(path);
259 fail_if(basec == NULL);
260
261 dname = dirname(dirc);
262 fail_if(strcmp(dname, "c:\\foo") != 0);
263 bname = basename(basec);
264 fail_if(strcmp(bname, "bar") != 0);
265
266 free(dirc);
267 free(basec);
268}
269EFL_END_TEST
270
271EFL_START_TEST(evil_libgen_win_dir_4)
272{
273 const char *path = "c:\\foo\\bar";
274 char *dirc;
275 char *basec;
276 char *dname;
277 char *bname;
278
279 dirc = strdup(path);
280 fail_if(dirc == NULL);
281 basec = strdup(path);
282 fail_if(basec == NULL);
283
284 dname = dirname(dirc);
285 fail_if(strcmp(dname, "c:\\foo") != 0);
286 bname = basename(basec);
287 fail_if(strcmp(bname, "bar") != 0);
288
289 free(dirc);
290 free(basec);
291}
292EFL_END_TEST
293
294void evil_test_libgen(TCase *tc)
295{
296 tcase_add_test(tc, evil_libgen_null);
297 tcase_add_test(tc, evil_libgen_empty);
298 tcase_add_test(tc, evil_libgen_path);
299 tcase_add_test(tc, evil_libgen_path_with_slash);
300 tcase_add_test(tc, evil_libgen_folder);
301 tcase_add_test(tc, evil_libgen_slash);
302 tcase_add_test(tc, evil_libgen_dot);
303 tcase_add_test(tc, evil_libgen_dot_dot);
304 tcase_add_test(tc, evil_libgen_win_dir_1);
305 tcase_add_test(tc, evil_libgen_win_dir_2);
306 tcase_add_test(tc, evil_libgen_win_dir_3);
307 tcase_add_test(tc, evil_libgen_win_dir_4);
308}