Merge lp:~marcustomlinson/unity-scopes-api/cleanup into lp:unity-scopes-api/devel

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Michi Henning
Approved revision: 546
Merged at revision: 545
Proposed branch: lp:~marcustomlinson/unity-scopes-api/cleanup
Merge into: lp:unity-scopes-api/devel
Diff against target: 211 lines (+26/-23)
10 files modified
include/unity/scopes/ScopeBase.h (+2/-2)
include/unity/scopes/internal/TaskWrapper.h (+2/-2)
src/scopes/internal/CannedQueryImpl.cpp (+1/-1)
src/scopes/internal/DepartmentImpl.cpp (+1/-1)
src/scopes/internal/PreviewWidgetImpl.cpp (+2/-2)
src/scopes/internal/smartscopes/SmartScope.cpp (+1/-1)
src/scopes/internal/smartscopes/SmartScopesClient.cpp (+12/-9)
test/gtest/scopes/Activation/Activation_test.cpp (+1/-1)
test/gtest/scopes/CannedQuery/CannedQuery_test.cpp (+3/-3)
test/gtest/scopes/internal/ResultReplyObject/ResultReplyObject_test.cpp (+1/-1)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/cleanup
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michi Henning (community) Approve
Review via email: mp+243258@code.launchpad.net

Commit message

Cleaned up odds and ends in the code

To post a comment you must log in.
Revision history for this message
Michi Henning (michihenning) wrote :

Yes, thank you!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
546. By Marcus Tomlinson

Fixed CannedQuery_test

Revision history for this message
Michi Henning (michihenning) wrote :

