Merge lp:~michihenning/storage-framework/remove-gio-dep into lp:storage-framework/devel
- remove-gio-dep
- Merge into devel
Status: | Merged |
---|---|
Approved by: | James Henstridge |
Approved revision: | 120 |
Merged at revision: | 122 |
Proposed branch: | lp:~michihenning/storage-framework/remove-gio-dep |
Merge into: | lp:storage-framework/devel |
Diff against target: |
331 lines (+45/-62) 9 files modified
CMakeLists.txt (+0/-1) debian/changelog (+2/-1) demo/provider_test/provider-test.cpp (+9/-9) src/local-provider/CMakeLists.txt (+0/-2) src/local-provider/LocalProvider.cpp (+17/-35) src/local-provider/LocalProvider.h (+4/-0) src/provider/internal/PendingJobs.cpp (+5/-0) tests/local-provider/local-provider_test.cpp (+6/-13) tests/registry/registry_test.cpp (+2/-1) |
To merge this branch: | bzr merge lp:~michihenning/storage-framework/remove-gio-dep |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Henstridge | Approve | ||
unity-api-1-bot | continuous-integration | Approve | |
Review via email: mp+320762@code.launchpad.net |
Commit message
Removed dependency on libgio by using QMimeDatabase to detect content type.
Fixed a bunch of compiler warnings on zesty.
Description of the change
Removed dependency on libgio by using QMimeDatabase to detect content type.
Fixed a bunch of compiler warnings on zesty.
unity-api-1-bot (unity-api-1-bot) wrote : | # |
- 120. By Michi Henning
-
Merged devel and updated changelog.
unity-api-1-bot (unity-api-1-bot) wrote : | # |
PASSED: Continuous integration, rev:120
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2017-03-29 05:53:32 +0000 | |||
3 | +++ CMakeLists.txt 2017-03-30 00:57:41 +0000 | |||
4 | @@ -123,7 +123,6 @@ | |||
5 | 123 | 123 | ||
6 | 124 | include(FindPkgConfig) | 124 | include(FindPkgConfig) |
7 | 125 | pkg_check_modules(APPARMOR_DEPS REQUIRED libapparmor) | 125 | pkg_check_modules(APPARMOR_DEPS REQUIRED libapparmor) |
8 | 126 | pkg_check_modules(GIO_DEPS REQUIRED gio-2.0 gio-unix-2.0) | ||
9 | 127 | pkg_check_modules(GLIB_DEPS REQUIRED glib-2.0) | 126 | pkg_check_modules(GLIB_DEPS REQUIRED glib-2.0) |
10 | 128 | pkg_check_modules(ONLINEACCOUNTS_DEPS REQUIRED OnlineAccountsQt) | 127 | pkg_check_modules(ONLINEACCOUNTS_DEPS REQUIRED OnlineAccountsQt) |
11 | 129 | 128 | ||
12 | 130 | 129 | ||
13 | === modified file 'debian/changelog' | |||
14 | --- debian/changelog 2017-03-29 02:22:03 +0000 | |||
15 | +++ debian/changelog 2017-03-30 00:57:41 +0000 | |||
16 | @@ -1,6 +1,7 @@ | |||
17 | 1 | storage-framework (0.4+17.04.20170320.1-0ubuntu2) UNRELEASED; urgency=medium | 1 | storage-framework (0.4+17.04.20170320.1-0ubuntu2) UNRELEASED; urgency=medium |
18 | 2 | 2 | ||
20 | 3 | * | 3 | [ Michi Henning ] |
21 | 4 | * Removed dependency on libgio. | ||
22 | 4 | 5 | ||
23 | 5 | -- Michi Henning <michi.henning@canonical.com> Wed, 29 Mar 2017 12:21:40 +1000 | 6 | -- Michi Henning <michi.henning@canonical.com> Wed, 29 Mar 2017 12:21:40 +1000 |
24 | 6 | 7 | ||
25 | 7 | 8 | ||
26 | === modified file 'demo/provider_test/provider-test.cpp' | |||
27 | --- demo/provider_test/provider-test.cpp 2017-03-16 03:30:18 +0000 | |||
28 | +++ demo/provider_test/provider-test.cpp 2017-03-30 00:57:41 +0000 | |||
29 | @@ -99,7 +99,7 @@ | |||
30 | 99 | { | 99 | { |
31 | 100 | } | 100 | } |
32 | 101 | 101 | ||
34 | 102 | boost::future<ItemList> MyProvider::roots(vector<string> const& keys, Context const& ctx) | 102 | boost::future<ItemList> MyProvider::roots(vector<string> const& /* keys */, Context const& ctx) |
35 | 103 | { | 103 | { |
36 | 104 | printf("roots() called by %s (%d)\n", ctx.security_label.c_str(), ctx.pid); | 104 | printf("roots() called by %s (%d)\n", ctx.security_label.c_str(), ctx.pid); |
37 | 105 | fflush(stdout); | 105 | fflush(stdout); |
38 | @@ -110,7 +110,7 @@ | |||
39 | 110 | } | 110 | } |
40 | 111 | 111 | ||
41 | 112 | boost::future<tuple<ItemList,string>> MyProvider::list( | 112 | boost::future<tuple<ItemList,string>> MyProvider::list( |
43 | 113 | string const& item_id, string const& page_token, vector<string> const& keys, | 113 | string const& item_id, string const& page_token, vector<string> const& /* keys */, |
44 | 114 | Context const& ctx) | 114 | Context const& ctx) |
45 | 115 | { | 115 | { |
46 | 116 | printf("list('%s', '%s') called by %s (%d)\n", item_id.c_str(), page_token.c_str(), ctx.security_label.c_str(), ctx.pid); | 116 | printf("list('%s', '%s') called by %s (%d)\n", item_id.c_str(), page_token.c_str(), ctx.security_label.c_str(), ctx.pid); |
47 | @@ -138,7 +138,7 @@ | |||
48 | 138 | } | 138 | } |
49 | 139 | 139 | ||
50 | 140 | boost::future<ItemList> MyProvider::lookup( | 140 | boost::future<ItemList> MyProvider::lookup( |
52 | 141 | string const& parent_id, string const& name, vector<string> const& keys, Context const& ctx) | 141 | string const& parent_id, string const& name, vector<string> const& /* keys */, Context const& ctx) |
53 | 142 | { | 142 | { |
54 | 143 | printf("lookup('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid); | 143 | printf("lookup('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid); |
55 | 144 | fflush(stdout); | 144 | fflush(stdout); |
56 | @@ -161,7 +161,7 @@ | |||
57 | 161 | } | 161 | } |
58 | 162 | 162 | ||
59 | 163 | boost::future<Item> MyProvider::metadata(string const& item_id, | 163 | boost::future<Item> MyProvider::metadata(string const& item_id, |
61 | 164 | vector<string> const& keys, | 164 | vector<string> const& /* keys */, |
62 | 165 | Context const& ctx) | 165 | Context const& ctx) |
63 | 166 | { | 166 | { |
64 | 167 | printf("metadata('%s') called by %s (%d)\n", item_id.c_str(), ctx.security_label.c_str(), ctx.pid); | 167 | printf("metadata('%s') called by %s (%d)\n", item_id.c_str(), ctx.security_label.c_str(), ctx.pid); |
65 | @@ -189,7 +189,7 @@ | |||
66 | 189 | } | 189 | } |
67 | 190 | 190 | ||
68 | 191 | boost::future<Item> MyProvider::create_folder( | 191 | boost::future<Item> MyProvider::create_folder( |
70 | 192 | string const& parent_id, string const& name, vector<string> const& keys, | 192 | string const& parent_id, string const& name, vector<string> const& /* keys */, |
71 | 193 | Context const& ctx) | 193 | Context const& ctx) |
72 | 194 | { | 194 | { |
73 | 195 | printf("create_folder('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid); | 195 | printf("create_folder('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid); |
74 | @@ -206,7 +206,7 @@ | |||
75 | 206 | 206 | ||
76 | 207 | boost::future<unique_ptr<UploadJob>> MyProvider::create_file( | 207 | boost::future<unique_ptr<UploadJob>> MyProvider::create_file( |
77 | 208 | string const& parent_id, string const& name, | 208 | string const& parent_id, string const& name, |
79 | 209 | int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys, | 209 | int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& /* keys */, |
80 | 210 | Context const& ctx) | 210 | Context const& ctx) |
81 | 211 | { | 211 | { |
82 | 212 | printf("create_file('%s', '%s', %" PRId64 ", '%s', %d) called by %s (%d)\n", parent_id.c_str(), name.c_str(), size, content_type.c_str(), allow_overwrite, ctx.security_label.c_str(), ctx.pid); | 212 | printf("create_file('%s', '%s', %" PRId64 ", '%s', %d) called by %s (%d)\n", parent_id.c_str(), name.c_str(), size, content_type.c_str(), allow_overwrite, ctx.security_label.c_str(), ctx.pid); |
83 | @@ -215,7 +215,7 @@ | |||
84 | 215 | } | 215 | } |
85 | 216 | 216 | ||
86 | 217 | boost::future<unique_ptr<UploadJob>> MyProvider::update( | 217 | boost::future<unique_ptr<UploadJob>> MyProvider::update( |
88 | 218 | string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys, Context const& ctx) | 218 | string const& item_id, int64_t size, string const& old_etag, vector<string> const& /* keys */, Context const& ctx) |
89 | 219 | { | 219 | { |
90 | 220 | printf("update('%s', %" PRId64 ", '%s') called by %s (%d)\n", item_id.c_str(), size, old_etag.c_str(), ctx.security_label.c_str(), ctx.pid); | 220 | printf("update('%s', %" PRId64 ", '%s') called by %s (%d)\n", item_id.c_str(), size, old_etag.c_str(), ctx.security_label.c_str(), ctx.pid); |
91 | 221 | fflush(stdout); | 221 | fflush(stdout); |
92 | @@ -250,7 +250,7 @@ | |||
93 | 250 | 250 | ||
94 | 251 | boost::future<Item> MyProvider::move( | 251 | boost::future<Item> MyProvider::move( |
95 | 252 | string const& item_id, string const& new_parent_id, | 252 | string const& item_id, string const& new_parent_id, |
97 | 253 | string const& new_name, vector<string> const& keys, Context const& ctx) | 253 | string const& new_name, vector<string> const& /* keys */, Context const& ctx) |
98 | 254 | { | 254 | { |
99 | 255 | printf("move('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid); | 255 | printf("move('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid); |
100 | 256 | fflush(stdout); | 256 | fflush(stdout); |
101 | @@ -260,7 +260,7 @@ | |||
102 | 260 | 260 | ||
103 | 261 | boost::future<Item> MyProvider::copy( | 261 | boost::future<Item> MyProvider::copy( |
104 | 262 | string const& item_id, string const& new_parent_id, | 262 | string const& item_id, string const& new_parent_id, |
106 | 263 | string const& new_name, vector<string> const& keys, Context const& ctx) | 263 | string const& new_name, vector<string> const& /* keys */, Context const& ctx) |
107 | 264 | { | 264 | { |
108 | 265 | printf("copy('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid); | 265 | printf("copy('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid); |
109 | 266 | fflush(stdout); | 266 | fflush(stdout); |
110 | 267 | 267 | ||
111 | === modified file 'src/local-provider/CMakeLists.txt' | |||
112 | --- src/local-provider/CMakeLists.txt 2017-03-17 04:59:44 +0000 | |||
113 | +++ src/local-provider/CMakeLists.txt 2017-03-30 00:57:41 +0000 | |||
114 | @@ -10,7 +10,6 @@ | |||
115 | 10 | target_include_directories(local-provider-lib PRIVATE | 10 | target_include_directories(local-provider-lib PRIVATE |
116 | 11 | ${Qt5Network_INCLUDE_DIRS} | 11 | ${Qt5Network_INCLUDE_DIRS} |
117 | 12 | ${GLIB_DEPS_INCLUDE_DIRS} | 12 | ${GLIB_DEPS_INCLUDE_DIRS} |
118 | 13 | ${GIO_DEPS_INCLUDE_DIRS} | ||
119 | 14 | ) | 13 | ) |
120 | 15 | 14 | ||
121 | 16 | set_target_properties(local-provider-lib PROPERTIES | 15 | set_target_properties(local-provider-lib PROPERTIES |
122 | @@ -27,7 +26,6 @@ | |||
123 | 27 | storage-framework-provider | 26 | storage-framework-provider |
124 | 28 | Qt5::Network | 27 | Qt5::Network |
125 | 29 | ${GLIB_DEPS_LIBRARIES} | 28 | ${GLIB_DEPS_LIBRARIES} |
126 | 30 | ${GIO_DEPS_LIBRARIES} | ||
127 | 31 | ) | 29 | ) |
128 | 32 | 30 | ||
129 | 33 | install( | 31 | install( |
130 | 34 | 32 | ||
131 | === modified file 'src/local-provider/LocalProvider.cpp' | |||
132 | --- src/local-provider/LocalProvider.cpp 2017-03-17 04:59:44 +0000 | |||
133 | +++ src/local-provider/LocalProvider.cpp 2017-03-30 00:57:41 +0000 | |||
134 | @@ -27,12 +27,6 @@ | |||
135 | 27 | 27 | ||
136 | 28 | #include <boost/algorithm/string.hpp> | 28 | #include <boost/algorithm/string.hpp> |
137 | 29 | 29 | ||
138 | 30 | #pragma GCC diagnostic push | ||
139 | 31 | #pragma GCC diagnostic ignored "-Wold-style-cast" | ||
140 | 32 | #include <gio/gio.h> | ||
141 | 33 | #include <glib.h> | ||
142 | 34 | #pragma GCC diagnostic pop | ||
143 | 35 | |||
144 | 36 | using namespace unity::storage::provider; | 30 | using namespace unity::storage::provider; |
145 | 37 | using namespace std; | 31 | using namespace std; |
146 | 38 | 32 | ||
147 | @@ -141,34 +135,6 @@ | |||
148 | 141 | return buf; | 135 | return buf; |
149 | 142 | } | 136 | } |
150 | 143 | 137 | ||
151 | 144 | string get_content_type(string const& filename) | ||
152 | 145 | { | ||
153 | 146 | using namespace unity::storage::internal; | ||
154 | 147 | |||
155 | 148 | static string const unknown_content_type = "application/octet-stream"; | ||
156 | 149 | |||
157 | 150 | gobj_ptr<GFile> file(g_file_new_for_path(filename.c_str())); | ||
158 | 151 | assert(file); // Cannot fail according to doc. | ||
159 | 152 | |||
160 | 153 | GError* err = nullptr; | ||
161 | 154 | gobj_ptr<GFileInfo> full_info(g_file_query_info(file.get(), | ||
162 | 155 | G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, | ||
163 | 156 | G_FILE_QUERY_INFO_NONE, | ||
164 | 157 | /* cancellable */ NULL, | ||
165 | 158 | &err)); | ||
166 | 159 | if (!full_info) | ||
167 | 160 | { | ||
168 | 161 | return unknown_content_type; // LCOV_EXCL_LINE | ||
169 | 162 | } | ||
170 | 163 | |||
171 | 164 | string content_type = g_file_info_get_attribute_string(full_info.get(), G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE); | ||
172 | 165 | if (content_type.empty()) | ||
173 | 166 | { | ||
174 | 167 | return unknown_content_type; // LCOV_EXCL_LINE | ||
175 | 168 | } | ||
176 | 169 | return content_type; | ||
177 | 170 | } | ||
178 | 171 | |||
179 | 172 | // Simple wrapper template that deals with exception handling so we don't | 138 | // Simple wrapper template that deals with exception handling so we don't |
180 | 173 | // have to repeat ourselves endlessly in the various lambdas below. | 139 | // have to repeat ourselves endlessly in the various lambdas below. |
181 | 174 | // The auto deduction of the return type requires C++ 14. | 140 | // The auto deduction of the return type requires C++ 14. |
182 | @@ -568,7 +534,7 @@ | |||
183 | 568 | meta.insert({USED_SPACE_BYTES, int64_t(info.capacity - info.available)}); | 534 | meta.insert({USED_SPACE_BYTES, int64_t(info.capacity - info.available)}); |
184 | 569 | 535 | ||
185 | 570 | meta.insert({LAST_MODIFIED_TIME, iso_mtime}); | 536 | meta.insert({LAST_MODIFIED_TIME, iso_mtime}); |
187 | 571 | meta.insert({CONTENT_TYPE, get_content_type(item_id)}); | 537 | meta.insert({CONTENT_TYPE, get_content_type(item_id, type)}); |
188 | 572 | 538 | ||
189 | 573 | auto perms = st.permissions(); | 539 | auto perms = st.permissions(); |
190 | 574 | bool writable; | 540 | bool writable; |
191 | @@ -584,3 +550,19 @@ | |||
192 | 584 | 550 | ||
193 | 585 | return Item{ item_id, parents, name, etag, type, meta }; | 551 | return Item{ item_id, parents, name, etag, type, meta }; |
194 | 586 | } | 552 | } |
195 | 553 | |||
196 | 554 | string LocalProvider::get_content_type(string const& filename, unity::storage::ItemType type) const | ||
197 | 555 | { | ||
198 | 556 | if (type != unity::storage::ItemType::file) | ||
199 | 557 | { | ||
200 | 558 | return "inode/directory"; | ||
201 | 559 | } | ||
202 | 560 | |||
203 | 561 | auto mime_type = mime_db_.mimeTypeForFile(QString::fromStdString(filename), QMimeDatabase::MatchExtension); | ||
204 | 562 | if (!mime_type.isValid()) | ||
205 | 563 | { | ||
206 | 564 | return "application/octet-stream"; // LCOV_EXCL_LINE | ||
207 | 565 | } | ||
208 | 566 | |||
209 | 567 | return mime_type.name().toStdString(); | ||
210 | 568 | } | ||
211 | 587 | 569 | ||
212 | === modified file 'src/local-provider/LocalProvider.h' | |||
213 | --- src/local-provider/LocalProvider.h 2017-03-14 07:11:40 +0000 | |||
214 | +++ src/local-provider/LocalProvider.h 2017-03-30 00:57:41 +0000 | |||
215 | @@ -21,6 +21,7 @@ | |||
216 | 21 | #include <unity/storage/provider/ProviderBase.h> | 21 | #include <unity/storage/provider/ProviderBase.h> |
217 | 22 | 22 | ||
218 | 23 | #include <boost/filesystem.hpp> | 23 | #include <boost/filesystem.hpp> |
219 | 24 | #include <QMimeDatabase> | ||
220 | 24 | 25 | ||
221 | 25 | class LocalProvider : public unity::storage::provider::ProviderBase | 26 | class LocalProvider : public unity::storage::provider::ProviderBase |
222 | 26 | { | 27 | { |
223 | @@ -80,5 +81,8 @@ | |||
224 | 80 | boost::filesystem::file_status const& st) const; | 81 | boost::filesystem::file_status const& st) const; |
225 | 81 | 82 | ||
226 | 82 | private: | 83 | private: |
227 | 84 | std::string get_content_type(std::string const& filename, unity::storage::ItemType type) const; | ||
228 | 85 | |||
229 | 83 | boost::filesystem::path const root_; | 86 | boost::filesystem::path const root_; |
230 | 87 | QMimeDatabase mime_db_; | ||
231 | 84 | }; | 88 | }; |
232 | 85 | 89 | ||
233 | === modified file 'src/provider/internal/PendingJobs.cpp' | |||
234 | --- src/provider/internal/PendingJobs.cpp 2016-09-06 04:41:17 +0000 | |||
235 | +++ src/provider/internal/PendingJobs.cpp 2017-03-30 00:57:41 +0000 | |||
236 | @@ -175,6 +175,9 @@ | |||
237 | 175 | } | 175 | } |
238 | 176 | } | 176 | } |
239 | 177 | 177 | ||
240 | 178 | #pragma GCC diagnostic push | ||
241 | 179 | #pragma GCC diagnostic ignored "-Wattributes" | ||
242 | 180 | |||
243 | 178 | template<typename Job> | 181 | template<typename Job> |
244 | 179 | void PendingJobs::cancel_job(shared_ptr<Job> const& job, string const& identifier) | 182 | void PendingJobs::cancel_job(shared_ptr<Job> const& job, string const& identifier) |
245 | 180 | { | 183 | { |
246 | @@ -203,6 +206,8 @@ | |||
247 | 203 | }); | 206 | }); |
248 | 204 | } | 207 | } |
249 | 205 | 208 | ||
250 | 209 | #pragma GCC diagnostic pop | ||
251 | 210 | |||
252 | 206 | } | 211 | } |
253 | 207 | } | 212 | } |
254 | 208 | } | 213 | } |
255 | 209 | 214 | ||
256 | === modified file 'tests/local-provider/local-provider_test.cpp' | |||
257 | --- tests/local-provider/local-provider_test.cpp 2017-03-17 07:06:29 +0000 | |||
258 | +++ tests/local-provider/local-provider_test.cpp 2017-03-30 00:57:41 +0000 | |||
259 | @@ -259,12 +259,12 @@ | |||
260 | 259 | ASSERT_EQ(5, root.metadata().size()); | 259 | ASSERT_EQ(5, root.metadata().size()); |
261 | 260 | auto free_space_bytes = root.metadata().value("free_space_bytes").toULongLong(); | 260 | auto free_space_bytes = root.metadata().value("free_space_bytes").toULongLong(); |
262 | 261 | cout << "free_space_bytes: " << free_space_bytes << endl; | 261 | cout << "free_space_bytes: " << free_space_bytes << endl; |
264 | 262 | EXPECT_GT(free_space_bytes, 0); | 262 | EXPECT_GT(free_space_bytes, uint64_t(0)); |
265 | 263 | auto used_space_bytes = root.metadata().value("used_space_bytes").toULongLong(); | 263 | auto used_space_bytes = root.metadata().value("used_space_bytes").toULongLong(); |
266 | 264 | cout << "used_space_bytes: " << used_space_bytes << endl; | 264 | cout << "used_space_bytes: " << used_space_bytes << endl; |
268 | 265 | EXPECT_GT(used_space_bytes, 0); | 265 | EXPECT_GT(used_space_bytes, uint64_t(0)); |
269 | 266 | auto content_type = root.metadata().value("content_type").toString(); | 266 | auto content_type = root.metadata().value("content_type").toString(); |
271 | 267 | EXPECT_EQ("inode/directory", content_type); | 267 | EXPECT_EQ("inode/directory", content_type.toStdString()); |
272 | 268 | auto writable = root.metadata().value("writable").toBool(); | 268 | auto writable = root.metadata().value("writable").toBool(); |
273 | 269 | EXPECT_TRUE(writable); | 269 | EXPECT_TRUE(writable); |
274 | 270 | 270 | ||
275 | @@ -336,7 +336,7 @@ | |||
276 | 336 | Item child = job->item(); | 336 | Item child = job->item(); |
277 | 337 | unique_ptr<VoidJob> delete_job(child.deleteItem()); | 337 | unique_ptr<VoidJob> delete_job(child.deleteItem()); |
278 | 338 | wait(delete_job.get()); | 338 | wait(delete_job.get()); |
280 | 339 | ASSERT_EQ(ItemJob::Finished, delete_job->status()) << delete_job->error().errorString().toStdString(); | 339 | ASSERT_EQ(VoidJob::Finished, delete_job->status()) << delete_job->error().errorString().toStdString(); |
281 | 340 | 340 | ||
282 | 341 | struct stat st; | 341 | struct stat st; |
283 | 342 | ASSERT_EQ(-1, stat(child.itemId().toStdString().c_str(), &st)); | 342 | ASSERT_EQ(-1, stat(child.itemId().toStdString().c_str(), &st)); |
284 | @@ -383,7 +383,7 @@ | |||
285 | 383 | 383 | ||
286 | 384 | auto fut = p->metadata(ROOT_DIR(), {}, provider::Context()); | 384 | auto fut = p->metadata(ROOT_DIR(), {}, provider::Context()); |
287 | 385 | auto item = fut.get(); | 385 | auto item = fut.get(); |
289 | 386 | EXPECT_EQ(5, item.metadata.size()); | 386 | EXPECT_EQ(uint64_t(5), item.metadata.size()); |
290 | 387 | 387 | ||
291 | 388 | // Again, to get coverage for the "not file or folder" case in make_item(). | 388 | // Again, to get coverage for the "not file or folder" case in make_item(). |
292 | 389 | ASSERT_EQ(0, mknod((ROOT_DIR() + "/pipe").c_str(), S_IFIFO | 06666, 0)); | 389 | ASSERT_EQ(0, mknod((ROOT_DIR() + "/pipe").c_str(), S_IFIFO | 06666, 0)); |
293 | @@ -431,7 +431,7 @@ | |||
294 | 431 | 431 | ||
295 | 432 | job.reset(root.lookup("child")); | 432 | job.reset(root.lookup("child")); |
296 | 433 | wait(job.get()); | 433 | wait(job.get()); |
298 | 434 | EXPECT_EQ(ItemJob::Error, job->status()); | 434 | EXPECT_EQ(ItemListJob::Error, job->status()); |
299 | 435 | EXPECT_EQ(string("NotExists: lookup(): \"") + ROOT_DIR() + "/child\": boost::filesystem::canonical: " | 435 | EXPECT_EQ(string("NotExists: lookup(): \"") + ROOT_DIR() + "/child\": boost::filesystem::canonical: " |
300 | 436 | + "No such file or directory: \"" + ROOT_DIR() + "/child\"", | 436 | + "No such file or directory: \"" + ROOT_DIR() + "/child\"", |
301 | 437 | job->error().errorString().toStdString()); | 437 | job->error().errorString().toStdString()); |
302 | @@ -1456,13 +1456,6 @@ | |||
303 | 1456 | { | 1456 | { |
304 | 1457 | setenv("LANG", "C", true); | 1457 | setenv("LANG", "C", true); |
305 | 1458 | 1458 | ||
306 | 1459 | // Test test fixture repeatedly creates and tears down the dbus connection. | ||
307 | 1460 | // The provider calls g_file_new_for_path() which talks to the GVfs backend | ||
308 | 1461 | // via dbus. If the dbus connection disappears, that causes GIO to send a | ||
309 | 1462 | // a SIGTERM, killing the test. | ||
310 | 1463 | // Setting GIO_USE_VFS variable to "local" disables sending the signal. | ||
311 | 1464 | setenv("GIO_USE_VFS", "local", true); | ||
312 | 1465 | |||
313 | 1466 | QCoreApplication app(argc, argv); | 1459 | QCoreApplication app(argc, argv); |
314 | 1467 | 1460 | ||
315 | 1468 | ::testing::InitGoogleTest(&argc, argv); | 1461 | ::testing::InitGoogleTest(&argc, argv); |
316 | 1469 | 1462 | ||
317 | === modified file 'tests/registry/registry_test.cpp' | |||
318 | --- tests/registry/registry_test.cpp 2017-03-17 09:43:46 +0000 | |||
319 | +++ tests/registry/registry_test.cpp 2017-03-30 00:57:41 +0000 | |||
320 | @@ -27,9 +27,10 @@ | |||
321 | 27 | 27 | ||
322 | 28 | #pragma GCC diagnostic push | 28 | #pragma GCC diagnostic push |
323 | 29 | #pragma GCC diagnostic ignored "-Wold-style-cast" | 29 | #pragma GCC diagnostic ignored "-Wold-style-cast" |
324 | 30 | #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" | ||
325 | 30 | #include <glib.h> | 31 | #include <glib.h> |
326 | 32 | #include <gtest/gtest.h> | ||
327 | 31 | #pragma GCC diagnostic pop | 33 | #pragma GCC diagnostic pop |
328 | 32 | #include <gtest/gtest.h> | ||
329 | 33 | #include <QCoreApplication> | 34 | #include <QCoreApplication> |
330 | 34 | #include <QDBusConnection> | 35 | #include <QDBusConnection> |
331 | 35 | #include <QDBusMessage> | 36 | #include <QDBusMessage> |
PASSED: Continuous integration, rev:119 /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/270/ /jenkins. canonical. com/unity- api-1/job/ build/1857 /jenkins. canonical. com/unity- api-1/job/ build-0- fetch/1864 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1640 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1640/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= zesty/1640 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= zesty/1640/ artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1640 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1640/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= zesty/1640 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= zesty/1640/ artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1640 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1640/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= zesty/1640 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= zesty/1640/ artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/270/ rebuild
https:/