Merge lp:~michihenning/unity-scopes-api/remove-to_string into lp:unity-scopes-api
- remove-to_string
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Paweł Stołowski |
Approved revision: | 150 |
Merged at revision: | 153 |
Proposed branch: | lp:~michihenning/unity-scopes-api/remove-to_string |
Merge into: | lp:unity-scopes-api |
Diff against target: |
1113 lines (+211/-233) 15 files modified
scoperegistry/scoperegistry.cpp (+4/-8) scoperunner/scoperunner.cpp (+0/-9) test/gtest/scopes/Variant/Variant_test.cpp (+9/-9) test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp (+10/-10) test/gtest/scopes/internal/DynamicLoader/DynamicLoader_test.cpp (+4/-4) test/gtest/scopes/internal/MiddlewareFactory/MiddlewareFactory_test.cpp (+1/-1) test/gtest/scopes/internal/Reaper/Reaper_test.cpp (+6/-6) test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp (+5/-5) test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp (+12/-12) test/gtest/scopes/internal/RuntimeImpl/RuntimeImpl_test.cpp (+8/-8) test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp (+35/-35) test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp (+28/-28) test/gtest/scopes/internal/ThreadPool/ThreadPool_test.cpp (+2/-2) test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp (+50/-50) test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp (+37/-46) |
To merge this branch: | bzr merge lp:~michihenning/unity-scopes-api/remove-to_string |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paweł Stołowski (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+202982@code.launchpad.net |
Commit message
Replaced calls to to_string() with calls to what() for all
unity exceptions. The to_string() calls were a hangover
from the time when what() on unity::Exception only printed
the exception name, but not the full string.
Description of the change
Replaced calls to to_string() with calls to what() for all
unity exceptions. The to_string() calls were a hangover
from the time when what() on unity::Exception only printed
the exception name, but not the full string.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:150
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Paweł Stołowski (stolowski) wrote : | # |
Looks good! +1
Preview Diff
1 | === modified file 'scoperegistry/scoperegistry.cpp' |
2 | --- scoperegistry/scoperegistry.cpp 2014-01-17 08:06:47 +0000 |
3 | +++ scoperegistry/scoperegistry.cpp 2014-01-24 03:21:30 +0000 |
4 | @@ -97,7 +97,7 @@ |
5 | } |
6 | catch (FileException const& e) |
7 | { |
8 | - error("scope group config file ignored:\n" + e.to_string()); |
9 | + error(string("scope group config file ignored:\n") + e.what()); |
10 | continue; |
11 | } |
12 | |
13 | @@ -108,7 +108,7 @@ |
14 | } |
15 | catch (LogicException const& e) |
16 | { |
17 | - error("group file \"" + file + ": file ignored:\n" + e.to_string()); |
18 | + error("group file \"" + file + ": file ignored:\n" + e.what()); |
19 | continue; |
20 | } |
21 | |
22 | @@ -213,7 +213,7 @@ |
23 | } |
24 | catch (unity::Exception const& e) |
25 | { |
26 | - error("ignoring scope \"" + pair.first + "\": cannot create metadata: " + e.to_string()); |
27 | + error("ignoring scope \"" + pair.first + "\": cannot create metadata: " + e.what()); |
28 | } |
29 | } |
30 | } |
31 | @@ -323,7 +323,7 @@ |
32 | } |
33 | catch (unity::Exception const& e) |
34 | { |
35 | - error("ignoring scope \"" + scope_name + "\": configuration error:\n" + e.to_string()); |
36 | + error("ignoring scope \"" + scope_name + "\": configuration error:\n" + e.what()); |
37 | } |
38 | } |
39 | |
40 | @@ -379,10 +379,6 @@ |
41 | middleware->wait_for_shutdown(); |
42 | exit_status = 0; |
43 | } |
44 | - catch (unity::Exception const& e) |
45 | - { |
46 | - error(e.to_string()); |
47 | - } |
48 | catch (std::exception const& e) |
49 | { |
50 | error(e.what()); |
51 | |
52 | === modified file 'scoperunner/scoperunner.cpp' |
53 | --- scoperunner/scoperunner.cpp 2014-01-15 11:32:33 +0000 |
54 | +++ scoperunner/scoperunner.cpp 2014-01-24 03:21:30 +0000 |
55 | @@ -169,11 +169,6 @@ |
56 | it->second.t.join(); |
57 | it->second.f.get(); // This will throw if the thread terminated due to an exception |
58 | } |
59 | - catch (unity::Exception const& e) |
60 | - { |
61 | - error(e.to_string()); |
62 | - ++num_errors; |
63 | - } |
64 | catch (std::exception const& e) |
65 | { |
66 | error(e.what()); |
67 | @@ -216,10 +211,6 @@ |
68 | |
69 | exit_status = run_scopes(runtime_config, config_files); |
70 | } |
71 | - catch (unity::Exception const& e) |
72 | - { |
73 | - error(e.to_string()); |
74 | - } |
75 | catch (std::exception const& e) |
76 | { |
77 | error(e.what()); |
78 | |
79 | === modified file 'test/gtest/scopes/Variant/Variant_test.cpp' |
80 | --- test/gtest/scopes/Variant/Variant_test.cpp 2014-01-07 12:22:29 +0000 |
81 | +++ test/gtest/scopes/Variant/Variant_test.cpp 2014-01-24 03:21:30 +0000 |
82 | @@ -191,9 +191,9 @@ |
83 | } |
84 | catch (LogicException const& e) |
85 | { |
86 | - EXPECT_EQ("unity::LogicException: Variant does not contain a bool value:\n" |
87 | - " boost::bad_get: failed value get using boost::get", |
88 | - e.to_string()); |
89 | + EXPECT_STREQ("unity::LogicException: Variant does not contain a bool value:\n" |
90 | + " boost::bad_get: failed value get using boost::get", |
91 | + e.what()); |
92 | } |
93 | |
94 | try |
95 | @@ -204,9 +204,9 @@ |
96 | } |
97 | catch (LogicException const& e) |
98 | { |
99 | - EXPECT_EQ("unity::LogicException: Variant does not contain a string value:\n" |
100 | - " boost::bad_get: failed value get using boost::get", |
101 | - e.to_string()); |
102 | + EXPECT_STREQ("unity::LogicException: Variant does not contain a string value:\n" |
103 | + " boost::bad_get: failed value get using boost::get", |
104 | + e.what()); |
105 | } |
106 | |
107 | try |
108 | @@ -217,9 +217,9 @@ |
109 | } |
110 | catch (LogicException const& e) |
111 | { |
112 | - EXPECT_EQ("unity::LogicException: Variant does not contain an int value:\n" |
113 | - " boost::bad_get: failed value get using boost::get", |
114 | - e.to_string()); |
115 | + EXPECT_STREQ("unity::LogicException: Variant does not contain an int value:\n" |
116 | + " boost::bad_get: failed value get using boost::get", |
117 | + e.what()); |
118 | } |
119 | |
120 | } |
121 | |
122 | === modified file 'test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp' |
123 | --- test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-01-09 09:47:56 +0000 |
124 | +++ test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-01-24 03:21:30 +0000 |
125 | @@ -65,7 +65,7 @@ |
126 | } |
127 | catch (ConfigException const& e) |
128 | { |
129 | - EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": Illegal empty value for Empty", e.to_string()); |
130 | + EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal empty value for Empty", e.what()); |
131 | } |
132 | } |
133 | |
134 | @@ -81,9 +81,9 @@ |
135 | } |
136 | catch (ConfigException const& e) |
137 | { |
138 | - EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for Zmq.BadMiddleware: \"foo\": " |
139 | - "legal values are \"Zmq\" and \"REST\"", |
140 | - e.to_string()); |
141 | + EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for Zmq.BadMiddleware: \"foo\": " |
142 | + "legal values are \"Zmq\" and \"REST\"", |
143 | + e.what()); |
144 | } |
145 | try |
146 | { |
147 | @@ -92,9 +92,9 @@ |
148 | } |
149 | catch (ConfigException const& e) |
150 | { |
151 | - EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for REST.BadMiddleware: \"bar\": " |
152 | - "legal values are \"Zmq\" and \"REST\"", |
153 | - e.to_string()); |
154 | + EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for REST.BadMiddleware: \"bar\": " |
155 | + "legal values are \"Zmq\" and \"REST\"", |
156 | + e.what()); |
157 | } |
158 | } |
159 | |
160 | @@ -109,7 +109,7 @@ |
161 | } |
162 | catch (ConfigException const& e) |
163 | { |
164 | - EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": error", e.to_string()); |
165 | + EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": error", e.what()); |
166 | } |
167 | } |
168 | |
169 | @@ -121,7 +121,7 @@ |
170 | } |
171 | catch (FileException const& e) |
172 | { |
173 | - EXPECT_EQ("unity::FileException: Could not load ini file no_such_file: No such file or directory (errno = 4)", |
174 | - e.to_string()); |
175 | + EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file: No such file or directory (errno = 4)", |
176 | + e.what()); |
177 | } |
178 | } |
179 | |
180 | === modified file 'test/gtest/scopes/internal/DynamicLoader/DynamicLoader_test.cpp' |
181 | --- test/gtest/scopes/internal/DynamicLoader/DynamicLoader_test.cpp 2014-01-07 12:22:29 +0000 |
182 | +++ test/gtest/scopes/internal/DynamicLoader/DynamicLoader_test.cpp 2014-01-24 03:21:30 +0000 |
183 | @@ -74,7 +74,7 @@ |
184 | catch (unity::ResourceException const& e) |
185 | { |
186 | boost::regex r("unity::ResourceException: .*/libbadtestlib.so: undefined symbol: foo"); |
187 | - EXPECT_TRUE(boost::regex_match(e.to_string(), r)); |
188 | + EXPECT_TRUE(boost::regex_match(e.what(), r)); |
189 | } |
190 | } |
191 | |
192 | @@ -87,8 +87,8 @@ |
193 | } |
194 | catch (unity::ResourceException const& e) |
195 | { |
196 | - EXPECT_EQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory", |
197 | - e.to_string()); |
198 | + EXPECT_STREQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory", |
199 | + e.what()); |
200 | } |
201 | } |
202 | |
203 | @@ -101,7 +101,7 @@ |
204 | catch (unity::ResourceException const& e) |
205 | { |
206 | boost::regex r("unity::ResourceException: .*/libtestlib.so: undefined symbol: no_such_symbol"); |
207 | - EXPECT_TRUE(boost::regex_match(e.to_string(), r)); |
208 | + EXPECT_TRUE(boost::regex_match(e.what(), r)); |
209 | } |
210 | } |
211 | } |
212 | |
213 | === modified file 'test/gtest/scopes/internal/MiddlewareFactory/MiddlewareFactory_test.cpp' |
214 | --- test/gtest/scopes/internal/MiddlewareFactory/MiddlewareFactory_test.cpp 2014-01-09 09:47:56 +0000 |
215 | +++ test/gtest/scopes/internal/MiddlewareFactory/MiddlewareFactory_test.cpp 2014-01-24 03:21:30 +0000 |
216 | @@ -46,6 +46,6 @@ |
217 | } |
218 | catch (ConfigException const& e) |
219 | { |
220 | - EXPECT_EQ("unity::scopes::ConfigException: Invalid middleware kind: NoSuchMiddleware", e.to_string()); |
221 | + EXPECT_STREQ("unity::scopes::ConfigException: Invalid middleware kind: NoSuchMiddleware", e.what()); |
222 | } |
223 | } |
224 | |
225 | === modified file 'test/gtest/scopes/internal/Reaper/Reaper_test.cpp' |
226 | --- test/gtest/scopes/internal/Reaper/Reaper_test.cpp 2014-01-07 12:22:29 +0000 |
227 | +++ test/gtest/scopes/internal/Reaper/Reaper_test.cpp 2014-01-24 03:21:30 +0000 |
228 | @@ -197,8 +197,8 @@ |
229 | } |
230 | catch (unity::InvalidArgumentException const& e) |
231 | { |
232 | - EXPECT_EQ("unity::InvalidArgumentException: Reaper: invalid reap_interval (0). Interval must be > 0.", |
233 | - e.to_string()); |
234 | + EXPECT_STREQ("unity::InvalidArgumentException: Reaper: invalid reap_interval (0). Interval must be > 0.", |
235 | + e.what()); |
236 | } |
237 | |
238 | try |
239 | @@ -208,8 +208,8 @@ |
240 | } |
241 | catch (unity::LogicException const& e) |
242 | { |
243 | - EXPECT_EQ("unity::LogicException: Reaper: reap_interval (2) must be <= expiry_interval (1).", |
244 | - e.to_string()); |
245 | + EXPECT_STREQ("unity::LogicException: Reaper: reap_interval (2) must be <= expiry_interval (1).", |
246 | + e.what()); |
247 | } |
248 | |
249 | try |
250 | @@ -220,8 +220,8 @@ |
251 | } |
252 | catch (unity::InvalidArgumentException const& e) |
253 | { |
254 | - EXPECT_EQ("unity::InvalidArgumentException: Reaper: invalid null callback passed to add().", |
255 | - e.to_string()); |
256 | + EXPECT_STREQ("unity::InvalidArgumentException: Reaper: invalid null callback passed to add().", |
257 | + e.what()); |
258 | } |
259 | |
260 | // Make sure that if a callback throws an exception, this does no harm. |
261 | |
262 | === modified file 'test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp' |
263 | --- test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-01-09 09:47:56 +0000 |
264 | +++ test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-01-24 03:21:30 +0000 |
265 | @@ -45,8 +45,8 @@ |
266 | } |
267 | catch (InvalidArgumentException const& e) |
268 | { |
269 | - EXPECT_EQ("unity::InvalidArgumentException: Registry identity cannot be an empty string", |
270 | - e.to_string()); |
271 | + EXPECT_STREQ("unity::InvalidArgumentException: Registry identity cannot be an empty string", |
272 | + e.what()); |
273 | } |
274 | } |
275 | |
276 | @@ -59,8 +59,8 @@ |
277 | } |
278 | catch (ConfigException const& e) |
279 | { |
280 | - EXPECT_EQ("unity::scopes::ConfigException: ScoperunnerRelativePath.ini: Scoperunner.Path " |
281 | - "must be an absolute path", |
282 | - e.to_string()); |
283 | + EXPECT_STREQ("unity::scopes::ConfigException: ScoperunnerRelativePath.ini: Scoperunner.Path " |
284 | + "must be an absolute path", |
285 | + e.what()); |
286 | } |
287 | } |
288 | |
289 | === modified file 'test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp' |
290 | --- test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-01-09 09:47:56 +0000 |
291 | +++ test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-01-24 03:21:30 +0000 |
292 | @@ -42,8 +42,8 @@ |
293 | } |
294 | catch (ConfigException const& e) |
295 | { |
296 | - EXPECT_EQ("unity::scopes::ConfigException: \"RegIDEmpty.ini\": Illegal empty value for Registry.Identity", |
297 | - e.to_string()); |
298 | + EXPECT_STREQ("unity::scopes::ConfigException: \"RegIDEmpty.ini\": Illegal empty value for Registry.Identity", |
299 | + e.what()); |
300 | } |
301 | } |
302 | |
303 | @@ -56,9 +56,9 @@ |
304 | } |
305 | catch (ConfigException const& e) |
306 | { |
307 | - EXPECT_EQ("unity::scopes::ConfigException: \"BadRegID.ini\": Illegal character in value for " |
308 | - "Registry.Identity: \"Regi/stry\": identity cannot contain '/'", |
309 | - e.to_string()); |
310 | + EXPECT_STREQ("unity::scopes::ConfigException: \"BadRegID.ini\": Illegal character in value for " |
311 | + "Registry.Identity: \"Regi/stry\": identity cannot contain '/'", |
312 | + e.what()); |
313 | } |
314 | } |
315 | |
316 | @@ -71,8 +71,8 @@ |
317 | } |
318 | catch (ConfigException const& e) |
319 | { |
320 | - EXPECT_EQ("unity::scopes::ConfigException: \"RegFileEmpty.ini\": Illegal empty value for Registry.ConfigFile", |
321 | - e.to_string()); |
322 | + EXPECT_STREQ("unity::scopes::ConfigException: \"RegFileEmpty.ini\": Illegal empty value for Registry.ConfigFile", |
323 | + e.what()); |
324 | } |
325 | } |
326 | |
327 | @@ -85,8 +85,8 @@ |
328 | } |
329 | catch (ConfigException const& e) |
330 | { |
331 | - EXPECT_EQ("unity::scopes::ConfigException: \"MWEmpty.ini\": Illegal empty value for Default.Middleware", |
332 | - e.to_string()); |
333 | + EXPECT_STREQ("unity::scopes::ConfigException: \"MWEmpty.ini\": Illegal empty value for Default.Middleware", |
334 | + e.what()); |
335 | } |
336 | } |
337 | |
338 | @@ -99,8 +99,8 @@ |
339 | } |
340 | catch (ConfigException const& e) |
341 | { |
342 | - EXPECT_EQ("unity::scopes::ConfigException: \"BadMW.ini\": Illegal value for Default.Middleware: " |
343 | - "\"Foo\": legal values are \"Zmq\" and \"REST\"", |
344 | - e.to_string()); |
345 | + EXPECT_STREQ("unity::scopes::ConfigException: \"BadMW.ini\": Illegal value for Default.Middleware: " |
346 | + "\"Foo\": legal values are \"Zmq\" and \"REST\"", |
347 | + e.what()); |
348 | } |
349 | } |
350 | |
351 | === modified file 'test/gtest/scopes/internal/RuntimeImpl/RuntimeImpl_test.cpp' |
352 | --- test/gtest/scopes/internal/RuntimeImpl/RuntimeImpl_test.cpp 2014-01-09 09:47:56 +0000 |
353 | +++ test/gtest/scopes/internal/RuntimeImpl/RuntimeImpl_test.cpp 2014-01-24 03:21:30 +0000 |
354 | @@ -44,8 +44,8 @@ |
355 | } |
356 | catch (LogicException const& e) |
357 | { |
358 | - EXPECT_EQ("unity::LogicException: registry(): Cannot obtain registry for already destroyed run time", |
359 | - e.to_string()); |
360 | + EXPECT_STREQ("unity::LogicException: registry(): Cannot obtain registry for already destroyed run time", |
361 | + e.what()); |
362 | } |
363 | |
364 | rt->destroy(); |
365 | @@ -56,8 +56,8 @@ |
366 | } |
367 | catch (LogicException const& e) |
368 | { |
369 | - EXPECT_EQ("unity::LogicException: factory(): Cannot obtain factory for already destroyed run time", |
370 | - e.to_string()); |
371 | + EXPECT_STREQ("unity::LogicException: factory(): Cannot obtain factory for already destroyed run time", |
372 | + e.what()); |
373 | } |
374 | } |
375 | |
376 | @@ -69,9 +69,9 @@ |
377 | } |
378 | catch (ConfigException const& e) |
379 | { |
380 | - EXPECT_EQ("unity::scopes::ConfigException: Cannot instantiate run time for testscope, " |
381 | - "config file: NoSuchFile.ini:\n" |
382 | - " unity::FileException: Could not load ini file NoSuchFile.ini: No such file or directory (errno = 4)", |
383 | - e.to_string()); |
384 | + EXPECT_STREQ("unity::scopes::ConfigException: Cannot instantiate run time for testscope, " |
385 | + "config file: NoSuchFile.ini:\n" |
386 | + " unity::FileException: Could not load ini file NoSuchFile.ini: No such file or directory (errno = 4)", |
387 | + e.what()); |
388 | } |
389 | } |
390 | |
391 | === modified file 'test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp' |
392 | --- test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp 2014-01-09 11:59:34 +0000 |
393 | +++ test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp 2014-01-24 03:21:30 +0000 |
394 | @@ -92,8 +92,8 @@ |
395 | } |
396 | catch (unity::Exception const& e) |
397 | { |
398 | - EXPECT_EQ("unity::InvalidArgumentException: Cannot load scope testScope: null registry proxy", |
399 | - e.to_string()); |
400 | + EXPECT_STREQ("unity::InvalidArgumentException: Cannot load scope testScope: null registry proxy", |
401 | + e.what()); |
402 | } |
403 | } |
404 | |
405 | @@ -114,7 +114,7 @@ |
406 | " unity::ResourceException: Scope testScope was compiled with major version 666 of the " |
407 | "Unity scopes run time. This version is incompatible with the current major version " |
408 | "\\([0-9]+\\)\\."); |
409 | - EXPECT_TRUE(boost::regex_match(e.to_string(), r)) << e.to_string(); |
410 | + EXPECT_TRUE(boost::regex_match(e.what(), r)) << e.what(); |
411 | } |
412 | EXPECT_EQ(1, num_create()); |
413 | EXPECT_EQ(1, num_destroy()); |
414 | @@ -190,8 +190,8 @@ |
415 | } |
416 | catch (unity::Exception const& e) |
417 | { |
418 | - EXPECT_EQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory", |
419 | - e.to_string()); |
420 | + EXPECT_STREQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory", |
421 | + e.what()); |
422 | EXPECT_EQ(0, num_create()); |
423 | EXPECT_EQ(0, num_destroy()); |
424 | } |
425 | @@ -211,7 +211,7 @@ |
426 | catch (unity::Exception const& e) |
427 | { |
428 | boost::regex r("unity::ResourceException: .*/libNoDestroy.so: undefined symbol: unity_scope_destroy"); |
429 | - EXPECT_TRUE(boost::regex_match(e.to_string(), r)); |
430 | + EXPECT_TRUE(boost::regex_match(e.what(), r)); |
431 | EXPECT_EQ(0, num_create()); |
432 | EXPECT_EQ(0, num_destroy()); |
433 | } |
434 | @@ -230,8 +230,8 @@ |
435 | } |
436 | catch (unity::Exception const& e) |
437 | { |
438 | - EXPECT_EQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create", |
439 | - e.to_string()); |
440 | + EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create", |
441 | + e.what()); |
442 | EXPECT_EQ(1, num_create()); |
443 | EXPECT_EQ(0, num_destroy()); |
444 | } |
445 | @@ -251,8 +251,8 @@ |
446 | } |
447 | catch (unity::Exception const& e) |
448 | { |
449 | - EXPECT_EQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create", |
450 | - e.to_string()); |
451 | + EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create", |
452 | + e.what()); |
453 | EXPECT_EQ(1, num_create()); |
454 | EXPECT_EQ(0, num_destroy()); |
455 | } |
456 | @@ -273,9 +273,9 @@ |
457 | } |
458 | catch (unity::Exception const& e) |
459 | { |
460 | - EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n" |
461 | - " unity::LogicException: start failure", |
462 | - e.to_string()); |
463 | + EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n" |
464 | + " unity::LogicException: start failure", |
465 | + e.what()); |
466 | } |
467 | } |
468 | EXPECT_EQ(0, num_stop()); |
469 | @@ -297,9 +297,9 @@ |
470 | } |
471 | catch (unity::Exception const& e) |
472 | { |
473 | - EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n" |
474 | - " unity::LogicException: start failure", |
475 | - e.to_string()); |
476 | + EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n" |
477 | + " unity::LogicException: start failure", |
478 | + e.what()); |
479 | } |
480 | } |
481 | EXPECT_EQ(0, num_stop()); |
482 | @@ -323,9 +323,9 @@ |
483 | } |
484 | catch (unity::Exception const& e) |
485 | { |
486 | - EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n" |
487 | - " unknown exception", |
488 | - e.to_string()); |
489 | + EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n" |
490 | + " unknown exception", |
491 | + e.what()); |
492 | } |
493 | } |
494 | EXPECT_EQ(0, num_stop()); |
495 | @@ -353,9 +353,9 @@ |
496 | } |
497 | catch (unity::ResourceException const& e) |
498 | { |
499 | - EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
500 | - " unity::LogicException: stop failure", |
501 | - e.to_string()); |
502 | + EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
503 | + " unity::LogicException: stop failure", |
504 | + e.what()); |
505 | } |
506 | } |
507 | |
508 | @@ -379,9 +379,9 @@ |
509 | } |
510 | catch (unity::ResourceException const& e) |
511 | { |
512 | - EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
513 | - " stop failure", |
514 | - e.to_string()); |
515 | + EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
516 | + " stop failure", |
517 | + e.what()); |
518 | } |
519 | } |
520 | |
521 | @@ -404,9 +404,9 @@ |
522 | } |
523 | catch (unity::ResourceException const& e) |
524 | { |
525 | - EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
526 | - " unknown exception", |
527 | - e.to_string()); |
528 | + EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
529 | + " unknown exception", |
530 | + e.what()); |
531 | } |
532 | } |
533 | |
534 | @@ -443,9 +443,9 @@ |
535 | } |
536 | catch (unity::Exception const& e) |
537 | { |
538 | - EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
539 | - " unity::LogicException: stop failure", |
540 | - e.to_string()); |
541 | + EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n" |
542 | + " unity::LogicException: stop failure", |
543 | + e.what()); |
544 | } |
545 | |
546 | // Call unload again to make sure that the second time, it doesn't throw. |
547 | @@ -475,7 +475,7 @@ |
548 | } |
549 | catch (unity::Exception const& e) |
550 | { |
551 | - EXPECT_EQ("unity::LogicException: Cannot start scope testScope in Finished state", e.to_string()); |
552 | + EXPECT_STREQ("unity::LogicException: Cannot start scope testScope in Finished state", e.what()); |
553 | } |
554 | } |
555 | |
556 | @@ -495,7 +495,7 @@ |
557 | } |
558 | catch (unity::Exception const& e) |
559 | { |
560 | - EXPECT_EQ("unity::LogicException: Cannot stop scope testScope in Finished state", e.to_string()); |
561 | + EXPECT_STREQ("unity::LogicException: Cannot stop scope testScope in Finished state", e.what()); |
562 | } |
563 | } |
564 | |
565 | @@ -522,7 +522,7 @@ |
566 | } |
567 | catch (unity::Exception const& e) |
568 | { |
569 | - EXPECT_EQ("unity::LogicException: Cannot start scope testScope in Failed state", e.to_string()); |
570 | + EXPECT_STREQ("unity::LogicException: Cannot start scope testScope in Failed state", e.what()); |
571 | } |
572 | |
573 | try |
574 | @@ -531,7 +531,7 @@ |
575 | } |
576 | catch (unity::Exception const& e) |
577 | { |
578 | - EXPECT_EQ("unity::LogicException: Cannot stop scope testScope in Failed state", e.to_string()); |
579 | + EXPECT_STREQ("unity::LogicException: Cannot stop scope testScope in Failed state", e.what()); |
580 | } |
581 | } |
582 | |
583 | |
584 | === modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp' |
585 | --- test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-01-15 22:52:19 +0000 |
586 | +++ test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-01-24 03:21:30 +0000 |
587 | @@ -64,7 +64,7 @@ |
588 | } |
589 | catch (NotFoundException const& e) |
590 | { |
591 | - EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = art)", e.to_string()); |
592 | + EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = art)", e.what()); |
593 | } |
594 | |
595 | try |
596 | @@ -74,7 +74,7 @@ |
597 | } |
598 | catch (NotFoundException const& e) |
599 | { |
600 | - EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = icon)", e.to_string()); |
601 | + EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = icon)", e.what()); |
602 | } |
603 | |
604 | try |
605 | @@ -84,7 +84,7 @@ |
606 | } |
607 | catch (NotFoundException const& e) |
608 | { |
609 | - EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = search_hint)", e.to_string()); |
610 | + EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = search_hint)", e.what()); |
611 | } |
612 | |
613 | try |
614 | @@ -94,7 +94,7 @@ |
615 | } |
616 | catch (NotFoundException const& e) |
617 | { |
618 | - EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = hot_key)", e.to_string()); |
619 | + EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = hot_key)", e.what()); |
620 | } |
621 | |
622 | // Check that the copy has the same values as the original |
623 | @@ -235,8 +235,8 @@ |
624 | } |
625 | catch (InvalidArgumentException const&e) |
626 | { |
627 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'scope_name' is empty", |
628 | - e.to_string()); |
629 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'scope_name' is empty", |
630 | + e.what()); |
631 | } |
632 | |
633 | try |
634 | @@ -247,8 +247,8 @@ |
635 | } |
636 | catch (InvalidArgumentException const&e) |
637 | { |
638 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadataImpl::serialize(): required attribute 'proxy' is null", |
639 | - e.to_string()); |
640 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadataImpl::serialize(): required attribute 'proxy' is null", |
641 | + e.what()); |
642 | } |
643 | |
644 | try |
645 | @@ -260,8 +260,8 @@ |
646 | } |
647 | catch (InvalidArgumentException const&e) |
648 | { |
649 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'display_name' is empty", |
650 | - e.to_string()); |
651 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'display_name' is empty", |
652 | + e.what()); |
653 | } |
654 | |
655 | try |
656 | @@ -272,8 +272,8 @@ |
657 | } |
658 | catch (InvalidArgumentException const&e) |
659 | { |
660 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'description' is empty", |
661 | - e.to_string()); |
662 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'description' is empty", |
663 | + e.what()); |
664 | } |
665 | } |
666 | |
667 | @@ -291,9 +291,9 @@ |
668 | } |
669 | catch (InvalidArgumentException const&e) |
670 | { |
671 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
672 | - "'scope_name' is missing", |
673 | - e.to_string()); |
674 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
675 | + "'scope_name' is missing", |
676 | + e.what()); |
677 | } |
678 | |
679 | m["scope_name"] = "scope_name"; |
680 | @@ -305,9 +305,9 @@ |
681 | } |
682 | catch (InvalidArgumentException const&e) |
683 | { |
684 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
685 | - "'proxy' is missing", |
686 | - e.to_string()); |
687 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
688 | + "'proxy' is missing", |
689 | + e.what()); |
690 | } |
691 | |
692 | VariantMap proxy; |
693 | @@ -320,8 +320,8 @@ |
694 | } |
695 | catch (InvalidArgumentException const&e) |
696 | { |
697 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.identity'", |
698 | - e.to_string()); |
699 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.identity'", |
700 | + e.what()); |
701 | } |
702 | |
703 | proxy["identity"] = "identity"; |
704 | @@ -334,8 +334,8 @@ |
705 | } |
706 | catch (InvalidArgumentException const&e) |
707 | { |
708 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.endpoint'", |
709 | - e.to_string()); |
710 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.endpoint'", |
711 | + e.what()); |
712 | } |
713 | |
714 | proxy["endpoint"] = "endpoint"; |
715 | @@ -348,9 +348,9 @@ |
716 | } |
717 | catch (InvalidArgumentException const&e) |
718 | { |
719 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
720 | - "'display_name' is missing", |
721 | - e.to_string()); |
722 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
723 | + "'display_name' is missing", |
724 | + e.what()); |
725 | } |
726 | |
727 | m["display_name"] = "display_name"; |
728 | @@ -362,9 +362,9 @@ |
729 | } |
730 | catch (InvalidArgumentException const&e) |
731 | { |
732 | - EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
733 | - "'description' is missing", |
734 | - e.to_string()); |
735 | + EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute " |
736 | + "'description' is missing", |
737 | + e.what()); |
738 | } |
739 | m["description"] = "description"; |
740 | |
741 | |
742 | === modified file 'test/gtest/scopes/internal/ThreadPool/ThreadPool_test.cpp' |
743 | --- test/gtest/scopes/internal/ThreadPool/ThreadPool_test.cpp 2014-01-07 12:22:29 +0000 |
744 | +++ test/gtest/scopes/internal/ThreadPool/ThreadPool_test.cpp 2014-01-24 03:21:30 +0000 |
745 | @@ -92,7 +92,7 @@ |
746 | } |
747 | catch (unity::InvalidArgumentException const& e) |
748 | { |
749 | - EXPECT_EQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: 0", e.to_string()); |
750 | + EXPECT_STREQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: 0", e.what()); |
751 | } |
752 | |
753 | try |
754 | @@ -101,6 +101,6 @@ |
755 | } |
756 | catch (unity::InvalidArgumentException const& e) |
757 | { |
758 | - EXPECT_EQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: -1", e.to_string()); |
759 | + EXPECT_STREQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: -1", e.what()); |
760 | } |
761 | } |
762 | |
763 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp' |
764 | --- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-01-16 13:40:51 +0000 |
765 | +++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-01-24 03:21:30 +0000 |
766 | @@ -176,9 +176,9 @@ |
767 | } |
768 | catch (MiddlewareException const& e) |
769 | { |
770 | - EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed " |
771 | - "state (adapter: testscope)", |
772 | - e.to_string()); |
773 | + EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed " |
774 | + "state (adapter: testscope)", |
775 | + e.what()); |
776 | } |
777 | } |
778 | |
779 | @@ -194,12 +194,12 @@ |
780 | } |
781 | catch (MiddlewareException const& e) |
782 | { |
783 | - EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::run_workers(): broker thread " |
784 | - "failure (adapter: testscope):\n" |
785 | - " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure " |
786 | - "(adapter: testscope):\n" |
787 | - " Address already in use", |
788 | - e.to_string()); |
789 | + EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::run_workers(): broker thread " |
790 | + "failure (adapter: testscope):\n" |
791 | + " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure " |
792 | + "(adapter: testscope):\n" |
793 | + " Address already in use", |
794 | + e.what()); |
795 | } |
796 | try |
797 | { |
798 | @@ -207,13 +207,13 @@ |
799 | } |
800 | catch (MiddlewareException const& e) |
801 | { |
802 | - EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n" |
803 | - " Exception history:\n" |
804 | - " Exception #1:\n" |
805 | - " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure " |
806 | - "(adapter: testscope):\n" |
807 | - " Address already in use", |
808 | - e.to_string()); |
809 | + EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n" |
810 | + " Exception history:\n" |
811 | + " Exception #1:\n" |
812 | + " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure " |
813 | + "(adapter: testscope):\n" |
814 | + " Address already in use", |
815 | + e.what()); |
816 | } |
817 | try |
818 | { |
819 | @@ -221,13 +221,13 @@ |
820 | } |
821 | catch (MiddlewareException const& e) |
822 | { |
823 | - EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n" |
824 | - " Exception history:\n" |
825 | - " Exception #1:\n" |
826 | - " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure " |
827 | - "(adapter: testscope):\n" |
828 | - " Address already in use", |
829 | - e.to_string()); |
830 | + EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n" |
831 | + " Exception history:\n" |
832 | + " Exception #1:\n" |
833 | + " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure " |
834 | + "(adapter: testscope):\n" |
835 | + " Address already in use", |
836 | + e.what()); |
837 | } |
838 | } |
839 | } |
840 | @@ -294,8 +294,8 @@ |
841 | } |
842 | catch (InvalidArgumentException const& e) |
843 | { |
844 | - EXPECT_EQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid empty id (adapter: testscope)", |
845 | - e.to_string()); |
846 | + EXPECT_STREQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid empty id (adapter: testscope)", |
847 | + e.what()); |
848 | } |
849 | |
850 | try |
851 | @@ -305,8 +305,8 @@ |
852 | } |
853 | catch (InvalidArgumentException const& e) |
854 | { |
855 | - EXPECT_EQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid nullptr object (adapter: testscope)", |
856 | - e.to_string()); |
857 | + EXPECT_STREQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid nullptr object (adapter: testscope)", |
858 | + e.what()); |
859 | } |
860 | |
861 | shared_ptr<MyServant> o(new MyServant); |
862 | @@ -321,9 +321,9 @@ |
863 | } |
864 | catch (MiddlewareException const& e) |
865 | { |
866 | - EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::add(): cannot add id \"fred\":" |
867 | - " id already in use (adapter: testscope)", |
868 | - e.to_string()); |
869 | + EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::add(): cannot add id \"fred\":" |
870 | + " id already in use (adapter: testscope)", |
871 | + e.what()); |
872 | } |
873 | |
874 | a.remove("fred"); |
875 | @@ -333,9 +333,9 @@ |
876 | } |
877 | catch (MiddlewareException const& e) |
878 | { |
879 | - EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): cannot remove id \"fred\":" |
880 | - " id not present (adapter: testscope)", |
881 | - e.to_string()); |
882 | + EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): cannot remove id \"fred\":" |
883 | + " id not present (adapter: testscope)", |
884 | + e.what()); |
885 | } |
886 | |
887 | EXPECT_EQ(nullptr, a.find("fred").get()); |
888 | @@ -907,8 +907,8 @@ |
889 | } |
890 | catch (MiddlewareException const& e) |
891 | { |
892 | - EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed state (adapter: testscope)", |
893 | - e.to_string()); |
894 | + EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed state (adapter: testscope)", |
895 | + e.what()); |
896 | } |
897 | }; |
898 | a.add("fred", make_shared<UpdaterServant>(test_func)); |
899 | @@ -928,9 +928,9 @@ |
900 | } |
901 | catch (MiddlewareException const& e) |
902 | { |
903 | - EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): " |
904 | - "cannot remove id \"fred\": id not present (adapter: testscope)", |
905 | - e.to_string()); |
906 | + EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): " |
907 | + "cannot remove id \"fred\": id not present (adapter: testscope)", |
908 | + e.what()); |
909 | } |
910 | }; |
911 | auto servant = make_shared<UpdaterServant>(test_func); |
912 | @@ -952,9 +952,9 @@ |
913 | } |
914 | catch (MiddlewareException const& e) |
915 | { |
916 | - EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): " |
917 | - "cannot remove id \"fred\": id not present (adapter: testscope)", |
918 | - e.to_string()); |
919 | + EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): " |
920 | + "cannot remove id \"fred\": id not present (adapter: testscope)", |
921 | + e.what()); |
922 | } |
923 | }; |
924 | auto servant = make_shared<UpdaterServant>(test_func); |
925 | @@ -1005,9 +1005,9 @@ |
926 | } |
927 | catch (MiddlewareException const& e) |
928 | { |
929 | - EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed " |
930 | - "state (adapter: testscope)", |
931 | - e.to_string()); |
932 | + EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed " |
933 | + "state (adapter: testscope)", |
934 | + e.what()); |
935 | } |
936 | try |
937 | { |
938 | @@ -1016,9 +1016,9 @@ |
939 | } |
940 | catch (MiddlewareException const& e) |
941 | { |
942 | - EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed " |
943 | - "state (adapter: testscope)", |
944 | - e.to_string()); |
945 | + EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed " |
946 | + "state (adapter: testscope)", |
947 | + e.what()); |
948 | } |
949 | } |
950 | } |
951 | @@ -1196,9 +1196,9 @@ |
952 | } |
953 | catch (InvalidArgumentException const& e) |
954 | { |
955 | - EXPECT_EQ("unity::InvalidArgumentException: ObjectAdapter::add_dflt_servant(): " |
956 | - "invalid nullptr object (adapter: testscope)", |
957 | - e.to_string()); |
958 | + EXPECT_STREQ("unity::InvalidArgumentException: ObjectAdapter::add_dflt_servant(): " |
959 | + "invalid nullptr object (adapter: testscope)", |
960 | + e.what()); |
961 | } |
962 | |
963 | ObjectAdapter b(mw, "testscope2", "ipc://testscope", RequestType::Oneway, 2); |
964 | |
965 | === modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp' |
966 | --- test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-01-21 04:38:37 +0000 |
967 | +++ test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-01-24 03:21:30 +0000 |
968 | @@ -58,34 +58,26 @@ |
969 | |
970 | TEST(RegistryI, get_metadata) |
971 | { |
972 | - try |
973 | - { |
974 | - vector<string> dummy_spawn_command; |
975 | - RuntimeImpl::UPtr runtime = RuntimeImpl::create( |
976 | - "TestRegistry", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/RegistryI/Runtime.ini"); |
977 | - |
978 | - string identity = runtime->registry_identity(); |
979 | - RegistryConfig c(identity, runtime->registry_configfile()); |
980 | - string mw_kind = c.mw_kind(); |
981 | - string mw_endpoint = c.endpoint(); |
982 | - string mw_configfile = c.mw_configfile(); |
983 | - |
984 | - MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
985 | - RegistryObject::SPtr ro(make_shared<RegistryObject>()); |
986 | - auto registry = middleware->add_registry_object(identity, ro); |
987 | - auto p = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1"); |
988 | - EXPECT_TRUE(ro->add("scope1", move(make_meta("scope1", p, middleware)), |
989 | - dummy_spawn_command)); |
990 | - |
991 | - auto r = runtime->registry(); |
992 | - auto scope = r->get_metadata("scope1"); |
993 | - EXPECT_EQ("scope1", scope.scope_name()); |
994 | - } |
995 | - catch (unity::Exception const& e) |
996 | - { |
997 | - cerr << e.to_string() << endl; |
998 | - FAIL(); |
999 | - } |
1000 | + vector<string> dummy_spawn_command; |
1001 | + RuntimeImpl::UPtr runtime = RuntimeImpl::create( |
1002 | + "TestRegistry", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/RegistryI/Runtime.ini"); |
1003 | + |
1004 | + string identity = runtime->registry_identity(); |
1005 | + RegistryConfig c(identity, runtime->registry_configfile()); |
1006 | + string mw_kind = c.mw_kind(); |
1007 | + string mw_endpoint = c.endpoint(); |
1008 | + string mw_configfile = c.mw_configfile(); |
1009 | + |
1010 | + MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
1011 | + RegistryObject::SPtr ro(make_shared<RegistryObject>()); |
1012 | + auto registry = middleware->add_registry_object(identity, ro); |
1013 | + auto p = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1"); |
1014 | + EXPECT_TRUE(ro->add("scope1", move(make_meta("scope1", p, middleware)), |
1015 | + dummy_spawn_command)); |
1016 | + |
1017 | + auto r = runtime->registry(); |
1018 | + auto scope = r->get_metadata("scope1"); |
1019 | + EXPECT_EQ("scope1", scope.scope_name()); |
1020 | } |
1021 | |
1022 | TEST(RegistryI, list) |
1023 | @@ -216,8 +208,8 @@ |
1024 | } |
1025 | catch (NotFoundException const& e) |
1026 | { |
1027 | - EXPECT_EQ("unity::scopes::NotFoundException: Registry::get_metadata(): no such scope (name = fred)", |
1028 | - e.to_string()); |
1029 | + EXPECT_STREQ("unity::scopes::NotFoundException: Registry::get_metadata(): no such scope (name = fred)", |
1030 | + e.what()); |
1031 | } |
1032 | |
1033 | try |
1034 | @@ -227,9 +219,9 @@ |
1035 | } |
1036 | catch (MiddlewareException const& e) |
1037 | { |
1038 | - EXPECT_EQ("unity::scopes::MiddlewareException: unity::InvalidArgumentException: " |
1039 | - "Registry: Cannot search for scope with empty name", |
1040 | - e.to_string()); |
1041 | + EXPECT_STREQ("unity::scopes::MiddlewareException: unity::InvalidArgumentException: " |
1042 | + "Registry: Cannot search for scope with empty name", |
1043 | + e.what()); |
1044 | } |
1045 | |
1046 | try |
1047 | @@ -240,8 +232,8 @@ |
1048 | } |
1049 | catch (InvalidArgumentException const& e) |
1050 | { |
1051 | - EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name", |
1052 | - e.to_string()); |
1053 | + EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name", |
1054 | + e.what()); |
1055 | } |
1056 | |
1057 | try |
1058 | @@ -251,8 +243,8 @@ |
1059 | } |
1060 | catch (InvalidArgumentException const& e) |
1061 | { |
1062 | - EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name", |
1063 | - e.to_string()); |
1064 | + EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name", |
1065 | + e.what()); |
1066 | } |
1067 | } |
1068 | |
1069 | @@ -298,7 +290,7 @@ |
1070 | auto r_proxy = dynamic_pointer_cast<ZmqRegistry>(r); |
1071 | auto proxy = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1"); |
1072 | mro->add("scope1", move(make_meta("scope1", proxy, middleware)), |
1073 | - dummy_spawn_command); |
1074 | + dummy_spawn_command); |
1075 | |
1076 | auto p = r_proxy->locate("scope1"); |
1077 | EXPECT_EQ("scope1", p->identity()); |
1078 | @@ -325,28 +317,27 @@ |
1079 | EXPECT_STREQ("unity::scopes::RegistryException: Couldn't start error_scope", e.what()); |
1080 | } |
1081 | |
1082 | -#if 0 |
1083 | try |
1084 | { |
1085 | auto proxy = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1"); |
1086 | - ro->add("", move(make_meta("blah", proxy, middleware))); |
1087 | + mro->add("", move(make_meta("blah", proxy, middleware)), |
1088 | + dummy_spawn_command); |
1089 | FAIL(); |
1090 | } |
1091 | catch (InvalidArgumentException const& e) |
1092 | { |
1093 | - EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name", |
1094 | - e.to_string()); |
1095 | + EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name", |
1096 | + e.what()); |
1097 | } |
1098 | |
1099 | try |
1100 | { |
1101 | - ro->remove(""); |
1102 | + mro->remove(""); |
1103 | FAIL(); |
1104 | } |
1105 | catch (InvalidArgumentException const& e) |
1106 | { |
1107 | - EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name", |
1108 | - e.to_string()); |
1109 | + EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name", |
1110 | + e.what()); |
1111 | } |
1112 | -#endif |
1113 | } |
FAILED: Continuous integration, rev:150 jenkins. qa.ubuntu. com/job/ unity-scopes- api-ci/ 287/ jenkins. qa.ubuntu. com/job/ unity-scopes- api-trusty- amd64-ci/ 287 jenkins. qa.ubuntu. com/job/ unity-scopes- api-trusty- armhf-ci/ 287 jenkins. qa.ubuntu. com/job/ unity-scopes- api-trusty- armhf-ci/ 287/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-scopes- api-trusty- i386-ci/ 287/console
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- scopes- api-ci/ 287/rebuild
http://