OK, let's try again :-)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/unity/scopes/ScopeBase.h'
2--- include/unity/scopes/ScopeBase.h 2014-11-13 03:09:45 +0000
3+++ include/unity/scopes/ScopeBase.h 2014-12-01 13:10:41 +0000
4@@ -72,7 +72,7 @@
5 namespace testing
6 {
7
8-struct TypedScopeFixtureHelper;
9+class TypedScopeFixtureHelper;
10
11 }
12
13@@ -338,7 +338,7 @@
14
15 friend class internal::RuntimeImpl;
16 friend class internal::ScopeObject;
17- friend struct testing::TypedScopeFixtureHelper;
18+ friend class testing::TypedScopeFixtureHelper;
19 /// @endcond
20 };
21
22
23=== modified file 'include/unity/scopes/internal/TaskWrapper.h'
24--- include/unity/scopes/internal/TaskWrapper.h 2014-11-03 05:31:30 +0000
25+++ include/unity/scopes/internal/TaskWrapper.h 2014-12-01 13:10:41 +0000
26@@ -66,7 +66,7 @@
27 {
28 virtual void call() = 0;
29 virtual bool valid() const = 0;
30- virtual ~WrapperBase() {};
31+ virtual ~WrapperBase() {}
32 };
33
34 template<typename F>
35@@ -79,7 +79,7 @@
36 {
37 }
38
39- virtual ~WrapperType() {};
40+ virtual ~WrapperType() {}
41
42 void call()
43 {
44
45=== modified file 'src/scopes/internal/CannedQueryImpl.cpp'
46--- src/scopes/internal/CannedQueryImpl.cpp 2014-08-18 17:20:32 +0000
47+++ src/scopes/internal/CannedQueryImpl.cpp 2014-12-01 13:10:41 +0000
48@@ -169,7 +169,7 @@
49 catch (InvalidArgumentException const& e)
50 {
51 std::stringstream err;
52- err << "Failed to decode key '" << key_name << "' of uri '" << uri;
53+ err << "Failed to decode key '" << key_name << "' of uri '" << uri << "'";
54 throw InvalidArgumentException(err.str());
55 }
56 }
57
58=== modified file 'src/scopes/internal/DepartmentImpl.cpp'
59--- src/scopes/internal/DepartmentImpl.cpp 2014-05-30 08:56:47 +0000
60+++ src/scopes/internal/DepartmentImpl.cpp 2014-12-01 13:10:41 +0000
61@@ -79,7 +79,7 @@
62 if (department == nullptr)
63 {
64 std::stringstream str;
65- str << "DepartmentImpl::add_subdepartment(): invalid null department, parent department '", id();
66+ str << "DepartmentImpl::add_subdepartment(): invalid null department, parent department '" << id() << "'";
67 throw InvalidArgumentException(str.str());
68 }
69 departments_.push_back(department);
70
71=== modified file 'src/scopes/internal/PreviewWidgetImpl.cpp'
72--- src/scopes/internal/PreviewWidgetImpl.cpp 2014-08-21 15:06:12 +0000
73+++ src/scopes/internal/PreviewWidgetImpl.cpp 2014-12-01 13:10:41 +0000
74@@ -200,7 +200,7 @@
75 {
76 if (w.id() == widget.id())
77 {
78- throw unity::LogicException("PreviewWidget::add_widget(): widget '" + widget.id() + "' already added to widget '" + id_);
79+ throw unity::LogicException("PreviewWidget::add_widget(): widget '" + widget.id() + "' already added to widget '" + id_ + "'");
80 }
81 }
82 widgets_.push_back(widget);
83@@ -286,7 +286,7 @@
84 {
85 if (value.empty())
86 {
87- throw InvalidArgumentException("PreviewWidget: required attribute " + name + " is empty");
88+ throw InvalidArgumentException("PreviewWidget: required attribute '" + name + "' is empty");
89 }
90 }
91
92
93=== modified file 'src/scopes/internal/smartscopes/SmartScope.cpp'
94--- src/scopes/internal/smartscopes/SmartScope.cpp 2014-11-25 23:31:51 +0000
95+++ src/scopes/internal/smartscopes/SmartScope.cpp 2014-12-01 13:10:41 +0000
96@@ -132,7 +132,7 @@
97 {
98 BOOST_LOG_SEV(this->ss_client_->logger(), Logger::Error)
99 << "SmartScope: failed to register category: \"" << category->id
100- << "\" for scope \"" << scope_id_ << "\" and query: \"" << query_.query_string();
101+ << "\" for scope \"" << scope_id_ << "\" and query: \"" << query_.query_string() << "\"";
102 }
103 };
104 handler.result_handler = [this, reply](SearchResult const& result) {
105
106=== modified file 'src/scopes/internal/smartscopes/SmartScopesClient.cpp'
107--- src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-11-30 07:29:55 +0000
108+++ src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-12-01 13:10:41 +0000
109@@ -292,10 +292,11 @@
110 scope.version = child_node->has_node("version") ? child_node->get_node("version")->as_int() : 0;
111 if (scope.version < 0)
112 {
113- std::cerr << "SmartScopesClient.get_remote_scopes(): Scope: \"" << scope.id
114- << "\" returned a negative \"version\" value" << std::endl;
115- std::cerr << "SmartScopesClient.get_remote_scopes(): Skipping scope: \""
116- << scope.id << "\"" << std::endl;
117+ BOOST_LOG_SEV(logger_, Logger::Error)
118+ << "SmartScopesClient.get_remote_scopes(): Scope: \"" << scope.id
119+ << "\" returned a negative \"version\" value";
120+ BOOST_LOG_SEV(logger_, Logger::Error)
121+ << "SmartScopesClient.get_remote_scopes(): Skipping scope: \"" << scope.id << "\"";
122 continue;
123 }
124
125@@ -313,15 +314,17 @@
126 }
127 catch (unity::LogicException const& e)
128 {
129- std::cerr << "SmartScopesClient.get_remote_scopes(): Scope: \""
130- << scope.id << "\" returned a non-string tag" << std::endl;
131+ BOOST_LOG_SEV(logger_, Logger::Error)
132+ << "SmartScopesClient.get_remote_scopes(): Scope: \"" << scope.id
133+ << "\" returned a non-string tag";
134 }
135 }
136 }
137 else
138 {
139- std::cerr << "SmartScopesClient.get_remote_scopes(): Scope: \""
140- << scope.id << "\" returned an invalid value type for \"tags\"" << std::endl;
141+ BOOST_LOG_SEV(logger_, Logger::Error)
142+ << "SmartScopesClient.get_remote_scopes(): Scope: \"" << scope.id
143+ << "\" returned an invalid value type for \"tags\"";
144 }
145 }
146
147@@ -732,7 +735,7 @@
148 if(subdeps->size() > 0 && dep->subdepartments.size() == 0)
149 {
150 std::stringstream err;
151- err << "SmartScopesClient::parse_departments(): Failed to parse subdepartments of department '" << dep->label;
152+ err << "SmartScopesClient::parse_departments(): Failed to parse subdepartments of department '" << dep->label << "'";
153 throw LogicException(err.str());
154 }
155 }
156
157=== modified file 'test/gtest/scopes/Activation/Activation_test.cpp'
158--- test/gtest/scopes/Activation/Activation_test.cpp 2014-09-05 04:00:28 +0000
159+++ test/gtest/scopes/Activation/Activation_test.cpp 2014-12-01 13:10:41 +0000
160@@ -41,7 +41,7 @@
161 DummyReceiver(std::function<void(CategorisedResult)> push_func)
162 {
163 push_func_ = push_func;
164- };
165+ }
166
167 void push(CategorisedResult result) override
168 {
169
170=== modified file 'test/gtest/scopes/CannedQuery/CannedQuery_test.cpp'
171--- test/gtest/scopes/CannedQuery/CannedQuery_test.cpp 2014-08-18 17:20:32 +0000
172+++ test/gtest/scopes/CannedQuery/CannedQuery_test.cpp 2014-12-01 13:10:41 +0000
173@@ -151,7 +151,7 @@
174 }
175 catch (unity::InvalidArgumentException const& e)
176 {
177- EXPECT_STREQ("unity::InvalidArgumentException: Failed to decode key 'q' of uri 'scope://foo?q=%:\n"
178+ EXPECT_STREQ("unity::InvalidArgumentException: Failed to decode key 'q' of uri 'scope://foo?q=%':\n"
179 " unity::InvalidArgumentException: from_percent_encoding(): too few characters for percent-encoded value",
180 e.what());
181 }
182@@ -165,7 +165,7 @@
183 }
184 catch (unity::InvalidArgumentException const& e)
185 {
186- EXPECT_STREQ("unity::InvalidArgumentException: Failed to decode key 'q' of uri 'scope://foo?q=%0:\n"
187+ EXPECT_STREQ("unity::InvalidArgumentException: Failed to decode key 'q' of uri 'scope://foo?q=%0':\n"
188 " unity::InvalidArgumentException: from_percent_encoding(): too few characters for percent-encoded value",
189 e.what());
190 }
191@@ -179,7 +179,7 @@
192 }
193 catch (unity::InvalidArgumentException const& e)
194 {
195- EXPECT_STREQ("unity::InvalidArgumentException: Failed to decode key 'dep' of uri 'scope://foo?dep=%qy:\n"
196+ EXPECT_STREQ("unity::InvalidArgumentException: Failed to decode key 'dep' of uri 'scope://foo?dep=%qy':\n"
197 " unity::InvalidArgumentException: from_percent_encoding(): unsupported conversion of 'qy':\n stoi",
198 e.what());
199 }
200
201=== modified file 'test/gtest/scopes/internal/ResultReplyObject/ResultReplyObject_test.cpp'
202--- test/gtest/scopes/internal/ResultReplyObject/ResultReplyObject_test.cpp 2014-07-28 08:30:35 +0000
203+++ test/gtest/scopes/internal/ResultReplyObject/ResultReplyObject_test.cpp 2014-12-01 13:10:41 +0000
204@@ -34,7 +34,7 @@
205 DummyReceiver(std::function<void(Department::SCPtr const&)> departments_push_func)
206 {
207 departments_push_func_ = departments_push_func;
208- };
209+ }
210
211 void push(CategorisedResult) override {}
212

Subscribers

People subscribed via source and target branches

to all changes: