Merge lp:~jeremywootten/pantheon-files/enable-testing-ctest-part2 into lp:~elementary-apps/pantheon-files/trunk
- enable-testing-ctest-part2
- Merge into trunk
Proposed by
Jeremy Wootten
Status: | Merged |
---|---|
Approved by: | Cody Garver |
Approved revision: | 2444 |
Merged at revision: | 2482 |
Proposed branch: | lp:~jeremywootten/pantheon-files/enable-testing-ctest-part2 |
Merge into: | lp:~elementary-apps/pantheon-files/trunk |
Diff against target: |
1159 lines (+593/-440) 23 files modified
libcore/CMakeLists.txt (+2/-36) libcore/tests/CMakeLists.txt (+4/-0) libcore/tests/GOFDirectoryAsyncTests/CMakeLists.txt (+32/-0) libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.c (+100/-0) libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.h (+27/-0) libcore/tests/GOFDirectoryAsyncTests/tests.c (+33/-0) libcore/tests/GOFFileTests/CMakeLists.txt (+32/-0) libcore/tests/GOFFileTests/marlincore-tests-gof.c (+99/-0) libcore/tests/GOFFileTests/marlincore-tests-gof.h (+27/-0) libcore/tests/GOFFileTests/tests.c (+33/-0) libcore/tests/Makefile.am (+0/-20) libcore/tests/MarlinIconInfoTests/CMakeLists.txt (+32/-0) libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.c (+65/-0) libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.h (+28/-0) libcore/tests/MarlinIconInfoTests/tests.c (+34/-0) libcore/tests/UtilTests/CMakeLists.txt (+45/-0) libcore/tests/marlincore-tests-file.c (+0/-100) libcore/tests/marlincore-tests-file.h (+0/-27) libcore/tests/marlincore-tests-gof.c (+0/-99) libcore/tests/marlincore-tests-gof.h (+0/-27) libcore/tests/marlincore-tests-icon-info.c (+0/-65) libcore/tests/marlincore-tests-icon-info.h (+0/-28) libcore/tests/tests.c (+0/-38) |
To merge this branch: | bzr merge lp:~jeremywootten/pantheon-files/enable-testing-ctest-part2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Cody Garver (community) | Needs Information | ||
Review via email: mp+314455@code.launchpad.net |
Commit message
Restructure unit tests subdirectories
Description of the change
Reorganise /libcore/tests folder structure.
To post a comment you must log in.
- 2440. By Jeremy Wootten
-
Merge updates from parent and resolve conflicts
- 2441. By Jeremy Wootten
-
Merge changes from parent (add default icon theme method)
- 2442. By Jeremy Wootten
-
Merge trunk to r2470
- 2443. By Jeremy Wootten
-
Remove superfluous enable_testing() lines
Revision history for this message
Jeremy Wootten (jeremywootten) wrote : | # |
Cody: You are right - enable_testing () covers subdirectories so is only needed in the root directory, it seems.
Revision history for this message
Cody Garver (codygarver) wrote : | # |
Great. After resolving conflicts, this branch is ready to merge.
- 2444. By Jeremy Wootten
-
Merge trunk to r2481
Revision history for this message
Jeremy Wootten (jeremywootten) wrote : | # |
I didn't get any conflicts when I merged the trunk, but there was a warning of a criss-cross. I tried push --overwrite this time.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'libcore/CMakeLists.txt' | |||
2 | --- libcore/CMakeLists.txt 2017-02-01 14:51:38 +0000 | |||
3 | +++ libcore/CMakeLists.txt 2017-02-08 11:12:03 +0000 | |||
4 | @@ -1,5 +1,3 @@ | |||
5 | 1 | include (Tests) | ||
6 | 2 | |||
7 | 3 | set (PKGNAME pantheon-files-core) | 1 | set (PKGNAME pantheon-files-core) |
8 | 4 | set (PKGNAME_ PANTHEON_FILES_CORE) | 2 | set (PKGNAME_ PANTHEON_FILES_CORE) |
9 | 5 | set (${PKGNAME_}_VERSION 0.1) | 3 | set (${PKGNAME_}_VERSION 0.1) |
10 | @@ -147,37 +145,5 @@ | |||
11 | 147 | 145 | ||
12 | 148 | install (TARGETS ${PKGNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) | 146 | install (TARGETS ${PKGNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
13 | 149 | 147 | ||
48 | 150 | add_executable (pantheon-files-core_tests | 148 | add_subdirectory (tests) |
49 | 151 | tests/tests.c | 149 | |
16 | 152 | tests/marlincore-tests-gof.c | ||
17 | 153 | tests/marlincore-tests-file.c | ||
18 | 154 | tests/marlincore-tests-icon-info.c) | ||
19 | 155 | |||
20 | 156 | add_test (core pantheon-files-core_tests) | ||
21 | 157 | |||
22 | 158 | target_link_libraries (pantheon-files-core_tests pantheon-files-core ${DEPS_LIBRARIES}) | ||
23 | 159 | add_dependencies (pantheon-files-core_tests pantheon-files-core) | ||
24 | 160 | |||
25 | 161 | vala_precompile (VALA_TEST_C ${PKGNAME}-vala_tests | ||
26 | 162 | tests/Tests.vala | ||
27 | 163 | PACKAGES | ||
28 | 164 | granite | ||
29 | 165 | gtk+-3.0 | ||
30 | 166 | gio-2.0 | ||
31 | 167 | gee-0.8 | ||
32 | 168 | gmodule-2.0 | ||
33 | 169 | libcanberra | ||
34 | 170 | pantheon-files-core | ||
35 | 171 | OPTIONS | ||
36 | 172 | --thread | ||
37 | 173 | --target-glib=2.32 # Needed for new thread API | ||
38 | 174 | ) | ||
39 | 175 | |||
40 | 176 | add_executable (${PKGNAME}-vala_tests | ||
41 | 177 | ${VALA_TEST_C} | ||
42 | 178 | ) | ||
43 | 179 | |||
44 | 180 | target_link_libraries (${PKGNAME}-vala_tests pantheon-files-core ${DEPS_LIBRARIES}) | ||
45 | 181 | add_dependencies (${PKGNAME}-vala_tests pantheon-files-core) | ||
46 | 182 | |||
47 | 183 | add_test (core-vala-tests ${PKGNAME}-vala_tests) | ||
50 | 184 | 150 | ||
51 | === added file 'libcore/tests/CMakeLists.txt' | |||
52 | --- libcore/tests/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
53 | +++ libcore/tests/CMakeLists.txt 2017-02-08 11:12:03 +0000 | |||
54 | @@ -0,0 +1,4 @@ | |||
55 | 1 | add_subdirectory (UtilTests) | ||
56 | 2 | add_subdirectory (MarlinIconInfoTests) | ||
57 | 3 | add_subdirectory (GOFFileTests) | ||
58 | 4 | add_subdirectory (GOFDirectoryAsyncTests) | ||
59 | 0 | 5 | ||
60 | === added directory 'libcore/tests/GOFDirectoryAsyncTests' | |||
61 | === added file 'libcore/tests/GOFDirectoryAsyncTests/CMakeLists.txt' | |||
62 | --- libcore/tests/GOFDirectoryAsyncTests/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
63 | +++ libcore/tests/GOFDirectoryAsyncTests/CMakeLists.txt 2017-02-08 11:12:03 +0000 | |||
64 | @@ -0,0 +1,32 @@ | |||
65 | 1 | include_directories(${CMAKE_BINARY_DIR}) | ||
66 | 2 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
67 | 3 | |||
68 | 4 | set (CORE_LIB | ||
69 | 5 | pantheon-files-core | ||
70 | 6 | ) | ||
71 | 7 | |||
72 | 8 | set (CFLAGS | ||
73 | 9 | ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER} | ||
74 | 10 | ) | ||
75 | 11 | |||
76 | 12 | set (LIB_PATHS | ||
77 | 13 | ${DEPS_LIBRARY_DIRS} | ||
78 | 14 | ) | ||
79 | 15 | |||
80 | 16 | set (TEST_NAME | ||
81 | 17 | gof-directory-async_tests | ||
82 | 18 | ) | ||
83 | 19 | |||
84 | 20 | link_directories (${LIB_PATHS}) | ||
85 | 21 | add_definitions (${CFLAGS} -O2) | ||
86 | 22 | |||
87 | 23 | |||
88 | 24 | add_executable (${TEST_NAME} | ||
89 | 25 | tests.c | ||
90 | 26 | marlincore-tests-file.c | ||
91 | 27 | ) | ||
92 | 28 | |||
93 | 29 | target_link_libraries (${TEST_NAME} ${CORE_LIB} ${DEPS_LIBRARIES}) | ||
94 | 30 | add_dependencies (${TEST_NAME} ${CORE_LIB}) | ||
95 | 31 | |||
96 | 32 | add_test (core-${TEST_NAME} ${TEST_NAME}) | ||
97 | 0 | 33 | ||
98 | === added file 'libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.c' | |||
99 | --- libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.c 1970-01-01 00:00:00 +0000 | |||
100 | +++ libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.c 2017-02-08 11:12:03 +0000 | |||
101 | @@ -0,0 +1,100 @@ | |||
102 | 1 | /* | ||
103 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
104 | 3 | * | ||
105 | 4 | * Marlin is free software; you can redistribute it and/or | ||
106 | 5 | * modify it under the terms of the GNU General Public License as | ||
107 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
108 | 7 | * License, or (at your option) any later version. | ||
109 | 8 | * | ||
110 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
111 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
112 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
113 | 12 | * General Public License for more details. | ||
114 | 13 | * | ||
115 | 14 | * You should have received a copy of the GNU General Public License | ||
116 | 15 | * along with this program; if not, write to the Free Software | ||
117 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
118 | 17 | * | ||
119 | 18 | */ | ||
120 | 19 | |||
121 | 20 | #include <stdlib.h> | ||
122 | 21 | #include <gtk/gtk.h> | ||
123 | 22 | #include <glib.h> | ||
124 | 23 | #include <gio/gio.h> | ||
125 | 24 | #include "marlincore-tests-file.h" | ||
126 | 25 | #include "pantheon-files-core.h" | ||
127 | 26 | #include "gof-file.h" | ||
128 | 27 | |||
129 | 28 | GMainLoop* loop; | ||
130 | 29 | |||
131 | 30 | static gboolean fatal_handler(const gchar* log_domain, | ||
132 | 31 | GLogLevelFlags log_level, | ||
133 | 32 | const gchar* message, | ||
134 | 33 | gpointer user_data) | ||
135 | 34 | { | ||
136 | 35 | return FALSE; | ||
137 | 36 | } | ||
138 | 37 | |||
139 | 38 | static void second_load_done(GOFDirectoryAsync* dir, gpointer data) | ||
140 | 39 | { | ||
141 | 40 | g_message ("%s", G_STRFUNC); | ||
142 | 41 | g_assert_cmpint(dir->file->exists, ==, TRUE); | ||
143 | 42 | |||
144 | 43 | GOFDirectoryAsync *dir2 = gof_directory_async_from_file(dir->file); | ||
145 | 44 | g_assert_cmpint(dir->files_count, ==, dir2->files_count); | ||
146 | 45 | g_message ("files_count %u", dir->files_count); | ||
147 | 46 | g_object_unref (dir2); | ||
148 | 47 | |||
149 | 48 | /* some files testing inside a cached directory */ | ||
150 | 49 | GOFFile *f1 = gof_file_get_by_uri ("file:///tmp/marlin-test/a"); | ||
151 | 50 | g_object_unref (f1); | ||
152 | 51 | |||
153 | 52 | GOFFile *f2 = gof_file_get_by_uri ("file:///tmp/marlin-test/a"); | ||
154 | 53 | g_object_unref (f2); | ||
155 | 54 | |||
156 | 55 | /* use a marlin function would show a dialog, FIXME */ | ||
157 | 56 | system("rm -rf /tmp/marlin-test"); | ||
158 | 57 | /* free previously allocated dir */ | ||
159 | 58 | g_object_unref (dir); | ||
160 | 59 | |||
161 | 60 | g_main_loop_quit(loop); | ||
162 | 61 | |||
163 | 62 | } | ||
164 | 63 | |||
165 | 64 | static void first_load_done(GOFDirectoryAsync* dir, gpointer data) | ||
166 | 65 | { | ||
167 | 66 | g_message ("%s", G_STRFUNC); | ||
168 | 67 | g_assert_cmpint(dir->file->exists, ==, FALSE); | ||
169 | 68 | |||
170 | 69 | system("mkdir /tmp/marlin-test"); | ||
171 | 70 | system("touch /tmp/marlin-test/a"); | ||
172 | 71 | system("touch /tmp/marlin-test/b"); | ||
173 | 72 | system("touch /tmp/marlin-test/c"); | ||
174 | 73 | system("touch /tmp/marlin-test/d"); | ||
175 | 74 | |||
176 | 75 | /* we use cached directories so better block this callback */ | ||
177 | 76 | g_signal_handlers_block_by_func (dir, first_load_done, NULL); | ||
178 | 77 | |||
179 | 78 | GOFDirectoryAsync *dir2; | ||
180 | 79 | dir2 = gof_directory_async_from_file(dir->file); | ||
181 | 80 | g_signal_connect(dir2, "done_loading", (GCallback) second_load_done, NULL); | ||
182 | 81 | gof_directory_async_init(dir2, NULL, NULL); | ||
183 | 82 | |||
184 | 83 | /* free previously allocated dir */ | ||
185 | 84 | g_object_unref (dir); | ||
186 | 85 | } | ||
187 | 86 | |||
188 | 87 | void marlincore_tests_file(void) | ||
189 | 88 | { | ||
190 | 89 | GOFDirectoryAsync* dir; | ||
191 | 90 | |||
192 | 91 | g_test_log_set_fatal_handler(fatal_handler, NULL); | ||
193 | 92 | system("rm -rf /tmp/marlin-test"); | ||
194 | 93 | |||
195 | 94 | dir = gof_directory_async_from_gfile(g_file_new_for_path("/tmp/marlin-test")); | ||
196 | 95 | g_signal_connect(dir, "done_loading", (GCallback) first_load_done, NULL); | ||
197 | 96 | gof_directory_async_init(dir, NULL, NULL); | ||
198 | 97 | |||
199 | 98 | loop = g_main_loop_new(NULL, FALSE); | ||
200 | 99 | g_main_loop_run(loop); | ||
201 | 100 | } | ||
202 | 0 | 101 | ||
203 | === added file 'libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.h' | |||
204 | --- libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.h 1970-01-01 00:00:00 +0000 | |||
205 | +++ libcore/tests/GOFDirectoryAsyncTests/marlincore-tests-file.h 2017-02-08 11:12:03 +0000 | |||
206 | @@ -0,0 +1,27 @@ | |||
207 | 1 | /* | ||
208 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
209 | 3 | * | ||
210 | 4 | * Marlin is free software; you can redistribute it and/or | ||
211 | 5 | * modify it under the terms of the GNU General Public License as | ||
212 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
213 | 7 | * License, or (at your option) any later version. | ||
214 | 8 | * | ||
215 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
216 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
217 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
218 | 12 | * General Public License for more details. | ||
219 | 13 | * | ||
220 | 14 | * You should have received a copy of the GNU General Public License | ||
221 | 15 | * along with this program; if not, write to the Free Software | ||
222 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
223 | 17 | * | ||
224 | 18 | */ | ||
225 | 19 | |||
226 | 20 | #ifndef _H_MARLIN_CORE_TESTS_FILE | ||
227 | 21 | #define _H_MARLIN_CORE_TESTS_FILE | ||
228 | 22 | |||
229 | 23 | #include "gof-file.h" | ||
230 | 24 | |||
231 | 25 | void marlincore_tests_file(void); | ||
232 | 26 | |||
233 | 27 | #endif | ||
234 | 0 | 28 | ||
235 | === added file 'libcore/tests/GOFDirectoryAsyncTests/tests.c' | |||
236 | --- libcore/tests/GOFDirectoryAsyncTests/tests.c 1970-01-01 00:00:00 +0000 | |||
237 | +++ libcore/tests/GOFDirectoryAsyncTests/tests.c 2017-02-08 11:12:03 +0000 | |||
238 | @@ -0,0 +1,33 @@ | |||
239 | 1 | /* | ||
240 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
241 | 3 | * | ||
242 | 4 | * Marlin is free software; you can redistribute it and/or | ||
243 | 5 | * modify it under the terms of the GNU General Public License as | ||
244 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
245 | 7 | * License, or (at your option) any later version. | ||
246 | 8 | * | ||
247 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
248 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
249 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
250 | 12 | * General Public License for more details. | ||
251 | 13 | * | ||
252 | 14 | * You should have received a copy of the GNU General Public License | ||
253 | 15 | * along with this program; if not, write to the Free Software | ||
254 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
255 | 17 | * | ||
256 | 18 | */ | ||
257 | 19 | |||
258 | 20 | #include <gio/gio.h> | ||
259 | 21 | #include <gtk/gtk.h> | ||
260 | 22 | #include <glib.h> | ||
261 | 23 | #include "marlincore-tests-file.h" | ||
262 | 24 | #include "pantheon-files-core.h" | ||
263 | 25 | |||
264 | 26 | int main (int argc, char* argv[]) | ||
265 | 27 | { | ||
266 | 28 | g_test_init (&argc, &argv, NULL); | ||
267 | 29 | |||
268 | 30 | g_test_add_func("/marlin/file", marlincore_tests_file); | ||
269 | 31 | |||
270 | 32 | return g_test_run(); | ||
271 | 33 | } | ||
272 | 0 | 34 | ||
273 | === added directory 'libcore/tests/GOFFileTests' | |||
274 | === added file 'libcore/tests/GOFFileTests/CMakeLists.txt' | |||
275 | --- libcore/tests/GOFFileTests/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
276 | +++ libcore/tests/GOFFileTests/CMakeLists.txt 2017-02-08 11:12:03 +0000 | |||
277 | @@ -0,0 +1,32 @@ | |||
278 | 1 | include_directories(${CMAKE_BINARY_DIR}) | ||
279 | 2 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
280 | 3 | |||
281 | 4 | set (CORE_LIB | ||
282 | 5 | pantheon-files-core | ||
283 | 6 | ) | ||
284 | 7 | |||
285 | 8 | set (CFLAGS | ||
286 | 9 | ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER} | ||
287 | 10 | ) | ||
288 | 11 | |||
289 | 12 | set (LIB_PATHS | ||
290 | 13 | ${DEPS_LIBRARY_DIRS} | ||
291 | 14 | ) | ||
292 | 15 | |||
293 | 16 | set (TEST_NAME | ||
294 | 17 | gof-file_tests | ||
295 | 18 | ) | ||
296 | 19 | |||
297 | 20 | link_directories (${LIB_PATHS}) | ||
298 | 21 | add_definitions (${CFLAGS} -O2) | ||
299 | 22 | |||
300 | 23 | |||
301 | 24 | add_executable (${TEST_NAME} | ||
302 | 25 | tests.c | ||
303 | 26 | marlincore-tests-gof.c | ||
304 | 27 | ) | ||
305 | 28 | |||
306 | 29 | target_link_libraries (${TEST_NAME} ${CORE_LIB} ${DEPS_LIBRARIES}) | ||
307 | 30 | add_dependencies (${TEST_NAME} ${CORE_LIB}) | ||
308 | 31 | |||
309 | 32 | add_test (core-${TEST_NAME} ${TEST_NAME}) | ||
310 | 0 | 33 | ||
311 | === added file 'libcore/tests/GOFFileTests/marlincore-tests-gof.c' | |||
312 | --- libcore/tests/GOFFileTests/marlincore-tests-gof.c 1970-01-01 00:00:00 +0000 | |||
313 | +++ libcore/tests/GOFFileTests/marlincore-tests-gof.c 2017-02-08 11:12:03 +0000 | |||
314 | @@ -0,0 +1,99 @@ | |||
315 | 1 | /* | ||
316 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
317 | 3 | * | ||
318 | 4 | * Marlin is free software; you can redistribute it and/or | ||
319 | 5 | * modify it under the terms of the GNU General Public License as | ||
320 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
321 | 7 | * License, or (at your option) any later version. | ||
322 | 8 | * | ||
323 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
324 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
325 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
326 | 12 | * General Public License for more details. | ||
327 | 13 | * | ||
328 | 14 | * You should have received a copy of the GNU General Public License | ||
329 | 15 | * along with this program; if not, write to the Free Software | ||
330 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
331 | 17 | * | ||
332 | 18 | */ | ||
333 | 19 | |||
334 | 20 | #include <stdlib.h> | ||
335 | 21 | #include <gtk/gtk.h> | ||
336 | 22 | #include <glib.h> | ||
337 | 23 | #include <gio/gio.h> | ||
338 | 24 | #include "marlincore-tests-gof.h" | ||
339 | 25 | |||
340 | 26 | |||
341 | 27 | static gboolean fatal_handler(const gchar* log_domain, | ||
342 | 28 | GLogLevelFlags log_level, | ||
343 | 29 | const gchar* message, | ||
344 | 30 | gpointer user_data) | ||
345 | 31 | { | ||
346 | 32 | return FALSE; | ||
347 | 33 | } | ||
348 | 34 | |||
349 | 35 | |||
350 | 36 | void marlincore_tests_goffile(void) | ||
351 | 37 | { | ||
352 | 38 | GOFFile* file; | ||
353 | 39 | |||
354 | 40 | g_test_log_set_fatal_handler(fatal_handler, NULL); | ||
355 | 41 | /* The URI is valid, the target exists */ | ||
356 | 42 | file = gof_file_get_by_uri("file:///usr/share"); | ||
357 | 43 | g_assert(file != NULL); | ||
358 | 44 | gof_file_query_update (file); | ||
359 | 45 | g_assert(file != NULL); | ||
360 | 46 | g_assert(file->info != NULL); | ||
361 | 47 | g_assert_cmpstr(g_file_info_get_name (file->info), ==, "share"); | ||
362 | 48 | g_assert_cmpstr(g_file_info_get_display_name (file->info), ==, "share"); | ||
363 | 49 | g_assert_cmpstr(file->basename, ==, "share"); | ||
364 | 50 | g_assert_cmpint(file->is_directory, ==, TRUE); | ||
365 | 51 | g_assert_cmpint(file->is_hidden, ==, FALSE); | ||
366 | 52 | g_assert_cmpstr(gof_file_get_ftype (file), ==, "inode/directory"); | ||
367 | 53 | g_assert_cmpint(gof_file_is_symlink(file), ==, FALSE); | ||
368 | 54 | /* TODO: formated_type needs a test too, but there are some issues with | ||
369 | 55 | * translations. */ | ||
370 | 56 | g_assert_cmpstr(g_file_get_uri(file->location), ==, "file:///usr/share"); | ||
371 | 57 | g_assert_cmpstr(gof_file_get_uri(file), ==, "file:///usr/share"); | ||
372 | 58 | |||
373 | 59 | /* some allocations tests */ | ||
374 | 60 | int i; | ||
375 | 61 | for (i=0; i<5; i++) { | ||
376 | 62 | GFile *location = g_file_new_for_path ("/usr/share"); | ||
377 | 63 | file = gof_file_get(location); | ||
378 | 64 | g_object_unref (location); | ||
379 | 65 | } | ||
380 | 66 | for (i=0; i<5; i++) | ||
381 | 67 | g_object_unref (file); | ||
382 | 68 | /* we got to remove the file from the cache other the next cache lookup */ | ||
383 | 69 | gof_file_remove_from_caches (file); | ||
384 | 70 | g_object_unref (file); | ||
385 | 71 | file = gof_file_get_by_uri("file:///usr/share"); | ||
386 | 72 | g_object_unref (file); | ||
387 | 73 | |||
388 | 74 | |||
389 | 75 | /* The URI is valid, the target doesn't exist */ | ||
390 | 76 | g_test_log_set_fatal_handler(fatal_handler, NULL); | ||
391 | 77 | file = gof_file_get_by_uri("file:///tmp/very/long/path/azerty"); | ||
392 | 78 | g_assert(file != NULL); | ||
393 | 79 | |||
394 | 80 | system("rm /tmp/.marlin_backup /tmp/marlin_sym -f && touch /tmp/.marlin_backup"); | ||
395 | 81 | /* The URI is valid, the target exists */ | ||
396 | 82 | file = gof_file_get_by_uri("file:///tmp/.marlin_backup"); | ||
397 | 83 | gof_file_query_update (file); | ||
398 | 84 | g_assert(file != NULL); | ||
399 | 85 | g_assert_cmpint(file->is_directory, ==, FALSE); | ||
400 | 86 | g_assert_cmpint(file->is_hidden, ==, TRUE); /* it's a backup, so, it's hidden */ | ||
401 | 87 | g_assert_cmpint(file->size, ==, 0); /* the file is empty since we just create it it */ | ||
402 | 88 | |||
403 | 89 | system("ln -s /tmp/marlin_backup~ /tmp/marlin_sym "); | ||
404 | 90 | |||
405 | 91 | /* a symlink */ | ||
406 | 92 | file = gof_file_get_by_uri("file:///tmp/marlin_sym"); | ||
407 | 93 | gof_file_query_update (file); | ||
408 | 94 | g_assert(file != NULL); | ||
409 | 95 | g_assert_cmpstr(gof_file_get_symlink_target(file), ==, "/tmp/marlin_backup~"); | ||
410 | 96 | g_assert_cmpint(gof_file_is_symlink(file), ==, TRUE); | ||
411 | 97 | g_assert_cmpint(file->is_directory, ==, FALSE); | ||
412 | 98 | g_assert_cmpint(file->is_hidden, ==, FALSE); | ||
413 | 99 | } | ||
414 | 0 | 100 | ||
415 | === added file 'libcore/tests/GOFFileTests/marlincore-tests-gof.h' | |||
416 | --- libcore/tests/GOFFileTests/marlincore-tests-gof.h 1970-01-01 00:00:00 +0000 | |||
417 | +++ libcore/tests/GOFFileTests/marlincore-tests-gof.h 2017-02-08 11:12:03 +0000 | |||
418 | @@ -0,0 +1,27 @@ | |||
419 | 1 | /* | ||
420 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
421 | 3 | * | ||
422 | 4 | * Marlin is free software; you can redistribute it and/or | ||
423 | 5 | * modify it under the terms of the GNU General Public License as | ||
424 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
425 | 7 | * License, or (at your option) any later version. | ||
426 | 8 | * | ||
427 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
428 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
429 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
430 | 12 | * General Public License for more details. | ||
431 | 13 | * | ||
432 | 14 | * You should have received a copy of the GNU General Public License | ||
433 | 15 | * along with this program; if not, write to the Free Software | ||
434 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
435 | 17 | * | ||
436 | 18 | */ | ||
437 | 19 | |||
438 | 20 | #ifndef _H_MARLIN_CORE_TESTS_GOF | ||
439 | 21 | #define _H_MARLIN_CORE_TESTS_GOF | ||
440 | 22 | |||
441 | 23 | #include "gof-file.h" | ||
442 | 24 | |||
443 | 25 | void marlincore_tests_goffile(void); | ||
444 | 26 | |||
445 | 27 | #endif | ||
446 | 0 | 28 | ||
447 | === added file 'libcore/tests/GOFFileTests/tests.c' | |||
448 | --- libcore/tests/GOFFileTests/tests.c 1970-01-01 00:00:00 +0000 | |||
449 | +++ libcore/tests/GOFFileTests/tests.c 2017-02-08 11:12:03 +0000 | |||
450 | @@ -0,0 +1,33 @@ | |||
451 | 1 | /* | ||
452 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
453 | 3 | * | ||
454 | 4 | * Marlin is free software; you can redistribute it and/or | ||
455 | 5 | * modify it under the terms of the GNU General Public License as | ||
456 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
457 | 7 | * License, or (at your option) any later version. | ||
458 | 8 | * | ||
459 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
460 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
461 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
462 | 12 | * General Public License for more details. | ||
463 | 13 | * | ||
464 | 14 | * You should have received a copy of the GNU General Public License | ||
465 | 15 | * along with this program; if not, write to the Free Software | ||
466 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
467 | 17 | * | ||
468 | 18 | */ | ||
469 | 19 | |||
470 | 20 | #include <gio/gio.h> | ||
471 | 21 | #include <gtk/gtk.h> | ||
472 | 22 | #include <glib.h> | ||
473 | 23 | #include "marlincore-tests-gof.h" | ||
474 | 24 | #include "pantheon-files-core.h" | ||
475 | 25 | |||
476 | 26 | int main (int argc, char* argv[]) | ||
477 | 27 | { | ||
478 | 28 | g_test_init (&argc, &argv, NULL); | ||
479 | 29 | |||
480 | 30 | g_test_add_func("/marlin/goffile", marlincore_tests_goffile); | ||
481 | 31 | |||
482 | 32 | return g_test_run(); | ||
483 | 33 | } | ||
484 | 0 | 34 | ||
485 | === removed file 'libcore/tests/Makefile.am' | |||
486 | --- libcore/tests/Makefile.am 2013-08-10 20:20:23 +0000 | |||
487 | +++ libcore/tests/Makefile.am 1970-01-01 00:00:00 +0000 | |||
488 | @@ -1,20 +0,0 @@ | |||
489 | 1 | # GLIB - Library of useful C routines | ||
490 | 2 | |||
491 | 3 | #GTESTER = gtester # for non-GLIB packages | ||
492 | 4 | GTESTER = /usr/bin/gtester # for the GLIB package | ||
493 | 5 | GTESTER_REPORT = /usr/bin/gtester-report # for the GLIB package | ||
494 | 6 | |||
495 | 7 | check_PROGRAMS = coremarlin_tests | ||
496 | 8 | coremarlin_tests_SOURCES = tests.c \ | ||
497 | 9 | marlincore-tests-gof.c \ | ||
498 | 10 | marlincore-tests-file.c | ||
499 | 11 | |||
500 | 12 | coremarlin_tests_LDADD = \ | ||
501 | 13 | $(top_srcdir)/libcore/libmarlincore.la \ | ||
502 | 14 | $(top_srcdir)/libwidgets/libmarlinwidgets.la \ | ||
503 | 15 | $(CORE_LIBS) \ | ||
504 | 16 | $(NULL) | ||
505 | 17 | coremarlin_tests_CFLAGS = $(CORE_CFLAGS) -I.. -I$(top_srcdir)/libcore | ||
506 | 18 | TESTS_ENVIRONMENT= $(GTESTER) | ||
507 | 19 | TESTS = coremarlin_tests | ||
508 | 20 | |||
509 | 21 | 0 | ||
510 | === added directory 'libcore/tests/MarlinIconInfoTests' | |||
511 | === added file 'libcore/tests/MarlinIconInfoTests/CMakeLists.txt' | |||
512 | --- libcore/tests/MarlinIconInfoTests/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
513 | +++ libcore/tests/MarlinIconInfoTests/CMakeLists.txt 2017-02-08 11:12:03 +0000 | |||
514 | @@ -0,0 +1,32 @@ | |||
515 | 1 | include_directories(${CMAKE_BINARY_DIR}) | ||
516 | 2 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
517 | 3 | |||
518 | 4 | set (CORE_LIB | ||
519 | 5 | pantheon-files-core | ||
520 | 6 | ) | ||
521 | 7 | |||
522 | 8 | set (CFLAGS | ||
523 | 9 | ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER} | ||
524 | 10 | ) | ||
525 | 11 | |||
526 | 12 | set (LIB_PATHS | ||
527 | 13 | ${DEPS_LIBRARY_DIRS} | ||
528 | 14 | ) | ||
529 | 15 | |||
530 | 16 | set (TEST_NAME | ||
531 | 17 | marlin-icon-info_tests | ||
532 | 18 | ) | ||
533 | 19 | |||
534 | 20 | link_directories (${LIB_PATHS}) | ||
535 | 21 | add_definitions (${CFLAGS} -O2) | ||
536 | 22 | |||
537 | 23 | |||
538 | 24 | add_executable (${TEST_NAME} | ||
539 | 25 | tests.c | ||
540 | 26 | marlincore-tests-icon-info.c | ||
541 | 27 | ) | ||
542 | 28 | |||
543 | 29 | target_link_libraries (${TEST_NAME} ${CORE_LIB} ${DEPS_LIBRARIES}) | ||
544 | 30 | add_dependencies (${TEST_NAME} ${CORE_LIB}) | ||
545 | 31 | |||
546 | 32 | add_test (core-${TEST_NAME} ${TEST_NAME}) | ||
547 | 0 | 33 | ||
548 | === added file 'libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.c' | |||
549 | --- libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.c 1970-01-01 00:00:00 +0000 | |||
550 | +++ libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.c 2017-02-08 11:12:03 +0000 | |||
551 | @@ -0,0 +1,65 @@ | |||
552 | 1 | /* | ||
553 | 2 | * Copyright (C) 2012, ammonkey <am.monkeyd@gmail.com> | ||
554 | 3 | * | ||
555 | 4 | * Marlin is free software; you can redistribute it and/or | ||
556 | 5 | * modify it under the terms of the GNU General Public License as | ||
557 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
558 | 7 | * License, or (at your option) any later version. | ||
559 | 8 | * | ||
560 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
561 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
562 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
563 | 12 | * General Public License for more details. | ||
564 | 13 | * | ||
565 | 14 | * You should have received a copy of the GNU General Public License | ||
566 | 15 | * along with this program; if not, write to the Free Software | ||
567 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
568 | 17 | * | ||
569 | 18 | */ | ||
570 | 19 | |||
571 | 20 | #include <stdlib.h> | ||
572 | 21 | #include <gtk/gtk.h> | ||
573 | 22 | #include <glib.h> | ||
574 | 23 | #include <gio/gio.h> | ||
575 | 24 | #include "marlincore-tests-icon-info.h" | ||
576 | 25 | |||
577 | 26 | GMainLoop* loop; | ||
578 | 27 | |||
579 | 28 | static gboolean fatal_handler(const gchar* log_domain, | ||
580 | 29 | GLogLevelFlags log_level, | ||
581 | 30 | const gchar* message, | ||
582 | 31 | gpointer user_data) | ||
583 | 32 | { | ||
584 | 33 | return FALSE; | ||
585 | 34 | } | ||
586 | 35 | |||
587 | 36 | static gboolean | ||
588 | 37 | show_infos (gpointer data) | ||
589 | 38 | { | ||
590 | 39 | marlin_icon_info_infos_caches (); | ||
591 | 40 | g_main_loop_quit (loop); | ||
592 | 41 | |||
593 | 42 | return FALSE; | ||
594 | 43 | } | ||
595 | 44 | |||
596 | 45 | void marlincore_tests_icon_info (void) | ||
597 | 46 | { | ||
598 | 47 | GOFFile* file; | ||
599 | 48 | g_test_log_set_fatal_handler (fatal_handler, NULL); | ||
600 | 49 | /* The URI is valid, the target exists */ | ||
601 | 50 | file = gof_file_get_by_uri ("file:///usr/share/icons/hicolor/16x16/apps/system-file-manager.svg"); | ||
602 | 51 | g_assert(file != NULL); | ||
603 | 52 | gof_file_query_update (file); | ||
604 | 53 | g_assert(file->pix == NULL); | ||
605 | 54 | file->flags = 2; | ||
606 | 55 | gof_file_update_icon (file, 128); | ||
607 | 56 | g_assert(file->pix != NULL); | ||
608 | 57 | gof_file_update_icon (file, 32); | ||
609 | 58 | /*gof_file_update_icon (file, 16);*/ | ||
610 | 59 | g_message ("pix ref count %u", G_OBJECT (file->pix)->ref_count); | ||
611 | 60 | g_object_unref (file->pix); | ||
612 | 61 | g_timeout_add_seconds_full (0, 2, show_infos, NULL, NULL); | ||
613 | 62 | |||
614 | 63 | loop = g_main_loop_new(NULL, FALSE); | ||
615 | 64 | g_main_loop_run(loop); | ||
616 | 65 | } | ||
617 | 0 | 66 | ||
618 | === added file 'libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.h' | |||
619 | --- libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.h 1970-01-01 00:00:00 +0000 | |||
620 | +++ libcore/tests/MarlinIconInfoTests/marlincore-tests-icon-info.h 2017-02-08 11:12:03 +0000 | |||
621 | @@ -0,0 +1,28 @@ | |||
622 | 1 | /* | ||
623 | 2 | * Copyright (C) 2012, ammonkey <am.monkeyd@gmail.com> | ||
624 | 3 | * | ||
625 | 4 | * Marlin is free software; you can redistribute it and/or | ||
626 | 5 | * modify it under the terms of the GNU General Public License as | ||
627 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
628 | 7 | * License, or (at your option) any later version. | ||
629 | 8 | * | ||
630 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
631 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
632 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
633 | 12 | * General Public License for more details. | ||
634 | 13 | * | ||
635 | 14 | * You should have received a copy of the GNU General Public License | ||
636 | 15 | * along with this program; if not, write to the Free Software | ||
637 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
638 | 17 | * | ||
639 | 18 | */ | ||
640 | 19 | |||
641 | 20 | #ifndef _H_MARLIN_CORE_TESTS_ICON_INFO | ||
642 | 21 | #define _H_MARLIN_CORE_TESTS_ICON_INFO | ||
643 | 22 | |||
644 | 23 | #include "gof-file.h" | ||
645 | 24 | #include "marlin-icon-info.h" | ||
646 | 25 | |||
647 | 26 | void marlincore_tests_icon_info (void); | ||
648 | 27 | |||
649 | 28 | #endif | ||
650 | 0 | 29 | ||
651 | === added file 'libcore/tests/MarlinIconInfoTests/tests.c' | |||
652 | --- libcore/tests/MarlinIconInfoTests/tests.c 1970-01-01 00:00:00 +0000 | |||
653 | +++ libcore/tests/MarlinIconInfoTests/tests.c 2017-02-08 11:12:03 +0000 | |||
654 | @@ -0,0 +1,34 @@ | |||
655 | 1 | /* | ||
656 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
657 | 3 | * | ||
658 | 4 | * Marlin is free software; you can redistribute it and/or | ||
659 | 5 | * modify it under the terms of the GNU General Public License as | ||
660 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
661 | 7 | * License, or (at your option) any later version. | ||
662 | 8 | * | ||
663 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
664 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
665 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
666 | 12 | * General Public License for more details. | ||
667 | 13 | * | ||
668 | 14 | * You should have received a copy of the GNU General Public License | ||
669 | 15 | * along with this program; if not, write to the Free Software | ||
670 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
671 | 17 | * | ||
672 | 18 | */ | ||
673 | 19 | |||
674 | 20 | #include <gio/gio.h> | ||
675 | 21 | #include <gtk/gtk.h> | ||
676 | 22 | #include <glib.h> | ||
677 | 23 | #include "marlincore-tests-icon-info.h" | ||
678 | 24 | #include "pantheon-files-core.h" | ||
679 | 25 | |||
680 | 26 | int main (int argc, char* argv[]) | ||
681 | 27 | { | ||
682 | 28 | g_test_init (&argc, &argv, NULL); | ||
683 | 29 | |||
684 | 30 | /* only used for local tests with local files */ | ||
685 | 31 | g_test_add_func ("/marlin/icon_info", marlincore_tests_icon_info); | ||
686 | 32 | |||
687 | 33 | return g_test_run(); | ||
688 | 34 | } | ||
689 | 0 | 35 | ||
690 | === added directory 'libcore/tests/UtilTests' | |||
691 | === added file 'libcore/tests/UtilTests/CMakeLists.txt' | |||
692 | --- libcore/tests/UtilTests/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
693 | +++ libcore/tests/UtilTests/CMakeLists.txt 2017-02-08 11:12:03 +0000 | |||
694 | @@ -0,0 +1,45 @@ | |||
695 | 1 | set (PKGNAME pantheon-files-core) | ||
696 | 2 | set (PKGNAME_ PANTHEON_FILES_CORE) | ||
697 | 3 | set (${PKGNAME_}_VERSION 0.1) | ||
698 | 4 | # increase the version number if you break the API | ||
699 | 5 | |||
700 | 6 | include_directories(${CMAKE_BINARY_DIR}) | ||
701 | 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
702 | 8 | |||
703 | 9 | set (CFLAGS | ||
704 | 10 | ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER} | ||
705 | 11 | ) | ||
706 | 12 | |||
707 | 13 | set (LIB_PATHS | ||
708 | 14 | ${DEPS_LIBRARY_DIRS} | ||
709 | 15 | ) | ||
710 | 16 | |||
711 | 17 | link_directories (${LIB_PATHS}) | ||
712 | 18 | add_definitions (${CFLAGS} -O2) | ||
713 | 19 | |||
714 | 20 | vala_precompile (VALA_TEST_C ${PKGNAME}-vala_tests | ||
715 | 21 | UtilTests.vala | ||
716 | 22 | PACKAGES | ||
717 | 23 | granite | ||
718 | 24 | gtk+-3.0 | ||
719 | 25 | gio-2.0 | ||
720 | 26 | gee-0.8 | ||
721 | 27 | gmodule-2.0 | ||
722 | 28 | libcanberra | ||
723 | 29 | pantheon-files-core | ||
724 | 30 | pantheon-files-core-C | ||
725 | 31 | OPTIONS | ||
726 | 32 | --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/ | ||
727 | 33 | --thread | ||
728 | 34 | --target-glib=2.32 # Needed for new thread API | ||
729 | 35 | ) | ||
730 | 36 | |||
731 | 37 | add_executable (${PKGNAME}-vala_tests | ||
732 | 38 | ${VALA_TEST_C} | ||
733 | 39 | ) | ||
734 | 40 | |||
735 | 41 | target_link_libraries (${PKGNAME}-vala_tests pantheon-files-core ${DEPS_LIBRARIES}) | ||
736 | 42 | add_dependencies (${PKGNAME}-vala_tests pantheon-files-core) | ||
737 | 43 | |||
738 | 44 | add_test (core-vala-tests ${PKGNAME}-vala_tests) | ||
739 | 45 | |||
740 | 0 | 46 | ||
741 | === renamed file 'libcore/tests/Tests.vala' => 'libcore/tests/UtilTests/UtilTests.vala' | |||
742 | === removed file 'libcore/tests/marlincore-tests-file.c' | |||
743 | --- libcore/tests/marlincore-tests-file.c 2017-01-05 19:16:00 +0000 | |||
744 | +++ libcore/tests/marlincore-tests-file.c 1970-01-01 00:00:00 +0000 | |||
745 | @@ -1,100 +0,0 @@ | |||
746 | 1 | /* | ||
747 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
748 | 3 | * | ||
749 | 4 | * Marlin is free software; you can redistribute it and/or | ||
750 | 5 | * modify it under the terms of the GNU General Public License as | ||
751 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
752 | 7 | * License, or (at your option) any later version. | ||
753 | 8 | * | ||
754 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
755 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
756 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
757 | 12 | * General Public License for more details. | ||
758 | 13 | * | ||
759 | 14 | * You should have received a copy of the GNU General Public License | ||
760 | 15 | * along with this program; if not, write to the Free Software | ||
761 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
762 | 17 | * | ||
763 | 18 | */ | ||
764 | 19 | |||
765 | 20 | #include <stdlib.h> | ||
766 | 21 | #include <gtk/gtk.h> | ||
767 | 22 | #include <glib.h> | ||
768 | 23 | #include <gio/gio.h> | ||
769 | 24 | #include "marlincore-tests-file.h" | ||
770 | 25 | #include "pantheon-files-core.h" | ||
771 | 26 | #include "gof-file.h" | ||
772 | 27 | |||
773 | 28 | GMainLoop* loop; | ||
774 | 29 | |||
775 | 30 | static gboolean fatal_handler(const gchar* log_domain, | ||
776 | 31 | GLogLevelFlags log_level, | ||
777 | 32 | const gchar* message, | ||
778 | 33 | gpointer user_data) | ||
779 | 34 | { | ||
780 | 35 | return FALSE; | ||
781 | 36 | } | ||
782 | 37 | |||
783 | 38 | static void second_load_done(GOFDirectoryAsync* dir, gpointer data) | ||
784 | 39 | { | ||
785 | 40 | g_message ("%s", G_STRFUNC); | ||
786 | 41 | g_assert_cmpint(dir->file->exists, ==, TRUE); | ||
787 | 42 | |||
788 | 43 | GOFDirectoryAsync *dir2 = gof_directory_async_from_file(dir->file); | ||
789 | 44 | g_assert_cmpint(dir->files_count, ==, dir2->files_count); | ||
790 | 45 | g_message ("files_count %u", dir->files_count); | ||
791 | 46 | g_object_unref (dir2); | ||
792 | 47 | |||
793 | 48 | /* some files testing inside a cached directory */ | ||
794 | 49 | GOFFile *f1 = gof_file_get_by_uri ("file:///tmp/marlin-test/a"); | ||
795 | 50 | g_object_unref (f1); | ||
796 | 51 | |||
797 | 52 | GOFFile *f2 = gof_file_get_by_uri ("file:///tmp/marlin-test/a"); | ||
798 | 53 | g_object_unref (f2); | ||
799 | 54 | |||
800 | 55 | /* use a marlin function would show a dialog, FIXME */ | ||
801 | 56 | system("rm -rf /tmp/marlin-test"); | ||
802 | 57 | /* free previously allocated dir */ | ||
803 | 58 | g_object_unref (dir); | ||
804 | 59 | |||
805 | 60 | g_main_loop_quit(loop); | ||
806 | 61 | |||
807 | 62 | } | ||
808 | 63 | |||
809 | 64 | static void first_load_done(GOFDirectoryAsync* dir, gpointer data) | ||
810 | 65 | { | ||
811 | 66 | g_message ("%s", G_STRFUNC); | ||
812 | 67 | g_assert_cmpint(dir->file->exists, ==, FALSE); | ||
813 | 68 | |||
814 | 69 | system("mkdir /tmp/marlin-test"); | ||
815 | 70 | system("touch /tmp/marlin-test/a"); | ||
816 | 71 | system("touch /tmp/marlin-test/b"); | ||
817 | 72 | system("touch /tmp/marlin-test/c"); | ||
818 | 73 | system("touch /tmp/marlin-test/d"); | ||
819 | 74 | |||
820 | 75 | /* we use cached directories so better block this callback */ | ||
821 | 76 | g_signal_handlers_block_by_func (dir, first_load_done, NULL); | ||
822 | 77 | |||
823 | 78 | GOFDirectoryAsync *dir2; | ||
824 | 79 | dir2 = gof_directory_async_from_file(dir->file); | ||
825 | 80 | g_signal_connect(dir2, "done_loading", (GCallback) second_load_done, NULL); | ||
826 | 81 | gof_directory_async_init(dir2, NULL, NULL); | ||
827 | 82 | |||
828 | 83 | /* free previously allocated dir */ | ||
829 | 84 | g_object_unref (dir); | ||
830 | 85 | } | ||
831 | 86 | |||
832 | 87 | void marlincore_tests_file(void) | ||
833 | 88 | { | ||
834 | 89 | GOFDirectoryAsync* dir; | ||
835 | 90 | |||
836 | 91 | g_test_log_set_fatal_handler(fatal_handler, NULL); | ||
837 | 92 | system("rm -rf /tmp/marlin-test"); | ||
838 | 93 | |||
839 | 94 | dir = gof_directory_async_from_gfile(g_file_new_for_path("/tmp/marlin-test")); | ||
840 | 95 | g_signal_connect(dir, "done_loading", (GCallback) first_load_done, NULL); | ||
841 | 96 | gof_directory_async_init(dir, NULL, NULL); | ||
842 | 97 | |||
843 | 98 | loop = g_main_loop_new(NULL, FALSE); | ||
844 | 99 | g_main_loop_run(loop); | ||
845 | 100 | } | ||
846 | 101 | 0 | ||
847 | === removed file 'libcore/tests/marlincore-tests-file.h' | |||
848 | --- libcore/tests/marlincore-tests-file.h 2011-05-12 19:41:47 +0000 | |||
849 | +++ libcore/tests/marlincore-tests-file.h 1970-01-01 00:00:00 +0000 | |||
850 | @@ -1,27 +0,0 @@ | |||
851 | 1 | /* | ||
852 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
853 | 3 | * | ||
854 | 4 | * Marlin is free software; you can redistribute it and/or | ||
855 | 5 | * modify it under the terms of the GNU General Public License as | ||
856 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
857 | 7 | * License, or (at your option) any later version. | ||
858 | 8 | * | ||
859 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
860 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
861 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
862 | 12 | * General Public License for more details. | ||
863 | 13 | * | ||
864 | 14 | * You should have received a copy of the GNU General Public License | ||
865 | 15 | * along with this program; if not, write to the Free Software | ||
866 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
867 | 17 | * | ||
868 | 18 | */ | ||
869 | 19 | |||
870 | 20 | #ifndef _H_MARLIN_CORE_TESTS_FILE | ||
871 | 21 | #define _H_MARLIN_CORE_TESTS_FILE | ||
872 | 22 | |||
873 | 23 | #include "gof-file.h" | ||
874 | 24 | |||
875 | 25 | void marlincore_tests_file(void); | ||
876 | 26 | |||
877 | 27 | #endif | ||
878 | 28 | 0 | ||
879 | === removed file 'libcore/tests/marlincore-tests-gof.c' | |||
880 | --- libcore/tests/marlincore-tests-gof.c 2017-01-05 19:16:00 +0000 | |||
881 | +++ libcore/tests/marlincore-tests-gof.c 1970-01-01 00:00:00 +0000 | |||
882 | @@ -1,99 +0,0 @@ | |||
883 | 1 | /* | ||
884 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
885 | 3 | * | ||
886 | 4 | * Marlin is free software; you can redistribute it and/or | ||
887 | 5 | * modify it under the terms of the GNU General Public License as | ||
888 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
889 | 7 | * License, or (at your option) any later version. | ||
890 | 8 | * | ||
891 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
892 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
893 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
894 | 12 | * General Public License for more details. | ||
895 | 13 | * | ||
896 | 14 | * You should have received a copy of the GNU General Public License | ||
897 | 15 | * along with this program; if not, write to the Free Software | ||
898 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
899 | 17 | * | ||
900 | 18 | */ | ||
901 | 19 | |||
902 | 20 | #include <stdlib.h> | ||
903 | 21 | #include <gtk/gtk.h> | ||
904 | 22 | #include <glib.h> | ||
905 | 23 | #include <gio/gio.h> | ||
906 | 24 | #include "marlincore-tests-gof.h" | ||
907 | 25 | |||
908 | 26 | |||
909 | 27 | static gboolean fatal_handler(const gchar* log_domain, | ||
910 | 28 | GLogLevelFlags log_level, | ||
911 | 29 | const gchar* message, | ||
912 | 30 | gpointer user_data) | ||
913 | 31 | { | ||
914 | 32 | return FALSE; | ||
915 | 33 | } | ||
916 | 34 | |||
917 | 35 | |||
918 | 36 | void marlincore_tests_goffile(void) | ||
919 | 37 | { | ||
920 | 38 | GOFFile* file; | ||
921 | 39 | |||
922 | 40 | g_test_log_set_fatal_handler(fatal_handler, NULL); | ||
923 | 41 | /* The URI is valid, the target exists */ | ||
924 | 42 | file = gof_file_get_by_uri("file:///usr/share"); | ||
925 | 43 | g_assert(file != NULL); | ||
926 | 44 | gof_file_query_update (file); | ||
927 | 45 | g_assert(file != NULL); | ||
928 | 46 | g_assert(file->info != NULL); | ||
929 | 47 | g_assert_cmpstr(g_file_info_get_name (file->info), ==, "share"); | ||
930 | 48 | g_assert_cmpstr(g_file_info_get_display_name (file->info), ==, "share"); | ||
931 | 49 | g_assert_cmpstr(file->basename, ==, "share"); | ||
932 | 50 | g_assert_cmpint(file->is_directory, ==, TRUE); | ||
933 | 51 | g_assert_cmpint(file->is_hidden, ==, FALSE); | ||
934 | 52 | g_assert_cmpstr(gof_file_get_ftype (file), ==, "inode/directory"); | ||
935 | 53 | g_assert_cmpint(gof_file_is_symlink(file), ==, FALSE); | ||
936 | 54 | /* TODO: formated_type needs a test too, but there are some issues with | ||
937 | 55 | * translations. */ | ||
938 | 56 | g_assert_cmpstr(g_file_get_uri(file->location), ==, "file:///usr/share"); | ||
939 | 57 | g_assert_cmpstr(gof_file_get_uri(file), ==, "file:///usr/share"); | ||
940 | 58 | |||
941 | 59 | /* some allocations tests */ | ||
942 | 60 | int i; | ||
943 | 61 | for (i=0; i<5; i++) { | ||
944 | 62 | GFile *location = g_file_new_for_path ("/usr/share"); | ||
945 | 63 | file = gof_file_get(location); | ||
946 | 64 | g_object_unref (location); | ||
947 | 65 | } | ||
948 | 66 | for (i=0; i<5; i++) | ||
949 | 67 | g_object_unref (file); | ||
950 | 68 | /* we got to remove the file from the cache other the next cache lookup */ | ||
951 | 69 | gof_file_remove_from_caches (file); | ||
952 | 70 | g_object_unref (file); | ||
953 | 71 | file = gof_file_get_by_uri("file:///usr/share"); | ||
954 | 72 | g_object_unref (file); | ||
955 | 73 | |||
956 | 74 | |||
957 | 75 | /* The URI is valid, the target doesn't exist */ | ||
958 | 76 | g_test_log_set_fatal_handler(fatal_handler, NULL); | ||
959 | 77 | file = gof_file_get_by_uri("file:///tmp/very/long/path/azerty"); | ||
960 | 78 | g_assert(file != NULL); | ||
961 | 79 | |||
962 | 80 | system("rm /tmp/.marlin_backup /tmp/marlin_sym -f && touch /tmp/.marlin_backup"); | ||
963 | 81 | /* The URI is valid, the target exists */ | ||
964 | 82 | file = gof_file_get_by_uri("file:///tmp/.marlin_backup"); | ||
965 | 83 | gof_file_query_update (file); | ||
966 | 84 | g_assert(file != NULL); | ||
967 | 85 | g_assert_cmpint(file->is_directory, ==, FALSE); | ||
968 | 86 | g_assert_cmpint(file->is_hidden, ==, TRUE); /* it's a backup, so, it's hidden */ | ||
969 | 87 | g_assert_cmpint(file->size, ==, 0); /* the file is empty since we just create it it */ | ||
970 | 88 | |||
971 | 89 | system("ln -s /tmp/marlin_backup~ /tmp/marlin_sym "); | ||
972 | 90 | |||
973 | 91 | /* a symlink */ | ||
974 | 92 | file = gof_file_get_by_uri("file:///tmp/marlin_sym"); | ||
975 | 93 | gof_file_query_update (file); | ||
976 | 94 | g_assert(file != NULL); | ||
977 | 95 | g_assert_cmpstr(gof_file_get_symlink_target(file), ==, "/tmp/marlin_backup~"); | ||
978 | 96 | g_assert_cmpint(gof_file_is_symlink(file), ==, TRUE); | ||
979 | 97 | g_assert_cmpint(file->is_directory, ==, FALSE); | ||
980 | 98 | g_assert_cmpint(file->is_hidden, ==, FALSE); | ||
981 | 99 | } | ||
982 | 100 | 0 | ||
983 | === removed file 'libcore/tests/marlincore-tests-gof.h' | |||
984 | --- libcore/tests/marlincore-tests-gof.h 2011-05-10 07:52:36 +0000 | |||
985 | +++ libcore/tests/marlincore-tests-gof.h 1970-01-01 00:00:00 +0000 | |||
986 | @@ -1,27 +0,0 @@ | |||
987 | 1 | /* | ||
988 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
989 | 3 | * | ||
990 | 4 | * Marlin is free software; you can redistribute it and/or | ||
991 | 5 | * modify it under the terms of the GNU General Public License as | ||
992 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
993 | 7 | * License, or (at your option) any later version. | ||
994 | 8 | * | ||
995 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
996 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
997 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
998 | 12 | * General Public License for more details. | ||
999 | 13 | * | ||
1000 | 14 | * You should have received a copy of the GNU General Public License | ||
1001 | 15 | * along with this program; if not, write to the Free Software | ||
1002 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
1003 | 17 | * | ||
1004 | 18 | */ | ||
1005 | 19 | |||
1006 | 20 | #ifndef _H_MARLIN_CORE_TESTS_GOF | ||
1007 | 21 | #define _H_MARLIN_CORE_TESTS_GOF | ||
1008 | 22 | |||
1009 | 23 | #include "gof-file.h" | ||
1010 | 24 | |||
1011 | 25 | void marlincore_tests_goffile(void); | ||
1012 | 26 | |||
1013 | 27 | #endif | ||
1014 | 28 | 0 | ||
1015 | === removed file 'libcore/tests/marlincore-tests-icon-info.c' | |||
1016 | --- libcore/tests/marlincore-tests-icon-info.c 2017-02-01 17:03:01 +0000 | |||
1017 | +++ libcore/tests/marlincore-tests-icon-info.c 1970-01-01 00:00:00 +0000 | |||
1018 | @@ -1,65 +0,0 @@ | |||
1019 | 1 | /* | ||
1020 | 2 | * Copyright (C) 2012, ammonkey <am.monkeyd@gmail.com> | ||
1021 | 3 | * | ||
1022 | 4 | * Marlin is free software; you can redistribute it and/or | ||
1023 | 5 | * modify it under the terms of the GNU General Public License as | ||
1024 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
1025 | 7 | * License, or (at your option) any later version. | ||
1026 | 8 | * | ||
1027 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
1028 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1029 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1030 | 12 | * General Public License for more details. | ||
1031 | 13 | * | ||
1032 | 14 | * You should have received a copy of the GNU General Public License | ||
1033 | 15 | * along with this program; if not, write to the Free Software | ||
1034 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
1035 | 17 | * | ||
1036 | 18 | */ | ||
1037 | 19 | |||
1038 | 20 | #include <stdlib.h> | ||
1039 | 21 | #include <gtk/gtk.h> | ||
1040 | 22 | #include <glib.h> | ||
1041 | 23 | #include <gio/gio.h> | ||
1042 | 24 | #include "marlincore-tests-icon-info.h" | ||
1043 | 25 | |||
1044 | 26 | GMainLoop* loop; | ||
1045 | 27 | |||
1046 | 28 | static gboolean fatal_handler(const gchar* log_domain, | ||
1047 | 29 | GLogLevelFlags log_level, | ||
1048 | 30 | const gchar* message, | ||
1049 | 31 | gpointer user_data) | ||
1050 | 32 | { | ||
1051 | 33 | return FALSE; | ||
1052 | 34 | } | ||
1053 | 35 | |||
1054 | 36 | static gboolean | ||
1055 | 37 | show_infos (gpointer data) | ||
1056 | 38 | { | ||
1057 | 39 | marlin_icon_info_infos_caches (); | ||
1058 | 40 | g_main_loop_quit (loop); | ||
1059 | 41 | |||
1060 | 42 | return FALSE; | ||
1061 | 43 | } | ||
1062 | 44 | |||
1063 | 45 | void marlincore_tests_icon_info (void) | ||
1064 | 46 | { | ||
1065 | 47 | GOFFile* file; | ||
1066 | 48 | g_test_log_set_fatal_handler (fatal_handler, NULL); | ||
1067 | 49 | /* The URI is valid, the target exists */ | ||
1068 | 50 | file = gof_file_get_by_uri ("file:///usr/share/icons/hicolor/16x16/apps/system-file-manager.svg"); | ||
1069 | 51 | g_assert(file != NULL); | ||
1070 | 52 | gof_file_query_update (file); | ||
1071 | 53 | g_assert(file->pix == NULL); | ||
1072 | 54 | file->flags = 2; | ||
1073 | 55 | gof_file_update_icon (file, 128); | ||
1074 | 56 | g_assert(file->pix != NULL); | ||
1075 | 57 | gof_file_update_icon (file, 32); | ||
1076 | 58 | /*gof_file_update_icon (file, 16);*/ | ||
1077 | 59 | g_message ("pix ref count %u", G_OBJECT (file->pix)->ref_count); | ||
1078 | 60 | g_object_unref (file->pix); | ||
1079 | 61 | g_timeout_add_seconds_full (0, 2, show_infos, NULL, NULL); | ||
1080 | 62 | |||
1081 | 63 | loop = g_main_loop_new(NULL, FALSE); | ||
1082 | 64 | g_main_loop_run(loop); | ||
1083 | 65 | } | ||
1084 | 66 | 0 | ||
1085 | === removed file 'libcore/tests/marlincore-tests-icon-info.h' | |||
1086 | --- libcore/tests/marlincore-tests-icon-info.h 2012-01-14 22:01:23 +0000 | |||
1087 | +++ libcore/tests/marlincore-tests-icon-info.h 1970-01-01 00:00:00 +0000 | |||
1088 | @@ -1,28 +0,0 @@ | |||
1089 | 1 | /* | ||
1090 | 2 | * Copyright (C) 2012, ammonkey <am.monkeyd@gmail.com> | ||
1091 | 3 | * | ||
1092 | 4 | * Marlin is free software; you can redistribute it and/or | ||
1093 | 5 | * modify it under the terms of the GNU General Public License as | ||
1094 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
1095 | 7 | * License, or (at your option) any later version. | ||
1096 | 8 | * | ||
1097 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
1098 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1099 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1100 | 12 | * General Public License for more details. | ||
1101 | 13 | * | ||
1102 | 14 | * You should have received a copy of the GNU General Public License | ||
1103 | 15 | * along with this program; if not, write to the Free Software | ||
1104 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
1105 | 17 | * | ||
1106 | 18 | */ | ||
1107 | 19 | |||
1108 | 20 | #ifndef _H_MARLIN_CORE_TESTS_ICON_INFO | ||
1109 | 21 | #define _H_MARLIN_CORE_TESTS_ICON_INFO | ||
1110 | 22 | |||
1111 | 23 | #include "gof-file.h" | ||
1112 | 24 | #include "marlin-icon-info.h" | ||
1113 | 25 | |||
1114 | 26 | void marlincore_tests_icon_info (void); | ||
1115 | 27 | |||
1116 | 28 | #endif | ||
1117 | 29 | 0 | ||
1118 | === removed file 'libcore/tests/tests.c' | |||
1119 | --- libcore/tests/tests.c 2017-02-01 17:03:01 +0000 | |||
1120 | +++ libcore/tests/tests.c 1970-01-01 00:00:00 +0000 | |||
1121 | @@ -1,38 +0,0 @@ | |||
1122 | 1 | /* | ||
1123 | 2 | * Copyright (C) 2011, Lucas Baudin <xapantu@gmail.com> | ||
1124 | 3 | * | ||
1125 | 4 | * Marlin is free software; you can redistribute it and/or | ||
1126 | 5 | * modify it under the terms of the GNU General Public License as | ||
1127 | 6 | * published by the Free Software Foundation; either version 2 of the | ||
1128 | 7 | * License, or (at your option) any later version. | ||
1129 | 8 | * | ||
1130 | 9 | * Marlin is distributed in the hope that it will be useful, | ||
1131 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1132 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1133 | 12 | * General Public License for more details. | ||
1134 | 13 | * | ||
1135 | 14 | * You should have received a copy of the GNU General Public License | ||
1136 | 15 | * along with this program; if not, write to the Free Software | ||
1137 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
1138 | 17 | * | ||
1139 | 18 | */ | ||
1140 | 19 | |||
1141 | 20 | #include <gio/gio.h> | ||
1142 | 21 | #include <gtk/gtk.h> | ||
1143 | 22 | #include <glib.h> | ||
1144 | 23 | #include "marlincore-tests-gof.h" | ||
1145 | 24 | #include "marlincore-tests-file.h" | ||
1146 | 25 | #include "marlincore-tests-icon-info.h" | ||
1147 | 26 | #include "pantheon-files-core.h" | ||
1148 | 27 | |||
1149 | 28 | int main (int argc, char* argv[]) | ||
1150 | 29 | { | ||
1151 | 30 | g_test_init (&argc, &argv, NULL); | ||
1152 | 31 | |||
1153 | 32 | g_test_add_func("/marlin/file", marlincore_tests_file); | ||
1154 | 33 | g_test_add_func("/marlin/goffile", marlincore_tests_goffile); | ||
1155 | 34 | /* only used for local tests with local files */ | ||
1156 | 35 | g_test_add_func ("/marlin/icon_info", marlincore_tests_icon_info); | ||
1157 | 36 | |||
1158 | 37 | return g_test_run(); | ||
1159 | 38 | } |
I'm concerned that `enable_testing ()` appears 6 times in this diff, are you certain it's needed more than once?