Merge lp:~michihenning/unity-scopes-api/remove-to_string into lp:unity-scopes-api

Proposed by Michi Henning
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
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.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scoperegistry/scoperegistry.cpp'
--- scoperegistry/scoperegistry.cpp 2014-01-17 08:06:47 +0000
+++ scoperegistry/scoperegistry.cpp 2014-01-24 03:21:30 +0000
@@ -97,7 +97,7 @@
97 }97 }
98 catch (FileException const& e)98 catch (FileException const& e)
99 {99 {
100 error("scope group config file ignored:\n" + e.to_string());100 error(string("scope group config file ignored:\n") + e.what());
101 continue;101 continue;
102 }102 }
103103
@@ -108,7 +108,7 @@
108 }108 }
109 catch (LogicException const& e)109 catch (LogicException const& e)
110 {110 {
111 error("group file \"" + file + ": file ignored:\n" + e.to_string());111 error("group file \"" + file + ": file ignored:\n" + e.what());
112 continue;112 continue;
113 }113 }
114114
@@ -213,7 +213,7 @@
213 }213 }
214 catch (unity::Exception const& e)214 catch (unity::Exception const& e)
215 {215 {
216 error("ignoring scope \"" + pair.first + "\": cannot create metadata: " + e.to_string());216 error("ignoring scope \"" + pair.first + "\": cannot create metadata: " + e.what());
217 }217 }
218 }218 }
219}219}
@@ -323,7 +323,7 @@
323 }323 }
324 catch (unity::Exception const& e)324 catch (unity::Exception const& e)
325 {325 {
326 error("ignoring scope \"" + scope_name + "\": configuration error:\n" + e.to_string());326 error("ignoring scope \"" + scope_name + "\": configuration error:\n" + e.what());
327 }327 }
328 }328 }
329329
@@ -379,10 +379,6 @@
379 middleware->wait_for_shutdown();379 middleware->wait_for_shutdown();
380 exit_status = 0;380 exit_status = 0;
381 }381 }
382 catch (unity::Exception const& e)
383 {
384 error(e.to_string());
385 }
386 catch (std::exception const& e)382 catch (std::exception const& e)
387 {383 {
388 error(e.what());384 error(e.what());
389385
=== modified file 'scoperunner/scoperunner.cpp'
--- scoperunner/scoperunner.cpp 2014-01-15 11:32:33 +0000
+++ scoperunner/scoperunner.cpp 2014-01-24 03:21:30 +0000
@@ -169,11 +169,6 @@
169 it->second.t.join();169 it->second.t.join();
170 it->second.f.get(); // This will throw if the thread terminated due to an exception170 it->second.f.get(); // This will throw if the thread terminated due to an exception
171 }171 }
172 catch (unity::Exception const& e)
173 {
174 error(e.to_string());
175 ++num_errors;
176 }
177 catch (std::exception const& e)172 catch (std::exception const& e)
178 {173 {
179 error(e.what());174 error(e.what());
@@ -216,10 +211,6 @@
216211
217 exit_status = run_scopes(runtime_config, config_files);212 exit_status = run_scopes(runtime_config, config_files);
218 }213 }
219 catch (unity::Exception const& e)
220 {
221 error(e.to_string());
222 }
223 catch (std::exception const& e)214 catch (std::exception const& e)
224 {215 {
225 error(e.what());216 error(e.what());
226217
=== modified file 'test/gtest/scopes/Variant/Variant_test.cpp'
--- test/gtest/scopes/Variant/Variant_test.cpp 2014-01-07 12:22:29 +0000
+++ test/gtest/scopes/Variant/Variant_test.cpp 2014-01-24 03:21:30 +0000
@@ -191,9 +191,9 @@
191 }191 }
192 catch (LogicException const& e)192 catch (LogicException const& e)
193 {193 {
194 EXPECT_EQ("unity::LogicException: Variant does not contain a bool value:\n"194 EXPECT_STREQ("unity::LogicException: Variant does not contain a bool value:\n"
195 " boost::bad_get: failed value get using boost::get",195 " boost::bad_get: failed value get using boost::get",
196 e.to_string());196 e.what());
197 }197 }
198198
199 try199 try
@@ -204,9 +204,9 @@
204 }204 }
205 catch (LogicException const& e)205 catch (LogicException const& e)
206 {206 {
207 EXPECT_EQ("unity::LogicException: Variant does not contain a string value:\n"207 EXPECT_STREQ("unity::LogicException: Variant does not contain a string value:\n"
208 " boost::bad_get: failed value get using boost::get",208 " boost::bad_get: failed value get using boost::get",
209 e.to_string());209 e.what());
210 }210 }
211211
212 try212 try
@@ -217,9 +217,9 @@
217 }217 }
218 catch (LogicException const& e)218 catch (LogicException const& e)
219 {219 {
220 EXPECT_EQ("unity::LogicException: Variant does not contain an int value:\n"220 EXPECT_STREQ("unity::LogicException: Variant does not contain an int value:\n"
221 " boost::bad_get: failed value get using boost::get",221 " boost::bad_get: failed value get using boost::get",
222 e.to_string());222 e.what());
223 }223 }
224224
225}225}
226226
=== modified file 'test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp'
--- test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-01-09 09:47:56 +0000
+++ test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-01-24 03:21:30 +0000
@@ -65,7 +65,7 @@
65 }65 }
66 catch (ConfigException const& e)66 catch (ConfigException const& e)
67 {67 {
68 EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": Illegal empty value for Empty", e.to_string());68 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal empty value for Empty", e.what());
69 }69 }
70}70}
7171
@@ -81,9 +81,9 @@
81 }81 }
82 catch (ConfigException const& e)82 catch (ConfigException const& e)
83 {83 {
84 EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for Zmq.BadMiddleware: \"foo\": "84 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for Zmq.BadMiddleware: \"foo\": "
85 "legal values are \"Zmq\" and \"REST\"",85 "legal values are \"Zmq\" and \"REST\"",
86 e.to_string());86 e.what());
87 }87 }
88 try88 try
89 {89 {
@@ -92,9 +92,9 @@
92 }92 }
93 catch (ConfigException const& e)93 catch (ConfigException const& e)
94 {94 {
95 EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for REST.BadMiddleware: \"bar\": "95 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for REST.BadMiddleware: \"bar\": "
96 "legal values are \"Zmq\" and \"REST\"",96 "legal values are \"Zmq\" and \"REST\"",
97 e.to_string());97 e.what());
98 }98 }
99}99}
100100
@@ -109,7 +109,7 @@
109 }109 }
110 catch (ConfigException const& e)110 catch (ConfigException const& e)
111 {111 {
112 EXPECT_EQ("unity::scopes::ConfigException: \"Test.ini\": error", e.to_string());112 EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": error", e.what());
113 }113 }
114}114}
115115
@@ -121,7 +121,7 @@
121 }121 }
122 catch (FileException const& e)122 catch (FileException const& e)
123 {123 {
124 EXPECT_EQ("unity::FileException: Could not load ini file no_such_file: No such file or directory (errno = 4)",124 EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file: No such file or directory (errno = 4)",
125 e.to_string());125 e.what());
126 }126 }
127}127}
128128
=== modified file 'test/gtest/scopes/internal/DynamicLoader/DynamicLoader_test.cpp'
--- test/gtest/scopes/internal/DynamicLoader/DynamicLoader_test.cpp 2014-01-07 12:22:29 +0000
+++ test/gtest/scopes/internal/DynamicLoader/DynamicLoader_test.cpp 2014-01-24 03:21:30 +0000
@@ -74,7 +74,7 @@
74 catch (unity::ResourceException const& e)74 catch (unity::ResourceException const& e)
75 {75 {
76 boost::regex r("unity::ResourceException: .*/libbadtestlib.so: undefined symbol: foo");76 boost::regex r("unity::ResourceException: .*/libbadtestlib.so: undefined symbol: foo");
77 EXPECT_TRUE(boost::regex_match(e.to_string(), r));77 EXPECT_TRUE(boost::regex_match(e.what(), r));
78 }78 }
79}79}
8080
@@ -87,8 +87,8 @@
87 }87 }
88 catch (unity::ResourceException const& e)88 catch (unity::ResourceException const& e)
89 {89 {
90 EXPECT_EQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory",90 EXPECT_STREQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory",
91 e.to_string());91 e.what());
92 }92 }
93 }93 }
9494
@@ -101,7 +101,7 @@
101 catch (unity::ResourceException const& e)101 catch (unity::ResourceException const& e)
102 {102 {
103 boost::regex r("unity::ResourceException: .*/libtestlib.so: undefined symbol: no_such_symbol");103 boost::regex r("unity::ResourceException: .*/libtestlib.so: undefined symbol: no_such_symbol");
104 EXPECT_TRUE(boost::regex_match(e.to_string(), r));104 EXPECT_TRUE(boost::regex_match(e.what(), r));
105 }105 }
106 }106 }
107}107}
108108
=== modified file 'test/gtest/scopes/internal/MiddlewareFactory/MiddlewareFactory_test.cpp'
--- test/gtest/scopes/internal/MiddlewareFactory/MiddlewareFactory_test.cpp 2014-01-09 09:47:56 +0000
+++ test/gtest/scopes/internal/MiddlewareFactory/MiddlewareFactory_test.cpp 2014-01-24 03:21:30 +0000
@@ -46,6 +46,6 @@
46 }46 }
47 catch (ConfigException const& e)47 catch (ConfigException const& e)
48 {48 {
49 EXPECT_EQ("unity::scopes::ConfigException: Invalid middleware kind: NoSuchMiddleware", e.to_string());49 EXPECT_STREQ("unity::scopes::ConfigException: Invalid middleware kind: NoSuchMiddleware", e.what());
50 }50 }
51}51}
5252
=== modified file 'test/gtest/scopes/internal/Reaper/Reaper_test.cpp'
--- test/gtest/scopes/internal/Reaper/Reaper_test.cpp 2014-01-07 12:22:29 +0000
+++ test/gtest/scopes/internal/Reaper/Reaper_test.cpp 2014-01-24 03:21:30 +0000
@@ -197,8 +197,8 @@
197 }197 }
198 catch (unity::InvalidArgumentException const& e)198 catch (unity::InvalidArgumentException const& e)
199 {199 {
200 EXPECT_EQ("unity::InvalidArgumentException: Reaper: invalid reap_interval (0). Interval must be > 0.",200 EXPECT_STREQ("unity::InvalidArgumentException: Reaper: invalid reap_interval (0). Interval must be > 0.",
201 e.to_string());201 e.what());
202 }202 }
203203
204 try204 try
@@ -208,8 +208,8 @@
208 }208 }
209 catch (unity::LogicException const& e)209 catch (unity::LogicException const& e)
210 {210 {
211 EXPECT_EQ("unity::LogicException: Reaper: reap_interval (2) must be <= expiry_interval (1).",211 EXPECT_STREQ("unity::LogicException: Reaper: reap_interval (2) must be <= expiry_interval (1).",
212 e.to_string());212 e.what());
213 }213 }
214214
215 try215 try
@@ -220,8 +220,8 @@
220 }220 }
221 catch (unity::InvalidArgumentException const& e)221 catch (unity::InvalidArgumentException const& e)
222 {222 {
223 EXPECT_EQ("unity::InvalidArgumentException: Reaper: invalid null callback passed to add().",223 EXPECT_STREQ("unity::InvalidArgumentException: Reaper: invalid null callback passed to add().",
224 e.to_string());224 e.what());
225 }225 }
226226
227 // Make sure that if a callback throws an exception, this does no harm.227 // Make sure that if a callback throws an exception, this does no harm.
228228
=== modified file 'test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp'
--- test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-01-09 09:47:56 +0000
+++ test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-01-24 03:21:30 +0000
@@ -45,8 +45,8 @@
45 }45 }
46 catch (InvalidArgumentException const& e)46 catch (InvalidArgumentException const& e)
47 {47 {
48 EXPECT_EQ("unity::InvalidArgumentException: Registry identity cannot be an empty string",48 EXPECT_STREQ("unity::InvalidArgumentException: Registry identity cannot be an empty string",
49 e.to_string());49 e.what());
50 }50 }
51}51}
5252
@@ -59,8 +59,8 @@
59 }59 }
60 catch (ConfigException const& e)60 catch (ConfigException const& e)
61 {61 {
62 EXPECT_EQ("unity::scopes::ConfigException: ScoperunnerRelativePath.ini: Scoperunner.Path "62 EXPECT_STREQ("unity::scopes::ConfigException: ScoperunnerRelativePath.ini: Scoperunner.Path "
63 "must be an absolute path",63 "must be an absolute path",
64 e.to_string());64 e.what());
65 }65 }
66}66}
6767
=== modified file 'test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp'
--- test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-01-09 09:47:56 +0000
+++ test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-01-24 03:21:30 +0000
@@ -42,8 +42,8 @@
42 }42 }
43 catch (ConfigException const& e)43 catch (ConfigException const& e)
44 {44 {
45 EXPECT_EQ("unity::scopes::ConfigException: \"RegIDEmpty.ini\": Illegal empty value for Registry.Identity",45 EXPECT_STREQ("unity::scopes::ConfigException: \"RegIDEmpty.ini\": Illegal empty value for Registry.Identity",
46 e.to_string());46 e.what());
47 }47 }
48}48}
4949
@@ -56,9 +56,9 @@
56 }56 }
57 catch (ConfigException const& e)57 catch (ConfigException const& e)
58 {58 {
59 EXPECT_EQ("unity::scopes::ConfigException: \"BadRegID.ini\": Illegal character in value for "59 EXPECT_STREQ("unity::scopes::ConfigException: \"BadRegID.ini\": Illegal character in value for "
60 "Registry.Identity: \"Regi/stry\": identity cannot contain '/'",60 "Registry.Identity: \"Regi/stry\": identity cannot contain '/'",
61 e.to_string());61 e.what());
62 }62 }
63}63}
6464
@@ -71,8 +71,8 @@
71 }71 }
72 catch (ConfigException const& e)72 catch (ConfigException const& e)
73 {73 {
74 EXPECT_EQ("unity::scopes::ConfigException: \"RegFileEmpty.ini\": Illegal empty value for Registry.ConfigFile",74 EXPECT_STREQ("unity::scopes::ConfigException: \"RegFileEmpty.ini\": Illegal empty value for Registry.ConfigFile",
75 e.to_string());75 e.what());
76 }76 }
77}77}
7878
@@ -85,8 +85,8 @@
85 }85 }
86 catch (ConfigException const& e)86 catch (ConfigException const& e)
87 {87 {
88 EXPECT_EQ("unity::scopes::ConfigException: \"MWEmpty.ini\": Illegal empty value for Default.Middleware",88 EXPECT_STREQ("unity::scopes::ConfigException: \"MWEmpty.ini\": Illegal empty value for Default.Middleware",
89 e.to_string());89 e.what());
90 }90 }
91}91}
9292
@@ -99,8 +99,8 @@
99 }99 }
100 catch (ConfigException const& e)100 catch (ConfigException const& e)
101 {101 {
102 EXPECT_EQ("unity::scopes::ConfigException: \"BadMW.ini\": Illegal value for Default.Middleware: "102 EXPECT_STREQ("unity::scopes::ConfigException: \"BadMW.ini\": Illegal value for Default.Middleware: "
103 "\"Foo\": legal values are \"Zmq\" and \"REST\"",103 "\"Foo\": legal values are \"Zmq\" and \"REST\"",
104 e.to_string());104 e.what());
105 }105 }
106}106}
107107
=== modified file 'test/gtest/scopes/internal/RuntimeImpl/RuntimeImpl_test.cpp'
--- test/gtest/scopes/internal/RuntimeImpl/RuntimeImpl_test.cpp 2014-01-09 09:47:56 +0000
+++ test/gtest/scopes/internal/RuntimeImpl/RuntimeImpl_test.cpp 2014-01-24 03:21:30 +0000
@@ -44,8 +44,8 @@
44 }44 }
45 catch (LogicException const& e)45 catch (LogicException const& e)
46 {46 {
47 EXPECT_EQ("unity::LogicException: registry(): Cannot obtain registry for already destroyed run time",47 EXPECT_STREQ("unity::LogicException: registry(): Cannot obtain registry for already destroyed run time",
48 e.to_string());48 e.what());
49 }49 }
5050
51 rt->destroy();51 rt->destroy();
@@ -56,8 +56,8 @@
56 }56 }
57 catch (LogicException const& e)57 catch (LogicException const& e)
58 {58 {
59 EXPECT_EQ("unity::LogicException: factory(): Cannot obtain factory for already destroyed run time",59 EXPECT_STREQ("unity::LogicException: factory(): Cannot obtain factory for already destroyed run time",
60 e.to_string());60 e.what());
61 }61 }
62}62}
6363
@@ -69,9 +69,9 @@
69 }69 }
70 catch (ConfigException const& e)70 catch (ConfigException const& e)
71 {71 {
72 EXPECT_EQ("unity::scopes::ConfigException: Cannot instantiate run time for testscope, "72 EXPECT_STREQ("unity::scopes::ConfigException: Cannot instantiate run time for testscope, "
73 "config file: NoSuchFile.ini:\n"73 "config file: NoSuchFile.ini:\n"
74 " unity::FileException: Could not load ini file NoSuchFile.ini: No such file or directory (errno = 4)",74 " unity::FileException: Could not load ini file NoSuchFile.ini: No such file or directory (errno = 4)",
75 e.to_string());75 e.what());
76 }76 }
77}77}
7878
=== modified file 'test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp'
--- test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp 2014-01-09 11:59:34 +0000
+++ test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp 2014-01-24 03:21:30 +0000
@@ -92,8 +92,8 @@
92 }92 }
93 catch (unity::Exception const& e)93 catch (unity::Exception const& e)
94 {94 {
95 EXPECT_EQ("unity::InvalidArgumentException: Cannot load scope testScope: null registry proxy",95 EXPECT_STREQ("unity::InvalidArgumentException: Cannot load scope testScope: null registry proxy",
96 e.to_string());96 e.what());
97 }97 }
98}98}
9999
@@ -114,7 +114,7 @@
114 " unity::ResourceException: Scope testScope was compiled with major version 666 of the "114 " unity::ResourceException: Scope testScope was compiled with major version 666 of the "
115 "Unity scopes run time. This version is incompatible with the current major version "115 "Unity scopes run time. This version is incompatible with the current major version "
116 "\\([0-9]+\\)\\.");116 "\\([0-9]+\\)\\.");
117 EXPECT_TRUE(boost::regex_match(e.to_string(), r)) << e.to_string();117 EXPECT_TRUE(boost::regex_match(e.what(), r)) << e.what();
118 }118 }
119 EXPECT_EQ(1, num_create());119 EXPECT_EQ(1, num_create());
120 EXPECT_EQ(1, num_destroy());120 EXPECT_EQ(1, num_destroy());
@@ -190,8 +190,8 @@
190 }190 }
191 catch (unity::Exception const& e)191 catch (unity::Exception const& e)
192 {192 {
193 EXPECT_EQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory",193 EXPECT_STREQ("unity::ResourceException: no_such_lib: cannot open shared object file: No such file or directory",
194 e.to_string());194 e.what());
195 EXPECT_EQ(0, num_create());195 EXPECT_EQ(0, num_create());
196 EXPECT_EQ(0, num_destroy());196 EXPECT_EQ(0, num_destroy());
197 }197 }
@@ -211,7 +211,7 @@
211 catch (unity::Exception const& e)211 catch (unity::Exception const& e)
212 {212 {
213 boost::regex r("unity::ResourceException: .*/libNoDestroy.so: undefined symbol: unity_scope_destroy");213 boost::regex r("unity::ResourceException: .*/libNoDestroy.so: undefined symbol: unity_scope_destroy");
214 EXPECT_TRUE(boost::regex_match(e.to_string(), r));214 EXPECT_TRUE(boost::regex_match(e.what(), r));
215 EXPECT_EQ(0, num_create());215 EXPECT_EQ(0, num_create());
216 EXPECT_EQ(0, num_destroy());216 EXPECT_EQ(0, num_destroy());
217 }217 }
@@ -230,8 +230,8 @@
230 }230 }
231 catch (unity::Exception const& e)231 catch (unity::Exception const& e)
232 {232 {
233 EXPECT_EQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create",233 EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create",
234 e.to_string());234 e.what());
235 EXPECT_EQ(1, num_create());235 EXPECT_EQ(1, num_create());
236 EXPECT_EQ(0, num_destroy());236 EXPECT_EQ(0, num_destroy());
237 }237 }
@@ -251,8 +251,8 @@
251 }251 }
252 catch (unity::Exception const& e)252 catch (unity::Exception const& e)
253 {253 {
254 EXPECT_EQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create",254 EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create",
255 e.to_string());255 e.what());
256 EXPECT_EQ(1, num_create());256 EXPECT_EQ(1, num_create());
257 EXPECT_EQ(0, num_destroy());257 EXPECT_EQ(0, num_destroy());
258 }258 }
@@ -273,9 +273,9 @@
273 }273 }
274 catch (unity::Exception const& e)274 catch (unity::Exception const& e)
275 {275 {
276 EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n"276 EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n"
277 " unity::LogicException: start failure",277 " unity::LogicException: start failure",
278 e.to_string());278 e.what());
279 }279 }
280 }280 }
281 EXPECT_EQ(0, num_stop());281 EXPECT_EQ(0, num_stop());
@@ -297,9 +297,9 @@
297 }297 }
298 catch (unity::Exception const& e)298 catch (unity::Exception const& e)
299 {299 {
300 EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n"300 EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n"
301 " unity::LogicException: start failure",301 " unity::LogicException: start failure",
302 e.to_string());302 e.what());
303 }303 }
304 }304 }
305 EXPECT_EQ(0, num_stop());305 EXPECT_EQ(0, num_stop());
@@ -323,9 +323,9 @@
323 }323 }
324 catch (unity::Exception const& e)324 catch (unity::Exception const& e)
325 {325 {
326 EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n"326 EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in start():\n"
327 " unknown exception",327 " unknown exception",
328 e.to_string());328 e.what());
329 }329 }
330 }330 }
331 EXPECT_EQ(0, num_stop());331 EXPECT_EQ(0, num_stop());
@@ -353,9 +353,9 @@
353 }353 }
354 catch (unity::ResourceException const& e)354 catch (unity::ResourceException const& e)
355 {355 {
356 EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"356 EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"
357 " unity::LogicException: stop failure",357 " unity::LogicException: stop failure",
358 e.to_string());358 e.what());
359 }359 }
360}360}
361361
@@ -379,9 +379,9 @@
379 }379 }
380 catch (unity::ResourceException const& e)380 catch (unity::ResourceException const& e)
381 {381 {
382 EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"382 EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"
383 " stop failure",383 " stop failure",
384 e.to_string());384 e.what());
385 }385 }
386}386}
387387
@@ -404,9 +404,9 @@
404 }404 }
405 catch (unity::ResourceException const& e)405 catch (unity::ResourceException const& e)
406 {406 {
407 EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"407 EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"
408 " unknown exception",408 " unknown exception",
409 e.to_string());409 e.what());
410 }410 }
411}411}
412412
@@ -443,9 +443,9 @@
443 }443 }
444 catch (unity::Exception const& e)444 catch (unity::Exception const& e)
445 {445 {
446 EXPECT_EQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"446 EXPECT_STREQ("unity::ResourceException: Scope testScope: terminated due to exception in stop():\n"
447 " unity::LogicException: stop failure",447 " unity::LogicException: stop failure",
448 e.to_string());448 e.what());
449 }449 }
450450
451 // Call unload again to make sure that the second time, it doesn't throw.451 // Call unload again to make sure that the second time, it doesn't throw.
@@ -475,7 +475,7 @@
475 }475 }
476 catch (unity::Exception const& e)476 catch (unity::Exception const& e)
477 {477 {
478 EXPECT_EQ("unity::LogicException: Cannot start scope testScope in Finished state", e.to_string());478 EXPECT_STREQ("unity::LogicException: Cannot start scope testScope in Finished state", e.what());
479 }479 }
480}480}
481481
@@ -495,7 +495,7 @@
495 }495 }
496 catch (unity::Exception const& e)496 catch (unity::Exception const& e)
497 {497 {
498 EXPECT_EQ("unity::LogicException: Cannot stop scope testScope in Finished state", e.to_string());498 EXPECT_STREQ("unity::LogicException: Cannot stop scope testScope in Finished state", e.what());
499 }499 }
500}500}
501501
@@ -522,7 +522,7 @@
522 }522 }
523 catch (unity::Exception const& e)523 catch (unity::Exception const& e)
524 {524 {
525 EXPECT_EQ("unity::LogicException: Cannot start scope testScope in Failed state", e.to_string());525 EXPECT_STREQ("unity::LogicException: Cannot start scope testScope in Failed state", e.what());
526 }526 }
527527
528 try528 try
@@ -531,7 +531,7 @@
531 }531 }
532 catch (unity::Exception const& e)532 catch (unity::Exception const& e)
533 {533 {
534 EXPECT_EQ("unity::LogicException: Cannot stop scope testScope in Failed state", e.to_string());534 EXPECT_STREQ("unity::LogicException: Cannot stop scope testScope in Failed state", e.what());
535 }535 }
536}536}
537537
538538
=== modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp'
--- test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-01-15 22:52:19 +0000
+++ test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-01-24 03:21:30 +0000
@@ -64,7 +64,7 @@
64 }64 }
65 catch (NotFoundException const& e)65 catch (NotFoundException const& e)
66 {66 {
67 EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = art)", e.to_string());67 EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = art)", e.what());
68 }68 }
6969
70 try70 try
@@ -74,7 +74,7 @@
74 }74 }
75 catch (NotFoundException const& e)75 catch (NotFoundException const& e)
76 {76 {
77 EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = icon)", e.to_string());77 EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = icon)", e.what());
78 }78 }
7979
80 try80 try
@@ -84,7 +84,7 @@
84 }84 }
85 catch (NotFoundException const& e)85 catch (NotFoundException const& e)
86 {86 {
87 EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = search_hint)", e.to_string());87 EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = search_hint)", e.what());
88 }88 }
8989
90 try90 try
@@ -94,7 +94,7 @@
94 }94 }
95 catch (NotFoundException const& e)95 catch (NotFoundException const& e)
96 {96 {
97 EXPECT_EQ("unity::scopes::NotFoundException: attribute not set (name = hot_key)", e.to_string());97 EXPECT_STREQ("unity::scopes::NotFoundException: attribute not set (name = hot_key)", e.what());
98 }98 }
9999
100 // Check that the copy has the same values as the original100 // Check that the copy has the same values as the original
@@ -235,8 +235,8 @@
235 }235 }
236 catch (InvalidArgumentException const&e)236 catch (InvalidArgumentException const&e)
237 {237 {
238 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'scope_name' is empty",238 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'scope_name' is empty",
239 e.to_string());239 e.what());
240 }240 }
241241
242 try242 try
@@ -247,8 +247,8 @@
247 }247 }
248 catch (InvalidArgumentException const&e)248 catch (InvalidArgumentException const&e)
249 {249 {
250 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadataImpl::serialize(): required attribute 'proxy' is null",250 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadataImpl::serialize(): required attribute 'proxy' is null",
251 e.to_string());251 e.what());
252 }252 }
253253
254 try254 try
@@ -260,8 +260,8 @@
260 }260 }
261 catch (InvalidArgumentException const&e)261 catch (InvalidArgumentException const&e)
262 {262 {
263 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'display_name' is empty",263 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'display_name' is empty",
264 e.to_string());264 e.what());
265 }265 }
266266
267 try267 try
@@ -272,8 +272,8 @@
272 }272 }
273 catch (InvalidArgumentException const&e)273 catch (InvalidArgumentException const&e)
274 {274 {
275 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'description' is empty",275 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata: required attribute 'description' is empty",
276 e.to_string());276 e.what());
277 }277 }
278}278}
279279
@@ -291,9 +291,9 @@
291 }291 }
292 catch (InvalidArgumentException const&e)292 catch (InvalidArgumentException const&e)
293 {293 {
294 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "294 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "
295 "'scope_name' is missing",295 "'scope_name' is missing",
296 e.to_string());296 e.what());
297 }297 }
298298
299 m["scope_name"] = "scope_name";299 m["scope_name"] = "scope_name";
@@ -305,9 +305,9 @@
305 }305 }
306 catch (InvalidArgumentException const&e)306 catch (InvalidArgumentException const&e)
307 {307 {
308 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "308 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "
309 "'proxy' is missing",309 "'proxy' is missing",
310 e.to_string());310 e.what());
311 }311 }
312312
313 VariantMap proxy;313 VariantMap proxy;
@@ -320,8 +320,8 @@
320 }320 }
321 catch (InvalidArgumentException const&e)321 catch (InvalidArgumentException const&e)
322 {322 {
323 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.identity'",323 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.identity'",
324 e.to_string());324 e.what());
325 }325 }
326326
327 proxy["identity"] = "identity";327 proxy["identity"] = "identity";
@@ -334,8 +334,8 @@
334 }334 }
335 catch (InvalidArgumentException const&e)335 catch (InvalidArgumentException const&e)
336 {336 {
337 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.endpoint'",337 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadataImpl::deserialize(): missing 'proxy.endpoint'",
338 e.to_string());338 e.what());
339 }339 }
340340
341 proxy["endpoint"] = "endpoint";341 proxy["endpoint"] = "endpoint";
@@ -348,9 +348,9 @@
348 }348 }
349 catch (InvalidArgumentException const&e)349 catch (InvalidArgumentException const&e)
350 {350 {
351 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "351 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "
352 "'display_name' is missing",352 "'display_name' is missing",
353 e.to_string());353 e.what());
354 }354 }
355355
356 m["display_name"] = "display_name";356 m["display_name"] = "display_name";
@@ -362,9 +362,9 @@
362 }362 }
363 catch (InvalidArgumentException const&e)363 catch (InvalidArgumentException const&e)
364 {364 {
365 EXPECT_EQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "365 EXPECT_STREQ("unity::InvalidArgumentException: ScopeMetadata::deserialize(): required attribute "
366 "'description' is missing",366 "'description' is missing",
367 e.to_string());367 e.what());
368 }368 }
369 m["description"] = "description";369 m["description"] = "description";
370370
371371
=== modified file 'test/gtest/scopes/internal/ThreadPool/ThreadPool_test.cpp'
--- test/gtest/scopes/internal/ThreadPool/ThreadPool_test.cpp 2014-01-07 12:22:29 +0000
+++ test/gtest/scopes/internal/ThreadPool/ThreadPool_test.cpp 2014-01-24 03:21:30 +0000
@@ -92,7 +92,7 @@
92 }92 }
93 catch (unity::InvalidArgumentException const& e)93 catch (unity::InvalidArgumentException const& e)
94 {94 {
95 EXPECT_EQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: 0", e.to_string());95 EXPECT_STREQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: 0", e.what());
96 }96 }
9797
98 try98 try
@@ -101,6 +101,6 @@
101 }101 }
102 catch (unity::InvalidArgumentException const& e)102 catch (unity::InvalidArgumentException const& e)
103 {103 {
104 EXPECT_EQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: -1", e.to_string());104 EXPECT_STREQ("unity::InvalidArgumentException: ThreadPool(): invalid pool size: -1", e.what());
105 }105 }
106}106}
107107
=== modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp'
--- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-01-16 13:40:51 +0000
+++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-01-24 03:21:30 +0000
@@ -176,9 +176,9 @@
176 }176 }
177 catch (MiddlewareException const& e)177 catch (MiddlewareException const& e)
178 {178 {
179 EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed "179 EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed "
180 "state (adapter: testscope)",180 "state (adapter: testscope)",
181 e.to_string());181 e.what());
182 }182 }
183 }183 }
184184
@@ -194,12 +194,12 @@
194 }194 }
195 catch (MiddlewareException const& e)195 catch (MiddlewareException const& e)
196 {196 {
197 EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::run_workers(): broker thread "197 EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::run_workers(): broker thread "
198 "failure (adapter: testscope):\n"198 "failure (adapter: testscope):\n"
199 " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure "199 " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure "
200 "(adapter: testscope):\n"200 "(adapter: testscope):\n"
201 " Address already in use",201 " Address already in use",
202 e.to_string());202 e.what());
203 }203 }
204 try204 try
205 {205 {
@@ -207,13 +207,13 @@
207 }207 }
208 catch (MiddlewareException const& e)208 catch (MiddlewareException const& e)
209 {209 {
210 EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n"210 EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n"
211 " Exception history:\n"211 " Exception history:\n"
212 " Exception #1:\n"212 " Exception #1:\n"
213 " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure "213 " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure "
214 "(adapter: testscope):\n"214 "(adapter: testscope):\n"
215 " Address already in use",215 " Address already in use",
216 e.to_string());216 e.what());
217 }217 }
218 try218 try
219 {219 {
@@ -221,13 +221,13 @@
221 }221 }
222 catch (MiddlewareException const& e)222 catch (MiddlewareException const& e)
223 {223 {
224 EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n"224 EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Failed state (adapter: testscope)\n"
225 " Exception history:\n"225 " Exception history:\n"
226 " Exception #1:\n"226 " Exception #1:\n"
227 " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure "227 " unity::scopes::MiddlewareException: ObjectAdapter: broker thread failure "
228 "(adapter: testscope):\n"228 "(adapter: testscope):\n"
229 " Address already in use",229 " Address already in use",
230 e.to_string());230 e.what());
231 }231 }
232 }232 }
233}233}
@@ -294,8 +294,8 @@
294 }294 }
295 catch (InvalidArgumentException const& e)295 catch (InvalidArgumentException const& e)
296 {296 {
297 EXPECT_EQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid empty id (adapter: testscope)",297 EXPECT_STREQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid empty id (adapter: testscope)",
298 e.to_string());298 e.what());
299 }299 }
300300
301 try301 try
@@ -305,8 +305,8 @@
305 }305 }
306 catch (InvalidArgumentException const& e)306 catch (InvalidArgumentException const& e)
307 {307 {
308 EXPECT_EQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid nullptr object (adapter: testscope)",308 EXPECT_STREQ("unity::InvalidArgumentException: ObjectAdapter::add(): invalid nullptr object (adapter: testscope)",
309 e.to_string());309 e.what());
310 }310 }
311311
312 shared_ptr<MyServant> o(new MyServant);312 shared_ptr<MyServant> o(new MyServant);
@@ -321,9 +321,9 @@
321 }321 }
322 catch (MiddlewareException const& e)322 catch (MiddlewareException const& e)
323 {323 {
324 EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::add(): cannot add id \"fred\":"324 EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::add(): cannot add id \"fred\":"
325 " id already in use (adapter: testscope)",325 " id already in use (adapter: testscope)",
326 e.to_string());326 e.what());
327 }327 }
328328
329 a.remove("fred");329 a.remove("fred");
@@ -333,9 +333,9 @@
333 }333 }
334 catch (MiddlewareException const& e)334 catch (MiddlewareException const& e)
335 {335 {
336 EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): cannot remove id \"fred\":"336 EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): cannot remove id \"fred\":"
337 " id not present (adapter: testscope)",337 " id not present (adapter: testscope)",
338 e.to_string());338 e.what());
339 }339 }
340340
341 EXPECT_EQ(nullptr, a.find("fred").get());341 EXPECT_EQ(nullptr, a.find("fred").get());
@@ -907,8 +907,8 @@
907 }907 }
908 catch (MiddlewareException const& e)908 catch (MiddlewareException const& e)
909 {909 {
910 EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed state (adapter: testscope)",910 EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed state (adapter: testscope)",
911 e.to_string());911 e.what());
912 }912 }
913 };913 };
914 a.add("fred", make_shared<UpdaterServant>(test_func));914 a.add("fred", make_shared<UpdaterServant>(test_func));
@@ -928,9 +928,9 @@
928 }928 }
929 catch (MiddlewareException const& e)929 catch (MiddlewareException const& e)
930 {930 {
931 EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): "931 EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): "
932 "cannot remove id \"fred\": id not present (adapter: testscope)",932 "cannot remove id \"fred\": id not present (adapter: testscope)",
933 e.to_string());933 e.what());
934 }934 }
935 };935 };
936 auto servant = make_shared<UpdaterServant>(test_func);936 auto servant = make_shared<UpdaterServant>(test_func);
@@ -952,9 +952,9 @@
952 }952 }
953 catch (MiddlewareException const& e)953 catch (MiddlewareException const& e)
954 {954 {
955 EXPECT_EQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): "955 EXPECT_STREQ("unity::scopes::MiddlewareException: ObjectAdapter::remove(): "
956 "cannot remove id \"fred\": id not present (adapter: testscope)",956 "cannot remove id \"fred\": id not present (adapter: testscope)",
957 e.to_string());957 e.what());
958 }958 }
959 };959 };
960 auto servant = make_shared<UpdaterServant>(test_func);960 auto servant = make_shared<UpdaterServant>(test_func);
@@ -1005,9 +1005,9 @@
1005 }1005 }
1006 catch (MiddlewareException const& e)1006 catch (MiddlewareException const& e)
1007 {1007 {
1008 EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed "1008 EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed "
1009 "state (adapter: testscope)",1009 "state (adapter: testscope)",
1010 e.to_string());1010 e.what());
1011 }1011 }
1012 try1012 try
1013 {1013 {
@@ -1016,9 +1016,9 @@
1016 }1016 }
1017 catch (MiddlewareException const& e)1017 catch (MiddlewareException const& e)
1018 {1018 {
1019 EXPECT_EQ("unity::scopes::MiddlewareException: Object adapter in Destroyed "1019 EXPECT_STREQ("unity::scopes::MiddlewareException: Object adapter in Destroyed "
1020 "state (adapter: testscope)",1020 "state (adapter: testscope)",
1021 e.to_string());1021 e.what());
1022 }1022 }
1023 }1023 }
1024}1024}
@@ -1196,9 +1196,9 @@
1196 }1196 }
1197 catch (InvalidArgumentException const& e)1197 catch (InvalidArgumentException const& e)
1198 {1198 {
1199 EXPECT_EQ("unity::InvalidArgumentException: ObjectAdapter::add_dflt_servant(): "1199 EXPECT_STREQ("unity::InvalidArgumentException: ObjectAdapter::add_dflt_servant(): "
1200 "invalid nullptr object (adapter: testscope)",1200 "invalid nullptr object (adapter: testscope)",
1201 e.to_string());1201 e.what());
1202 }1202 }
12031203
1204 ObjectAdapter b(mw, "testscope2", "ipc://testscope", RequestType::Oneway, 2);1204 ObjectAdapter b(mw, "testscope2", "ipc://testscope", RequestType::Oneway, 2);
12051205
=== modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp'
--- test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-01-21 04:38:37 +0000
+++ test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-01-24 03:21:30 +0000
@@ -58,34 +58,26 @@
5858
59TEST(RegistryI, get_metadata)59TEST(RegistryI, get_metadata)
60{60{
61 try61 vector<string> dummy_spawn_command;
62 {62 RuntimeImpl::UPtr runtime = RuntimeImpl::create(
63 vector<string> dummy_spawn_command;63 "TestRegistry", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/RegistryI/Runtime.ini");
64 RuntimeImpl::UPtr runtime = RuntimeImpl::create(64
65 "TestRegistry", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/RegistryI/Runtime.ini");65 string identity = runtime->registry_identity();
6666 RegistryConfig c(identity, runtime->registry_configfile());
67 string identity = runtime->registry_identity();67 string mw_kind = c.mw_kind();
68 RegistryConfig c(identity, runtime->registry_configfile());68 string mw_endpoint = c.endpoint();
69 string mw_kind = c.mw_kind();69 string mw_configfile = c.mw_configfile();
70 string mw_endpoint = c.endpoint();70
71 string mw_configfile = c.mw_configfile();71 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);
7272 RegistryObject::SPtr ro(make_shared<RegistryObject>());
73 MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile);73 auto registry = middleware->add_registry_object(identity, ro);
74 RegistryObject::SPtr ro(make_shared<RegistryObject>());74 auto p = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1");
75 auto registry = middleware->add_registry_object(identity, ro);75 EXPECT_TRUE(ro->add("scope1", move(make_meta("scope1", p, middleware)),
76 auto p = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1");76 dummy_spawn_command));
77 EXPECT_TRUE(ro->add("scope1", move(make_meta("scope1", p, middleware)),77
78 dummy_spawn_command));78 auto r = runtime->registry();
7979 auto scope = r->get_metadata("scope1");
80 auto r = runtime->registry();80 EXPECT_EQ("scope1", scope.scope_name());
81 auto scope = r->get_metadata("scope1");
82 EXPECT_EQ("scope1", scope.scope_name());
83 }
84 catch (unity::Exception const& e)
85 {
86 cerr << e.to_string() << endl;
87 FAIL();
88 }
89}81}
9082
91TEST(RegistryI, list)83TEST(RegistryI, list)
@@ -216,8 +208,8 @@
216 }208 }
217 catch (NotFoundException const& e)209 catch (NotFoundException const& e)
218 {210 {
219 EXPECT_EQ("unity::scopes::NotFoundException: Registry::get_metadata(): no such scope (name = fred)",211 EXPECT_STREQ("unity::scopes::NotFoundException: Registry::get_metadata(): no such scope (name = fred)",
220 e.to_string());212 e.what());
221 }213 }
222214
223 try215 try
@@ -227,9 +219,9 @@
227 }219 }
228 catch (MiddlewareException const& e)220 catch (MiddlewareException const& e)
229 {221 {
230 EXPECT_EQ("unity::scopes::MiddlewareException: unity::InvalidArgumentException: "222 EXPECT_STREQ("unity::scopes::MiddlewareException: unity::InvalidArgumentException: "
231 "Registry: Cannot search for scope with empty name",223 "Registry: Cannot search for scope with empty name",
232 e.to_string());224 e.what());
233 }225 }
234226
235 try227 try
@@ -240,8 +232,8 @@
240 }232 }
241 catch (InvalidArgumentException const& e)233 catch (InvalidArgumentException const& e)
242 {234 {
243 EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name",235 EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name",
244 e.to_string());236 e.what());
245 }237 }
246238
247 try239 try
@@ -251,8 +243,8 @@
251 }243 }
252 catch (InvalidArgumentException const& e)244 catch (InvalidArgumentException const& e)
253 {245 {
254 EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name",246 EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name",
255 e.to_string());247 e.what());
256 }248 }
257}249}
258250
@@ -298,7 +290,7 @@
298 auto r_proxy = dynamic_pointer_cast<ZmqRegistry>(r);290 auto r_proxy = dynamic_pointer_cast<ZmqRegistry>(r);
299 auto proxy = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1");291 auto proxy = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1");
300 mro->add("scope1", move(make_meta("scope1", proxy, middleware)),292 mro->add("scope1", move(make_meta("scope1", proxy, middleware)),
301 dummy_spawn_command);293 dummy_spawn_command);
302294
303 auto p = r_proxy->locate("scope1");295 auto p = r_proxy->locate("scope1");
304 EXPECT_EQ("scope1", p->identity());296 EXPECT_EQ("scope1", p->identity());
@@ -325,28 +317,27 @@
325 EXPECT_STREQ("unity::scopes::RegistryException: Couldn't start error_scope", e.what());317 EXPECT_STREQ("unity::scopes::RegistryException: Couldn't start error_scope", e.what());
326 }318 }
327319
328#if 0
329 try320 try
330 {321 {
331 auto proxy = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1");322 auto proxy = middleware->create_scope_proxy("scope1", "ipc:///tmp/scope1");
332 ro->add("", move(make_meta("blah", proxy, middleware)));323 mro->add("", move(make_meta("blah", proxy, middleware)),
324 dummy_spawn_command);
333 FAIL();325 FAIL();
334 }326 }
335 catch (InvalidArgumentException const& e)327 catch (InvalidArgumentException const& e)
336 {328 {
337 EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name",329 EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot add scope with empty name",
338 e.to_string());330 e.what());
339 }331 }
340332
341 try333 try
342 {334 {
343 ro->remove("");335 mro->remove("");
344 FAIL();336 FAIL();
345 }337 }
346 catch (InvalidArgumentException const& e)338 catch (InvalidArgumentException const& e)
347 {339 {
348 EXPECT_EQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name",340 EXPECT_STREQ("unity::InvalidArgumentException: Registry: Cannot remove scope with empty name",
349 e.to_string());341 e.what());
350 }342 }
351#endif
352}343}

Subscribers

People subscribed via source and target branches

to all changes: