Merge lp:~marcustomlinson/unity-scopes-api/fix-clang-warnings into lp:unity-scopes-api/devel
- fix-clang-warnings
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Michi Henning |
Approved revision: | 648 |
Merged at revision: | 645 |
Proposed branch: | lp:~marcustomlinson/unity-scopes-api/fix-clang-warnings |
Merge into: | lp:unity-scopes-api/devel |
Diff against target: |
604 lines (+53/-84) 22 files modified
include/unity/scopes/internal/ScopeImpl.h (+1/-1) include/unity/scopes/internal/SettingsDB.h (+4/-14) src/scopes/internal/CannedQueryImpl.cpp (+1/-1) src/scopes/internal/Executor.cpp (+0/-2) src/scopes/internal/IniSettingsSchema.cpp (+2/-4) src/scopes/internal/OnlineAccountClientImpl.cpp (+1/-1) src/scopes/internal/PreviewReplyImpl.cpp (+1/-1) src/scopes/internal/PreviewReplyObject.cpp (+1/-1) src/scopes/internal/ReplyImpl.cpp (+1/-1) src/scopes/internal/RuntimeConfig.cpp (+5/-5) src/scopes/internal/RuntimeImpl.cpp (+3/-4) src/scopes/internal/SearchMetadataImpl.cpp (+2/-2) src/scopes/internal/SearchReplyImpl.cpp (+2/-2) src/scopes/internal/SettingsDB.cpp (+13/-22) src/scopes/internal/Utils.cpp (+1/-1) src/scopes/internal/smartscopes/SSRegistryObject.cpp (+1/-3) src/scopes/internal/smartscopes/SmartScope.cpp (+1/-1) src/scopes/internal/smartscopes/SmartScopesClient.cpp (+2/-2) src/scopes/internal/zmq_middleware/ZmqObject.cpp (+0/-2) test/gtest/scopes/StandAloneScope/SimpleScope.cpp (+0/-1) test/gtest/scopes/ThrowingClient/ThrowingClient_test.cpp (+1/-1) test/gtest/scopes/internal/SettingsDB/SettingsDB_test.cpp (+10/-12) |
To merge this branch: | bzr merge lp:~marcustomlinson/unity-scopes-api/fix-clang-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Michi Henning (community) | Approve | ||
Review via email: mp+278555@code.launchpad.net |
Commit message
Fixed Clang compiler warnings such as: missing "override" specifier, unused variables and functions, and other small bits of suspicious logic.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
Michi Henning (michihenning) wrote : | # |
+1, thanks for that!
It's amazing how line 150 of the diff slipped through. My left arm for a language with a sane type system… :-(
Line 191 of the diff needs to read:
make_directorie
We want to create the directories for the entire path, not just the top-level dir.
Unfortunately, it appears that all of this is a lost labour of love now, at least on Wily. I just tried compiling with clang 3.6.2 on Wily. It came up with a bunch more warnings, which I started to fix. Unfortunately, our code no longer links due to unresolved references to symbols in libjson and libunity-api. It looks like the inlining algorithms for gcc and clang have gone out of sync. gcc inlines things that clang doesn't and then the clang-compiled client code looks for a external symbols in these libraries that don't exist :-(
Still, building with clang is still useful on Vivid (while it lasts).
I'me also attaching a diff that fixes a bunch more warnings from clang 3.6.0 on Vivid+overlay. Could you apply that diff too please?
It's awfully easy to miss warnings with ccache enabled because a warning is emitted only once when a file is first compiled. If the file has no errors, all future builds are warning-free because the object file is taken from the cache…
Michi Henning (michihenning) wrote : | # |
Hmmm... Looks like it's impossible to add an attachment to an MR. I've uploaded the diff here:
https:/
Michi Henning (michihenning) wrote : | # |
Actually, it's not inlining, it's the abi tags in gcc. See here: https:/
The name mangling differs between clang and gcc, so the symbols are in the library, but with a different mangled name :(
- 647. By Marcus Tomlinson
-
Applied patch with further warning fixes
- 648. By Marcus Tomlinson
-
make_directorie
s(cache_ dir_ -> make_directorie s(dir
Marcus Tomlinson (marcustomlinson) wrote : | # |
> +1, thanks for that!
>
> It's amazing how line 150 of the diff slipped through. My left arm for a
> language with a sane type system… :-(
>
> Line 191 of the diff needs to read:
>
> make_directorie
done (line 251)
>
> We want to create the directories for the entire path, not just the top-level
> dir.
>
> Unfortunately, it appears that all of this is a lost labour of love now, at
> least on Wily. I just tried compiling with clang 3.6.2 on Wily. It came up
> with a bunch more warnings, which I started to fix. Unfortunately, our code no
> longer links due to unresolved references to symbols in libjson and libunity-
> api. It looks like the inlining algorithms for gcc and clang have gone out of
> sync. gcc inlines things that clang doesn't and then the clang-compiled client
> code looks for a external symbols in these libraries that don't exist :-(
>
> Still, building with clang is still useful on Vivid (while it lasts).
>
> I'me also attaching a diff that fixes a bunch more warnings from clang 3.6.0
> on Vivid+overlay. Could you apply that diff too please?
done.
>
> It's awfully easy to miss warnings with ccache enabled because a warning is
> emitted only once when a file is first compiled. If the file has no errors,
> all future builds are warning-free because the object file is taken from the
> cache…
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:648
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michi Henning (michihenning) wrote : | # |
Looks good!
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:648
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'include/unity/scopes/internal/ScopeImpl.h' |
2 | --- include/unity/scopes/internal/ScopeImpl.h 2015-05-29 10:17:42 +0000 |
3 | +++ include/unity/scopes/internal/ScopeImpl.h 2015-11-26 05:49:23 +0000 |
4 | @@ -103,7 +103,7 @@ |
5 | virtual QueryCtrlProxy activate_result_action(Result const& result, |
6 | ActionMetadata const& metadata, |
7 | std::string const& action_id, |
8 | - ActivationListenerBase::SPtr const& reply); |
9 | + ActivationListenerBase::SPtr const& reply) override; |
10 | |
11 | virtual ChildScopeList child_scopes() override; |
12 | virtual bool set_child_scopes(ChildScopeList const& child_scopes) override; |
13 | |
14 | === modified file 'include/unity/scopes/internal/SettingsDB.h' |
15 | --- include/unity/scopes/internal/SettingsDB.h 2015-07-13 14:28:15 +0000 |
16 | +++ include/unity/scopes/internal/SettingsDB.h 2015-11-26 05:49:23 +0000 |
17 | @@ -18,7 +18,6 @@ |
18 | |
19 | #pragma once |
20 | |
21 | -#include <unity/scopes/internal/Logger.h> |
22 | #include <unity/scopes/internal/SettingsSchema.h> |
23 | #include <unity/scopes/Variant.h> |
24 | #include <unity/util/DefinesPtrs.h> |
25 | @@ -47,15 +46,9 @@ |
26 | NONCOPYABLE(SettingsDB); |
27 | UNITY_DEFINES_PTRS(SettingsDB); |
28 | |
29 | - static UPtr create_from_ini_file(std::string const& db_path, |
30 | - std::string const& ini_file_path, |
31 | - boost::log::sources::severity_channel_logger_mt<>& logger); |
32 | - static UPtr create_from_json_string(std::string const& db_path, |
33 | - std::string const& json_string, |
34 | - boost::log::sources::severity_channel_logger_mt<>& logger); |
35 | - static UPtr create_from_schema(std::string const& db_path, |
36 | - unity::scopes::internal::SettingsSchema const& schema, |
37 | - boost::log::sources::severity_channel_logger_mt<>& logger); |
38 | + static UPtr create_from_ini_file(std::string const& db_path, std::string const& ini_file_path); |
39 | + static UPtr create_from_json_string(std::string const& db_path, std::string const& json_string); |
40 | + static UPtr create_from_schema(std::string const& db_path, unity::scopes::internal::SettingsSchema const& schema); |
41 | |
42 | ~SettingsDB() = default; |
43 | |
44 | @@ -65,9 +58,7 @@ |
45 | VariantMap settings(); // Returns the current settings (checking the DB each time). |
46 | |
47 | private: |
48 | - SettingsDB(std::string const& db_path, |
49 | - unity::scopes::internal::SettingsSchema const& schema, |
50 | - boost::log::sources::severity_channel_logger_mt<>& logger); |
51 | + SettingsDB(std::string const& db_path, unity::scopes::internal::SettingsSchema const& schema); |
52 | |
53 | void process_doc_(std::string const& id, unity::util::IniParser const& parer); |
54 | void process_all_docs(); |
55 | @@ -80,7 +71,6 @@ |
56 | VariantArray definitions_; // Returned by SettingsSchema |
57 | std::map<std::string, Variant> def_map_; // Allows fast access to the Variants in definitions_ |
58 | unity::scopes::VariantMap values_; |
59 | - boost::log::sources::severity_channel_logger_mt<>& logger_; |
60 | }; |
61 | |
62 | } // namespace internal |
63 | |
64 | === modified file 'src/scopes/internal/CannedQueryImpl.cpp' |
65 | --- src/scopes/internal/CannedQueryImpl.cpp 2015-02-26 12:47:37 +0000 |
66 | +++ src/scopes/internal/CannedQueryImpl.cpp 2015-11-26 05:49:23 +0000 |
67 | @@ -232,7 +232,7 @@ |
68 | { |
69 | return from_percent_encoding(value); |
70 | } |
71 | - catch (InvalidArgumentException const& e) |
72 | + catch (InvalidArgumentException const&) |
73 | { |
74 | std::stringstream err; |
75 | err << "Failed to decode key '" << key_name << "' of uri '" << uri << "'"; |
76 | |
77 | === modified file 'src/scopes/internal/Executor.cpp' |
78 | --- src/scopes/internal/Executor.cpp 2014-08-08 08:35:09 +0000 |
79 | +++ src/scopes/internal/Executor.cpp 2015-11-26 05:49:23 +0000 |
80 | @@ -49,10 +49,8 @@ |
81 | case ENOENT: |
82 | case EACCES: |
83 | throw std::runtime_error("AppArmor profile does not exist"); |
84 | - break; |
85 | case EINVAL: |
86 | throw std::runtime_error("AppArmor interface not available"); |
87 | - break; |
88 | default: |
89 | throw std::runtime_error("Unknown AppArmor error"); |
90 | } |
91 | |
92 | === modified file 'src/scopes/internal/IniSettingsSchema.cpp' |
93 | --- src/scopes/internal/IniSettingsSchema.cpp 2015-03-02 03:59:01 +0000 |
94 | +++ src/scopes/internal/IniSettingsSchema.cpp 2015-11-26 05:49:23 +0000 |
95 | @@ -56,8 +56,6 @@ |
96 | Variant const& default_value); |
97 | ~Setting() = default; |
98 | |
99 | - string id() const; |
100 | - |
101 | enum Type { BooleanT, ListT, NumberT, StringT }; |
102 | |
103 | Variant to_schema_definition(); |
104 | @@ -240,7 +238,7 @@ |
105 | } |
106 | } |
107 | } |
108 | - catch (LogicException const& e) |
109 | + catch (LogicException const&) |
110 | { |
111 | throw ResourceException(string("IniSettingsSchema(): invalid value type for \"") + dflt_val_key + "\" definition, " |
112 | "setting = \"" + id_ + "\""); |
113 | @@ -276,7 +274,7 @@ |
114 | definitions_.push_back(s.to_schema_definition()); |
115 | } |
116 | } |
117 | - catch (std::exception const& e) |
118 | + catch (std::exception const&) |
119 | { |
120 | throw ResourceException("IniSettingsSchema(): cannot parse settings file \"" + ini_file + "\""); |
121 | } |
122 | |
123 | === modified file 'src/scopes/internal/OnlineAccountClientImpl.cpp' |
124 | --- src/scopes/internal/OnlineAccountClientImpl.cpp 2015-01-26 06:02:10 +0000 |
125 | +++ src/scopes/internal/OnlineAccountClientImpl.cpp 2015-11-26 05:49:23 +0000 |
126 | @@ -653,7 +653,7 @@ |
127 | g_main_loop_run(main_loop_.get()); |
128 | } |
129 | // LCOV_EXCL_START |
130 | - catch (std::exception const& e) |
131 | + catch (std::exception const&) |
132 | { |
133 | std::lock_guard<std::mutex> lock(mutex_); |
134 | thread_exception_ = std::current_exception(); |
135 | |
136 | === modified file 'src/scopes/internal/PreviewReplyImpl.cpp' |
137 | --- src/scopes/internal/PreviewReplyImpl.cpp 2015-01-09 03:16:51 +0000 |
138 | +++ src/scopes/internal/PreviewReplyImpl.cpp 2015-11-26 05:49:23 +0000 |
139 | @@ -52,7 +52,7 @@ |
140 | { |
141 | ColumnLayoutImpl::validate_layouts(layouts); |
142 | } |
143 | - catch (unity::LogicException const &e) |
144 | + catch (unity::LogicException const&) |
145 | { |
146 | throw unity::LogicException("PreviewReplyImpl::register_layout(): Failed to validate layouts"); |
147 | } |
148 | |
149 | === modified file 'src/scopes/internal/PreviewReplyObject.cpp' |
150 | --- src/scopes/internal/PreviewReplyObject.cpp 2014-11-18 07:04:04 +0000 |
151 | +++ src/scopes/internal/PreviewReplyObject.cpp 2015-11-26 05:49:23 +0000 |
152 | @@ -67,7 +67,7 @@ |
153 | { |
154 | ColumnLayoutImpl::validate_layouts(list); |
155 | } |
156 | - catch (unity::LogicException const &e) |
157 | + catch (unity::LogicException const&) |
158 | { |
159 | throw unity::LogicException("PreviewReplyObject::process_data(): Failed to validate layouts"); |
160 | } |
161 | |
162 | === modified file 'src/scopes/internal/ReplyImpl.cpp' |
163 | --- src/scopes/internal/ReplyImpl.cpp 2015-02-04 06:07:15 +0000 |
164 | +++ src/scopes/internal/ReplyImpl.cpp 2015-11-26 05:49:23 +0000 |
165 | @@ -127,7 +127,7 @@ |
166 | { |
167 | fwd()->finished(CompletionDetails(CompletionDetails::Error, error_message)); // Oneway, can't block |
168 | } |
169 | - catch (std::exception const& e) |
170 | + catch (std::exception const&) |
171 | { |
172 | BOOST_LOG(mw_proxy_->mw_base()->runtime()->logger()) |
173 | << "ReplyImpl::error(): exception from finished(): " << error_message; |
174 | |
175 | === modified file 'src/scopes/internal/RuntimeConfig.cpp' |
176 | --- src/scopes/internal/RuntimeConfig.cpp 2015-06-11 07:17:56 +0000 |
177 | +++ src/scopes/internal/RuntimeConfig.cpp 2015-11-26 05:49:23 +0000 |
178 | @@ -108,7 +108,7 @@ |
179 | { |
180 | cache_directory_ = default_cache_directory(); |
181 | } |
182 | - catch (ResourceException const& e) |
183 | + catch (ResourceException const&) |
184 | { |
185 | throw_ex("No " + cache_dir_key + " configured and failed to get default"); |
186 | } |
187 | @@ -121,7 +121,7 @@ |
188 | { |
189 | app_directory_ = default_app_directory(); |
190 | } |
191 | - catch (ResourceException const& e) |
192 | + catch (ResourceException const&) |
193 | { |
194 | throw_ex("No " + app_dir_key + " configured and failed to get default"); |
195 | } |
196 | @@ -129,7 +129,7 @@ |
197 | |
198 | // UNITY_SCOPES_CONFIG_DIR env var can be used to override the value of ConfigDir key of Runtime.ini |
199 | char const* scopes_cfg_dir_override = getenv("UNITY_SCOPES_CONFIG_DIR"); |
200 | - config_directory_ = (scopes_cfg_dir_override != nullptr && scopes_cfg_dir_override != '\0') ? |
201 | + config_directory_ = (scopes_cfg_dir_override != nullptr && *scopes_cfg_dir_override != '\0') ? |
202 | string(scopes_cfg_dir_override) : get_optional_string(runtime_config_group, config_dir_key); |
203 | if (config_directory_.empty()) |
204 | { |
205 | @@ -137,7 +137,7 @@ |
206 | { |
207 | config_directory_ = default_config_directory(); |
208 | } |
209 | - catch (ResourceException const& e) |
210 | + catch (ResourceException const&) |
211 | { |
212 | throw_ex("No " + config_dir_key + " configured and failed to get default"); |
213 | } |
214 | @@ -155,7 +155,7 @@ |
215 | { |
216 | log_directory_ = default_log_directory(); |
217 | } |
218 | - catch (ResourceException const& e) |
219 | + catch (ResourceException const&) |
220 | { |
221 | throw_ex("No " + log_dir_key + " configured and failed to get default"); |
222 | } |
223 | |
224 | === modified file 'src/scopes/internal/RuntimeImpl.cpp' |
225 | --- src/scopes/internal/RuntimeImpl.cpp 2015-11-23 07:29:31 +0000 |
226 | +++ src/scopes/internal/RuntimeImpl.cpp 2015-11-26 05:49:23 +0000 |
227 | @@ -136,7 +136,7 @@ |
228 | app_dir_ = config.app_directory(); |
229 | config_dir_ = config.config_directory(); |
230 | } |
231 | - catch (unity::Exception const& e) |
232 | + catch (unity::Exception const&) |
233 | { |
234 | destroy(); |
235 | string msg = "Cannot instantiate run time for " + (scope_id.empty() ? "client" : scope_id) + |
236 | @@ -382,7 +382,7 @@ |
237 | boost::system::error_code ec; |
238 | if (boost::filesystem::exists(settings_schema, ec)) |
239 | { |
240 | - shared_ptr<SettingsDB> db(SettingsDB::create_from_ini_file(settings_db, settings_schema, logger())); |
241 | + shared_ptr<SettingsDB> db(SettingsDB::create_from_ini_file(settings_db, settings_schema)); |
242 | scope_base->p->set_settings_db(db); |
243 | } |
244 | else |
245 | @@ -594,8 +594,7 @@ |
246 | string dir = cache_dir_ + "/" + confinement_type(); |
247 | if (!confined()) // Avoid apparmor noise |
248 | { |
249 | - string dir = cache_dir_ + "/" + confinement_type(); |
250 | - make_directories(cache_dir_, 0700); |
251 | + make_directories(dir, 0700); |
252 | } |
253 | // A confined scope is allowed to create this dir. |
254 | dir += "/" + demangled_id(scope_id_); |
255 | |
256 | === modified file 'src/scopes/internal/SearchMetadataImpl.cpp' |
257 | --- src/scopes/internal/SearchMetadataImpl.cpp 2015-04-09 15:59:17 +0000 |
258 | +++ src/scopes/internal/SearchMetadataImpl.cpp 2015-11-26 05:49:23 +0000 |
259 | @@ -56,7 +56,7 @@ |
260 | it = find_or_throw("SearchMetadataImpl()", var, "location"); |
261 | location_ = Location(it->second.get_dict()); |
262 | } |
263 | - catch (std::exception &e) |
264 | + catch (std::exception const&) |
265 | { |
266 | } |
267 | |
268 | @@ -71,7 +71,7 @@ |
269 | } |
270 | aggregated_keywords_ = keywords_s; |
271 | } |
272 | - catch (std::exception &e) |
273 | + catch (std::exception const&) |
274 | { |
275 | } |
276 | } |
277 | |
278 | === modified file 'src/scopes/internal/SearchReplyImpl.cpp' |
279 | --- src/scopes/internal/SearchReplyImpl.cpp 2015-07-27 10:45:03 +0000 |
280 | +++ src/scopes/internal/SearchReplyImpl.cpp 2015-11-26 05:49:23 +0000 |
281 | @@ -72,7 +72,7 @@ |
282 | { |
283 | DepartmentImpl::validate_departments(parent, current_department_); |
284 | } |
285 | - catch (unity::LogicException const &e) |
286 | + catch (unity::LogicException const&) |
287 | { |
288 | throw unity::LogicException("SearchReplyImpl::register_departments(): Failed to validate departments"); |
289 | } |
290 | @@ -172,7 +172,7 @@ |
291 | { |
292 | internal::FilterBaseImpl::validate_filters(filters); |
293 | } |
294 | - catch (unity::LogicException const &e) |
295 | + catch (unity::LogicException const&) |
296 | { |
297 | throw unity::LogicException("SearchReplyImpl::push(): Failed to validate filters"); |
298 | } |
299 | |
300 | === modified file 'src/scopes/internal/SettingsDB.cpp' |
301 | --- src/scopes/internal/SettingsDB.cpp 2015-07-13 14:28:15 +0000 |
302 | +++ src/scopes/internal/SettingsDB.cpp 2015-11-26 05:49:23 +0000 |
303 | @@ -82,53 +82,44 @@ |
304 | |
305 | } // namespace |
306 | |
307 | -SettingsDB::UPtr SettingsDB::create_from_ini_file(string const& db_path, |
308 | - string const& ini_file_path, |
309 | - boost::log::sources::severity_channel_logger_mt<>& logger) |
310 | +SettingsDB::UPtr SettingsDB::create_from_ini_file(string const& db_path, string const& ini_file_path) |
311 | { |
312 | // Parse schema |
313 | try |
314 | { |
315 | SettingsSchema::UPtr schema = IniSettingsSchema::create(ini_file_path); |
316 | - return create_from_schema(db_path, *schema, logger); |
317 | + return create_from_schema(db_path, *schema); |
318 | } |
319 | - catch (exception const& e) |
320 | + catch (exception const&) |
321 | { |
322 | throw ResourceException("SettingsDB::create_from_ini_file(): schema = " + ini_file_path + ", db = " + db_path); |
323 | } |
324 | } |
325 | |
326 | -SettingsDB::UPtr SettingsDB::create_from_json_string(string const& db_path, |
327 | - string const& json_string, |
328 | - boost::log::sources::severity_channel_logger_mt<>& logger) |
329 | +SettingsDB::UPtr SettingsDB::create_from_json_string(string const& db_path, string const& json_string) |
330 | { |
331 | // Parse schema |
332 | try |
333 | { |
334 | auto schema = JsonSettingsSchema::create(json_string); |
335 | - return create_from_schema(db_path, *schema, logger); |
336 | + return create_from_schema(db_path, *schema); |
337 | } |
338 | - catch (exception const& e) |
339 | + catch (exception const&) |
340 | { |
341 | throw ResourceException("SettingsDB::create_from_json_string(): cannot parse schema, db = " + db_path); |
342 | } |
343 | } |
344 | |
345 | -SettingsDB::UPtr SettingsDB::create_from_schema(string const& db_path, |
346 | - SettingsSchema const& schema, |
347 | - boost::log::sources::severity_channel_logger_mt<>& logger) |
348 | +SettingsDB::UPtr SettingsDB::create_from_schema(string const& db_path, SettingsSchema const& schema) |
349 | { |
350 | - return UPtr(new SettingsDB(db_path, move(schema), logger)); |
351 | + return UPtr(new SettingsDB(db_path, move(schema))); |
352 | } |
353 | |
354 | -SettingsDB::SettingsDB(string const& db_path, |
355 | - SettingsSchema const& schema, |
356 | - boost::log::sources::severity_channel_logger_mt<>& logger) |
357 | +SettingsDB::SettingsDB(string const& db_path, SettingsSchema const& schema) |
358 | : db_path_(db_path) |
359 | , last_write_time_nsec_(-1) |
360 | , last_write_time_sec_(-1) |
361 | , last_write_inode_(0) |
362 | - , logger_(logger) |
363 | { |
364 | // Initialize the def_map_ so we can look things |
365 | // up quickly. |
366 | @@ -173,7 +164,7 @@ |
367 | { |
368 | values_[id] = Variant(stod(value)); |
369 | } |
370 | - catch (invalid_argument & e) |
371 | + catch (invalid_argument const&) |
372 | { |
373 | } |
374 | } |
375 | @@ -182,7 +173,7 @@ |
376 | values_[id] = Variant(p.get_string(GROUP_NAME, id)); |
377 | } |
378 | } |
379 | - catch (LogicException & e) |
380 | + catch (LogicException const&) |
381 | { |
382 | } |
383 | } |
384 | @@ -222,7 +213,7 @@ |
385 | { |
386 | if (e.error() == EACCES) // very unlikely; only if permissions changed after we acquired the lock |
387 | { |
388 | - throw e; |
389 | + throw; |
390 | } |
391 | throw ResourceException(e.what()); |
392 | } |
393 | @@ -244,7 +235,7 @@ |
394 | { |
395 | if (e.error() == EACCES) |
396 | { |
397 | - throw e; |
398 | + throw; |
399 | } |
400 | |
401 | // Failure in obtaining the lock shouldn't be reported to the scope, it's not fatal; |
402 | |
403 | === modified file 'src/scopes/internal/Utils.cpp' |
404 | --- src/scopes/internal/Utils.cpp 2015-09-15 07:36:09 +0000 |
405 | +++ src/scopes/internal/Utils.cpp 2015-11-26 05:49:23 +0000 |
406 | @@ -90,7 +90,7 @@ |
407 | result << static_cast<char>(k); |
408 | valid = true; |
409 | } |
410 | - catch (logic_error const& e) // covers both invalid_argument and out_of_range |
411 | + catch (logic_error const&) // covers both invalid_argument and out_of_range |
412 | { |
413 | stringstream err; |
414 | err << "from_percent_encoding(): unsupported conversion of '" << hexnum << "'"; |
415 | |
416 | === modified file 'src/scopes/internal/smartscopes/SSRegistryObject.cpp' |
417 | --- src/scopes/internal/smartscopes/SSRegistryObject.cpp 2015-01-20 08:25:39 +0000 |
418 | +++ src/scopes/internal/smartscopes/SSRegistryObject.cpp 2015-11-26 05:49:23 +0000 |
419 | @@ -324,9 +324,7 @@ |
420 | // Store both JSON (for internal comparison) and DB (for external use) |
421 | changed = true; |
422 | std::string settings_db = RuntimeConfig::default_config_directory() + "/" + scope.id + "/settings.ini"; |
423 | - SettingsDB::SPtr db(SettingsDB::create_from_schema(settings_db, |
424 | - *schema, |
425 | - middleware_->runtime()->logger())); |
426 | + SettingsDB::SPtr db(SettingsDB::create_from_schema(settings_db, *schema)); |
427 | settings_defs_[scope.id] = SSSettingsDef{settings, db, needs_location_data}; |
428 | } |
429 | } |
430 | |
431 | === modified file 'src/scopes/internal/smartscopes/SmartScope.cpp' |
432 | --- src/scopes/internal/smartscopes/SmartScope.cpp 2015-06-01 10:23:00 +0000 |
433 | +++ src/scopes/internal/smartscopes/SmartScope.cpp 2015-11-26 05:49:23 +0000 |
434 | @@ -117,7 +117,7 @@ |
435 | { |
436 | reply->register_category(category->id, category->title, category->icon, rdr); |
437 | } |
438 | - catch (std::exception const& e) |
439 | + catch (std::exception const&) |
440 | { |
441 | BOOST_LOG(this->ss_client_->logger()) |
442 | << "SmartScope: failed to register category: \"" << category->id |
443 | |
444 | === modified file 'src/scopes/internal/smartscopes/SmartScopesClient.cpp' |
445 | --- src/scopes/internal/smartscopes/SmartScopesClient.cpp 2015-11-02 05:24:35 +0000 |
446 | +++ src/scopes/internal/smartscopes/SmartScopesClient.cpp 2015-11-26 05:49:23 +0000 |
447 | @@ -339,7 +339,7 @@ |
448 | { |
449 | scope.keywords.emplace(keyword.get_string()); |
450 | } |
451 | - catch (unity::LogicException const& e) |
452 | + catch (unity::LogicException const&) |
453 | { |
454 | BOOST_LOG(logger_) |
455 | << "SmartScopesClient.get_remote_scopes(): Scope: \"" << scope.id |
456 | @@ -854,7 +854,7 @@ |
457 | query_result->wait(); |
458 | query_result->get(); // may throw on error |
459 | } |
460 | - catch (std::exception const& e) |
461 | + catch (std::exception const&) |
462 | { |
463 | BOOST_LOG(logger_) |
464 | << "SmartScopesClient.get_preview_results(): Failed to retrieve preview results for query " |
465 | |
466 | === modified file 'src/scopes/internal/zmq_middleware/ZmqObject.cpp' |
467 | --- src/scopes/internal/zmq_middleware/ZmqObject.cpp 2015-09-08 02:58:39 +0000 |
468 | +++ src/scopes/internal/zmq_middleware/ZmqObject.cpp 2015-11-26 05:49:23 +0000 |
469 | @@ -50,8 +50,6 @@ |
470 | std::mutex shared_mutex; |
471 | } |
472 | |
473 | -#define MONITOR_ENDPOINT "ipc:///tmp/scopes-monitor" |
474 | - |
475 | ZmqObjectProxy::ZmqObjectProxy(ZmqMiddleware* mw_base, |
476 | string const& endpoint, |
477 | string const& identity, |
478 | |
479 | === modified file 'test/gtest/scopes/StandAloneScope/SimpleScope.cpp' |
480 | --- test/gtest/scopes/StandAloneScope/SimpleScope.cpp 2015-08-05 05:14:14 +0000 |
481 | +++ test/gtest/scopes/StandAloneScope/SimpleScope.cpp 2015-11-26 05:49:23 +0000 |
482 | @@ -77,7 +77,6 @@ |
483 | PreviewQueryBase::UPtr EchoScope::preview(Result const& /* result */, ActionMetadata const& /* metadata */) |
484 | { |
485 | abort(); |
486 | - return nullptr; |
487 | } |
488 | |
489 | extern "C" |
490 | |
491 | === modified file 'test/gtest/scopes/ThrowingClient/ThrowingClient_test.cpp' |
492 | --- test/gtest/scopes/ThrowingClient/ThrowingClient_test.cpp 2015-02-06 06:33:23 +0000 |
493 | +++ test/gtest/scopes/ThrowingClient/ThrowingClient_test.cpp 2015-11-26 05:49:23 +0000 |
494 | @@ -100,7 +100,7 @@ |
495 | } |
496 | } |
497 | |
498 | - virtual void info(OperationInfo const& /* op_info */) |
499 | + virtual void info(OperationInfo const& /* op_info */) override |
500 | { |
501 | lock_guard<mutex> lock(mutex_); |
502 | |
503 | |
504 | === modified file 'test/gtest/scopes/internal/SettingsDB/SettingsDB_test.cpp' |
505 | --- test/gtest/scopes/internal/SettingsDB/SettingsDB_test.cpp 2015-09-09 04:50:11 +0000 |
506 | +++ test/gtest/scopes/internal/SettingsDB/SettingsDB_test.cpp 2015-11-26 05:49:23 +0000 |
507 | @@ -81,15 +81,13 @@ |
508 | ::close(fd); |
509 | } |
510 | |
511 | -BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(test_logger, boost::log::sources::severity_channel_logger_mt<>) |
512 | - |
513 | TEST(SettingsDB, basic) |
514 | { |
515 | auto schema = TEST_SRC_DIR "/schema.ini"; |
516 | |
517 | { |
518 | unlink(db_name.c_str()); |
519 | - auto db = SettingsDB::create_from_ini_file(db_name, schema, test_logger::get()); |
520 | + auto db = SettingsDB::create_from_ini_file(db_name, schema); |
521 | |
522 | // If db doesn't exist, default values are returned. |
523 | EXPECT_EQ(4, db->settings().size()); |
524 | @@ -165,7 +163,7 @@ |
525 | |
526 | // This schema does not specify a default value for location and unit. |
527 | auto schema = TEST_SRC_DIR "/no_default_schema.ini"; |
528 | - auto db = SettingsDB::create_from_ini_file(db_name, schema, test_logger::get()); |
529 | + auto db = SettingsDB::create_from_ini_file(db_name, schema); |
530 | |
531 | // Check that we now can see only the other two values. (DB doesn't exist yet.) |
532 | EXPECT_EQ(2, db->settings().size()); |
533 | @@ -188,7 +186,7 @@ |
534 | |
535 | // This schema does not specify a default value for location and unit. |
536 | auto schema = TEST_SRC_DIR "/no_default_schema.ini"; |
537 | - auto db = SettingsDB::create_from_ini_file(db_name, schema, test_logger::get()); |
538 | + auto db = SettingsDB::create_from_ini_file(db_name, schema); |
539 | |
540 | // Add records to supply the values. |
541 | write_db("db_loctemp.ini"); |
542 | @@ -218,7 +216,7 @@ |
543 | |
544 | { |
545 | unlink(db_name.c_str()); |
546 | - auto db = SettingsDB::create_from_ini_file(db_name, schema, test_logger::get()); |
547 | + auto db = SettingsDB::create_from_ini_file(db_name, schema); |
548 | |
549 | // If db doesn't exist, default values are returned. |
550 | EXPECT_EQ(1, db->settings().size()); |
551 | @@ -237,7 +235,7 @@ |
552 | |
553 | { |
554 | unlink(db_name.c_str()); |
555 | - auto db = SettingsDB::create_from_ini_file(db_name, schema, test_logger::get()); |
556 | + auto db = SettingsDB::create_from_ini_file(db_name, schema); |
557 | |
558 | // If db doesn't exist, default values are returned. |
559 | EXPECT_EQ(4, db->settings().size()); |
560 | @@ -288,7 +286,7 @@ |
561 | |
562 | { |
563 | unlink(db_name.c_str()); |
564 | - auto db = SettingsDB::create_from_json_string(db_name, ok_schema, test_logger::get()); |
565 | + auto db = SettingsDB::create_from_json_string(db_name, ok_schema); |
566 | |
567 | // If db doesn't exist, default values are returned. |
568 | EXPECT_EQ(1, db->settings().size()); |
569 | @@ -305,7 +303,7 @@ |
570 | { |
571 | try |
572 | { |
573 | - auto db = SettingsDB::create_from_ini_file("unused", "no_such_file", test_logger::get()); |
574 | + auto db = SettingsDB::create_from_ini_file("unused", "no_such_file"); |
575 | FAIL(); |
576 | } |
577 | catch (ResourceException const& e) |
578 | @@ -318,7 +316,7 @@ |
579 | |
580 | try |
581 | { |
582 | - auto db = SettingsDB::create_from_json_string("unused", "syntax error", test_logger::get()); |
583 | + auto db = SettingsDB::create_from_json_string("unused", "syntax error"); |
584 | FAIL(); |
585 | } |
586 | catch (ResourceException const& e) |
587 | @@ -334,7 +332,7 @@ |
588 | // Open DB that doesn't exist yet. |
589 | unlink(db_name.c_str()); |
590 | auto schema = TEST_SRC_DIR "/schema.ini"; |
591 | - auto db = SettingsDB::create_from_ini_file(db_name, schema, test_logger::get()); |
592 | + auto db = SettingsDB::create_from_ini_file(db_name, schema); |
593 | |
594 | // Add a record, which creates the DB |
595 | write_db("db_location.ini"); |
596 | @@ -363,7 +361,7 @@ |
597 | write_db("db_location_munich.ini"); |
598 | |
599 | auto schema = TEST_SRC_DIR "/schema.ini"; |
600 | - auto db = SettingsDB::create_from_ini_file(db_name, schema, test_logger::get()); |
601 | + auto db = SettingsDB::create_from_ini_file(db_name, schema); |
602 | |
603 | EXPECT_EQ(4, db->settings().size()); |
604 | EXPECT_EQ("Munich", db->settings()["locationSetting"].get_string()); |
PASSED: Continuous integration, rev:646 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- ci/1583/ jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- vivid-amd64- ci/192 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- vivid-armhf- ci/192 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- vivid-armhf- ci/192/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- vivid-i386- ci/192 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- xenial- amd64-ci/ 15 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- xenial- armhf-ci/ 15 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- xenial- armhf-ci/ 15/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- xenial- i386-ci/ 15
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- scopes- api-devel- ci/1583/ rebuild
http://