Merge lp:~marcustomlinson/unity-scopes-api/keywords_as_set into lp:unity-scopes-api

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 618
Merged at revision: 296
Proposed branch: lp:~marcustomlinson/unity-scopes-api/keywords_as_set
Merge into: lp:unity-scopes-api
Prerequisite: lp:~marcustomlinson/unity-scopes-api/child_scopes_ordered
Diff against target: 461 lines (+61/-50)
21 files modified
CMakeLists.txt (+1/-1)
RELEASE_NOTES.md (+4/-0)
STRUCTS (+1/-1)
debian/changelog (+6/-0)
debian/libunity-scopes3.symbols (+2/-2)
include/unity/scopes/ScopeMetadata.h (+5/-5)
include/unity/scopes/internal/ScopeConfig.h (+2/-2)
include/unity/scopes/internal/ScopeMetadataImpl.h (+3/-3)
include/unity/scopes/internal/smartscopes/SmartScopesClient.h (+1/-1)
include/unity/scopes/testing/ScopeMetadataBuilder.h (+1/-1)
src/scopes/ScopeMetadata.cpp (+1/-1)
src/scopes/internal/ScopeConfig.cpp (+3/-2)
src/scopes/internal/ScopeMetadataImpl.cpp (+3/-3)
src/scopes/internal/smartscopes/SmartScopesClient.cpp (+1/-1)
src/scopes/testing/ScopeMetadataBuilder.cpp (+2/-2)
test/gtest/scopes/Registry/Registry_test.cpp (+3/-3)
test/gtest/scopes/internal/ScopeConfig/ScopeConfig_test.cpp (+2/-2)
test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp (+11/-11)
test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp (+4/-4)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp (+4/-4)
test/gtest/scopes/testing/IsolatedScope/IsolatedScope_test.cpp (+1/-1)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/keywords_as_set
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+247708@code.launchpad.net

Commit message

Return keywords as a set rather than a vector so that searching for keywords from an aggregator is easier and more efficient.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
616. By Marcus Tomlinson

Simplified instantiation of keywords_ in ScopeConfig

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 :

Version should be bumped, no?

review: Needs Information
617. By Marcus Tomlinson

Merged trunk

618. By Marcus Tomlinson

Bumped version number

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> Version should be bumped, no?

Yeah, good point. Done.

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 :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-01-27 09:38:33 +0000
3+++ CMakeLists.txt 2015-01-28 09:06:40 +0000
4@@ -227,7 +227,7 @@
5 # API version
6 set(UNITY_SCOPES_MAJOR 0)
7 set(UNITY_SCOPES_MINOR 6)
8-set(UNITY_SCOPES_MICRO 12)
9+set(UNITY_SCOPES_MICRO 13)
10 set(UNITY_SCOPES_SOVERSION 3)
11
12 # Version for testing, with all symbols visible
13
14=== modified file 'RELEASE_NOTES.md'
15--- RELEASE_NOTES.md 2015-01-26 08:20:45 +0000
16+++ RELEASE_NOTES.md 2015-01-28 09:06:40 +0000
17@@ -1,6 +1,10 @@
18 Release notes
19 =============
20
21+Changes in version 0.6.13
22+=========================
23+ - Return keywords as a set rather than a vector.
24+
25 Changes in version 0.6.12
26 =========================
27 - Introduced child_scopes() methods for aggregators to return their
28
29=== modified file 'STRUCTS'
30--- STRUCTS 2014-12-16 09:08:12 +0000
31+++ STRUCTS 2015-01-28 09:06:40 +0000
32@@ -79,7 +79,7 @@
33 'location_data_needed' : bool, optional
34 'child_scopes' : array of strings, optional
35 'version' : int, optional
36- 'keywords' : array of strings, optional
37+ 'keywords' : set of strings, optional
38 'is_aggregator' : bool, optional
39
40 Query (returned by serialize())
41
42=== modified file 'debian/changelog'
43--- debian/changelog 2015-01-27 09:38:46 +0000
44+++ debian/changelog 2015-01-28 09:06:40 +0000
45@@ -1,3 +1,9 @@
46+unity-scopes-api (0.6.13-0ubuntu1) UNRELEASED; urgency=medium
47+
48+ * Return keywords as a set rather than a vector.
49+
50+ -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Wed, 28 Jan 2015 11:04:15 +0200
51+
52 unity-scopes-api (0.6.12+15.04.20150127.2-0ubuntu1) vivid; urgency=medium
53
54 [ Marcus Tomlinson ]
55
56=== modified file 'debian/libunity-scopes3.symbols'
57--- debian/libunity-scopes3.symbols 2015-01-27 09:38:42 +0000
58+++ debian/libunity-scopes3.symbols 2015-01-28 09:06:40 +0000
59@@ -530,7 +530,7 @@
60 (c++)"unity::scopes::internal::ScopeMetadataImpl::set_icon(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
61 (c++)"unity::scopes::internal::ScopeMetadataImpl::set_invisible(bool)@Base" 0.4.0+14.04.20140312.1
62 (c++)"unity::scopes::internal::ScopeMetadataImpl::set_is_aggregator(bool)@Base" 0.6.10+15.04.20141210.2
63- (c++)"unity::scopes::internal::ScopeMetadataImpl::set_keywords(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 0.6.9+15.04.20141129
64+ (c++)"unity::scopes::internal::ScopeMetadataImpl::set_keywords(std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 0replaceme
65 (c++)"unity::scopes::internal::ScopeMetadataImpl::set_location_data_needed(bool)@Base" 0.5.2+14.10.20140709.2
66 (c++)"unity::scopes::internal::ScopeMetadataImpl::set_proxy(std::shared_ptr<unity::scopes::Scope> const&)@Base" 0.4.0+14.04.20140312.1
67 (c++)"unity::scopes::internal::ScopeMetadataImpl::set_results_ttl_type(unity::scopes::ScopeMetadata::ResultsTtlType)@Base" 0.4.6+14.10.20140519
68@@ -895,7 +895,7 @@
69 (c++)"unity::scopes::testing::ScopeMetadataBuilder::icon(unity::scopes::testing::ScopeMetadataBuilder::Optional<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)@Base" 0.4.0+14.04.20140312.1
70 (c++)"unity::scopes::testing::ScopeMetadataBuilder::invisible(unity::scopes::testing::ScopeMetadataBuilder::Optional<bool> const&)@Base" 0.5.0+14.10.20140619
71 (c++)"unity::scopes::testing::ScopeMetadataBuilder::is_aggregator(unity::scopes::testing::ScopeMetadataBuilder::Optional<bool> const&)@Base" 0.6.10+15.04.20141210.2
72- (c++)"unity::scopes::testing::ScopeMetadataBuilder::keywords(unity::scopes::testing::ScopeMetadataBuilder::Optional<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)@Base" 0.6.9+15.04.20141129
73+ (c++)"unity::scopes::testing::ScopeMetadataBuilder::keywords(unity::scopes::testing::ScopeMetadataBuilder::Optional<std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)@Base" 0replaceme
74 (c++)"unity::scopes::testing::ScopeMetadataBuilder::location_data_needed(unity::scopes::testing::ScopeMetadataBuilder::Optional<bool> const&)@Base" 0.6.9+15.04.20141129
75 (c++)"unity::scopes::testing::ScopeMetadataBuilder::operator()() const@Base" 0.4.0+14.04.20140312.1
76 (c++)"unity::scopes::testing::ScopeMetadataBuilder::proxy(std::shared_ptr<unity::scopes::Scope> const&)@Base" 0.4.0+14.04.20140312.1
77
78=== modified file 'include/unity/scopes/ScopeMetadata.h'
79--- include/unity/scopes/ScopeMetadata.h 2014-12-03 08:09:25 +0000
80+++ include/unity/scopes/ScopeMetadata.h 2015-01-28 09:06:40 +0000
81@@ -19,7 +19,7 @@
82 #pragma once
83
84 #include <unity/scopes/Scope.h>
85-#include <vector>
86+#include <set>
87
88 namespace unity
89 {
90@@ -204,14 +204,14 @@
91 int version() const;
92
93 /**
94- \brief Return the list of keywords specified by this scope.
95+ \brief Return the set of keywords specified by this scope.
96
97- The list returned by this method is formulated from the value specified under
98+ The set returned by this method is formulated from the value specified under
99 the "Keywords" key in the scope's .ini file.
100
101- \return The list of scope keywords specified by this scope.
102+ \return The set of keywords specified by this scope.
103 */
104- std::vector<std::string> keywords() const;
105+ std::set<std::string> keywords() const;
106
107 /**
108 \brief Check if this scope is an aggregator.
109
110=== modified file 'include/unity/scopes/internal/ScopeConfig.h'
111--- include/unity/scopes/internal/ScopeConfig.h 2014-12-03 08:10:51 +0000
112+++ include/unity/scopes/internal/ScopeConfig.h 2015-01-28 09:06:40 +0000
113@@ -54,7 +54,7 @@
114 bool debug_mode() const; // Optional, returns false if not present
115 std::vector<std::string> child_scope_ids() const; // Optional, returns an empty vector if no ids are present
116 int version() const; // Optional, returns 0 if not present
117- std::vector<std::string> keywords() const; // Optional, returns an empty vector if no keywords are present
118+ std::set<std::string> keywords() const; // Optional, returns an empty set if no keywords are present
119 bool is_aggregator() const; // Optional, returns false if not present
120
121 VariantMap appearance_attributes() const; // Optional, returns empty map if no attributes are present
122@@ -78,7 +78,7 @@
123 bool debug_mode_;
124 std::vector<std::string> child_scope_ids_;
125 int version_;
126- std::vector<std::string> keywords_;
127+ std::set<std::string> keywords_;
128 bool is_aggregator_;
129
130 VariantMap appearance_attributes_;
131
132=== modified file 'include/unity/scopes/internal/ScopeMetadataImpl.h'
133--- include/unity/scopes/internal/ScopeMetadataImpl.h 2014-12-03 08:27:13 +0000
134+++ include/unity/scopes/internal/ScopeMetadataImpl.h 2015-01-28 09:06:40 +0000
135@@ -59,7 +59,7 @@
136 bool location_data_needed() const; // optional (default: false)
137 std::vector<std::string> child_scope_ids() const; // optional (default: empty array)
138 int version() const; // optional (default: 0)
139- std::vector<std::string> keywords() const; // optional (default: empty array)
140+ std::set<std::string> keywords() const; // optional (default: empty set)
141 bool is_aggregator() const; // optional (default: false)
142
143 void set_scope_id(std::string const& scope_id);
144@@ -79,7 +79,7 @@
145 void set_location_data_needed(bool location_data_needed);
146 void set_child_scope_ids(std::vector<std::string> const& ids);
147 void set_version(int v);
148- void set_keywords(std::vector<std::string> const& keywords);
149+ void set_keywords(std::set<std::string> const& keywords);
150 void set_is_aggregator(bool is_aggregator);
151
152 VariantMap serialize() const;
153@@ -107,7 +107,7 @@
154 std::unique_ptr<bool> location_data_needed_; // Optional, hence a pointer
155 std::vector<std::string> child_scope_ids_;
156 int version_;
157- std::vector<std::string> keywords_;
158+ std::set<std::string> keywords_;
159 std::unique_ptr<bool> is_aggregator_; // Optional, hence a pointer
160 };
161
162
163=== modified file 'include/unity/scopes/internal/smartscopes/SmartScopesClient.h'
164--- include/unity/scopes/internal/smartscopes/SmartScopesClient.h 2015-01-22 03:54:58 +0000
165+++ include/unity/scopes/internal/smartscopes/SmartScopesClient.h 2015-01-28 09:06:40 +0000
166@@ -64,7 +64,7 @@
167 std::shared_ptr<bool> needs_location_data; // optional
168 bool invisible = false;
169 int version;
170- std::vector<std::string> keywords; // optional
171+ std::set<std::string> keywords; // optional
172 };
173
174 struct SearchCategory
175
176=== modified file 'include/unity/scopes/testing/ScopeMetadataBuilder.h'
177--- include/unity/scopes/testing/ScopeMetadataBuilder.h 2014-12-03 08:17:18 +0000
178+++ include/unity/scopes/testing/ScopeMetadataBuilder.h 2015-01-28 09:06:40 +0000
179@@ -97,7 +97,7 @@
180 ScopeMetadataBuilder& location_data_needed(Optional<bool> const& value);
181 ScopeMetadataBuilder& child_scope_ids(Optional<std::vector<std::string>> const& value);
182 ScopeMetadataBuilder& version(Optional<int> const& value);
183- ScopeMetadataBuilder& keywords(Optional<std::vector<std::string>> const& value);
184+ ScopeMetadataBuilder& keywords(Optional<std::set<std::string>> const& value);
185 ScopeMetadataBuilder& is_aggregator(Optional<bool> const& value);
186
187 ScopeMetadata operator()() const;
188
189=== modified file 'src/scopes/ScopeMetadata.cpp'
190--- src/scopes/ScopeMetadata.cpp 2014-12-03 08:19:22 +0000
191+++ src/scopes/ScopeMetadata.cpp 2015-01-28 09:06:40 +0000
192@@ -157,7 +157,7 @@
193 return p->version();
194 }
195
196-std::vector<std::string> ScopeMetadata::keywords() const
197+std::set<std::string> ScopeMetadata::keywords() const
198 {
199 return p->keywords();
200 }
201
202=== modified file 'src/scopes/internal/ScopeConfig.cpp'
203--- src/scopes/internal/ScopeConfig.cpp 2014-12-03 08:22:11 +0000
204+++ src/scopes/internal/ScopeConfig.cpp 2015-01-28 09:06:40 +0000
205@@ -224,7 +224,8 @@
206
207 try
208 {
209- keywords_ = parser()->get_string_array(scope_config_group, keywords_key);
210+ auto keywords_vec = parser()->get_string_array(scope_config_group, keywords_key);
211+ keywords_ = set<string>(keywords_vec.begin(), keywords_vec.end());
212 }
213 catch (LogicException const&)
214 {
215@@ -472,7 +473,7 @@
216 return version_;
217 }
218
219-std::vector<std::string> ScopeConfig::keywords() const
220+std::set<std::string> ScopeConfig::keywords() const
221 {
222 return keywords_;
223 }
224
225=== modified file 'src/scopes/internal/ScopeMetadataImpl.cpp'
226--- src/scopes/internal/ScopeMetadataImpl.cpp 2015-01-09 03:16:51 +0000
227+++ src/scopes/internal/ScopeMetadataImpl.cpp 2015-01-28 09:06:40 +0000
228@@ -246,7 +246,7 @@
229 return version_;
230 }
231
232-std::vector<std::string> ScopeMetadataImpl::keywords() const
233+std::set<std::string> ScopeMetadataImpl::keywords() const
234 {
235 return keywords_;
236 }
237@@ -354,7 +354,7 @@
238 version_ = v;
239 }
240
241-void ScopeMetadataImpl::set_keywords(std::vector<std::string> const& keywords)
242+void ScopeMetadataImpl::set_keywords(std::set<std::string> const& keywords)
243 {
244 keywords_ = keywords;
245 }
246@@ -608,7 +608,7 @@
247 {
248 for (auto const& v: it->second.get_array())
249 {
250- keywords_.push_back(v.get_string());
251+ keywords_.emplace(v.get_string());
252 }
253 }
254
255
256=== modified file 'src/scopes/internal/smartscopes/SmartScopesClient.cpp'
257--- src/scopes/internal/smartscopes/SmartScopesClient.cpp 2015-01-27 09:38:24 +0000
258+++ src/scopes/internal/smartscopes/SmartScopesClient.cpp 2015-01-28 09:06:40 +0000
259@@ -337,7 +337,7 @@
260 {
261 try
262 {
263- scope.keywords.push_back(keyword.get_string());
264+ scope.keywords.emplace(keyword.get_string());
265 }
266 catch (unity::LogicException const& e)
267 {
268
269=== modified file 'src/scopes/testing/ScopeMetadataBuilder.cpp'
270--- src/scopes/testing/ScopeMetadataBuilder.cpp 2014-12-03 08:28:46 +0000
271+++ src/scopes/testing/ScopeMetadataBuilder.cpp 2015-01-28 09:06:40 +0000
272@@ -48,7 +48,7 @@
273 Optional<bool> location_data_needed;
274 Optional<std::vector<std::string>> child_scope_ids;
275 Optional<int> version;
276- Optional<std::vector<std::string>> keywords;
277+ Optional<std::set<std::string>> keywords;
278 Optional<bool> is_aggregator;
279 };
280
281@@ -162,7 +162,7 @@
282 return *this;
283 }
284
285-testing::ScopeMetadataBuilder& testing::ScopeMetadataBuilder::keywords(Optional<std::vector<std::string>> const& value)
286+testing::ScopeMetadataBuilder& testing::ScopeMetadataBuilder::keywords(Optional<std::set<std::string>> const& value)
287 {
288 p->keywords = value;
289 return *this;
290
291=== modified file 'test/gtest/scopes/Registry/Registry_test.cpp'
292--- test/gtest/scopes/Registry/Registry_test.cpp 2014-12-03 09:25:10 +0000
293+++ test/gtest/scopes/Registry/Registry_test.cpp 2015-01-28 09:06:40 +0000
294@@ -113,9 +113,9 @@
295 EXPECT_EQ(1, meta.version());
296 auto keywords = meta.keywords();
297 EXPECT_EQ(3u, keywords.size());
298- EXPECT_EQ("music", keywords[0]);
299- EXPECT_EQ("news", keywords[1]);
300- EXPECT_EQ("foo", keywords[2]);
301+ EXPECT_NE(keywords.end(), keywords.find("music"));
302+ EXPECT_NE(keywords.end(), keywords.find("news"));
303+ EXPECT_NE(keywords.end(), keywords.find("foo"));
304 EXPECT_FALSE(meta.is_aggregator());
305
306 auto attrs = meta.appearance_attributes();
307
308=== modified file 'test/gtest/scopes/internal/ScopeConfig/ScopeConfig_test.cpp'
309--- test/gtest/scopes/internal/ScopeConfig/ScopeConfig_test.cpp 2014-12-03 09:25:10 +0000
310+++ test/gtest/scopes/internal/ScopeConfig/ScopeConfig_test.cpp 2015-01-28 09:06:40 +0000
311@@ -59,8 +59,8 @@
312
313 auto keywords = cfg.keywords();
314 EXPECT_EQ(2u, keywords.size());
315- EXPECT_EQ("foo", keywords[0]);
316- EXPECT_EQ("bar", keywords[1]);
317+ EXPECT_NE(keywords.end(), keywords.find("foo"));
318+ EXPECT_NE(keywords.end(), keywords.find("bar"));
319
320 EXPECT_TRUE(cfg.is_aggregator());
321
322
323=== modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp'
324--- test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2015-01-09 03:16:51 +0000
325+++ test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2015-01-28 09:06:40 +0000
326@@ -165,7 +165,7 @@
327 mi2->set_settings_definitions(va);
328 mi2->set_location_data_needed(true);
329 mi2->set_child_scope_ids(vector<string>{"abc", "def"});
330- mi2->set_keywords(vector<string>{"music", "video", "news"});
331+ mi2->set_keywords(set<string>{"music", "video", "news"});
332 mi2->set_is_aggregator(true);
333
334 // Make another copy, so we get coverage on the entire copy constructor
335@@ -180,7 +180,7 @@
336 EXPECT_EQ(va, m.settings_definitions());
337 EXPECT_TRUE(m.location_data_needed());
338 EXPECT_EQ((vector<string>{"abc", "def"}), m.child_scope_ids());
339- EXPECT_EQ((vector<string>{"music", "video", "news"}), m.keywords());
340+ EXPECT_EQ((set<string>{"music", "video", "news"}), m.keywords());
341 EXPECT_TRUE(m.is_aggregator());
342
343 // Make another value
344@@ -205,7 +205,7 @@
345 ti->set_settings_definitions(tmp_va);
346 ti->set_location_data_needed(true);
347 ti->set_child_scope_ids(vector<string>{"tmp abc", "tmp def"});
348- ti->set_keywords(vector<string>{"music", "video"});
349+ ti->set_keywords(set<string>{"music", "video"});
350 ti->set_is_aggregator(true);
351
352 // Check impl assignment operator
353@@ -229,7 +229,7 @@
354 EXPECT_TRUE(ci.location_data_needed());
355 EXPECT_EQ((vector<string>{"tmp abc", "tmp def"}), ci.child_scope_ids());
356 EXPECT_EQ(99, ci.version());
357- EXPECT_EQ((vector<string>{"music", "video"}), ci.keywords());
358+ EXPECT_EQ((set<string>{"music", "video"}), ci.keywords());
359 EXPECT_TRUE(ci.is_aggregator());
360
361 // Check public assignment operator
362@@ -253,7 +253,7 @@
363 EXPECT_EQ(tmp_va, m.settings_definitions());
364 EXPECT_TRUE(m.location_data_needed());
365 EXPECT_EQ((vector<string>{"tmp abc", "tmp def"}), m.child_scope_ids());
366- EXPECT_EQ((vector<string>{"music", "video"}), m.keywords());
367+ EXPECT_EQ((set<string>{"music", "video"}), m.keywords());
368 EXPECT_TRUE(m.is_aggregator());
369
370 // Self-assignment
371@@ -276,7 +276,7 @@
372 EXPECT_EQ(tmp_va, tmp.settings_definitions());
373 EXPECT_TRUE(tmp.location_data_needed());
374 EXPECT_EQ((vector<string>{"tmp abc", "tmp def"}), tmp.child_scope_ids());
375- EXPECT_EQ((vector<string>{"music", "video"}), tmp.keywords());
376+ EXPECT_EQ((set<string>{"music", "video"}), tmp.keywords());
377 EXPECT_TRUE(tmp.is_aggregator());
378
379 // Copy constructor
380@@ -299,7 +299,7 @@
381 EXPECT_EQ(tmp_va, tmp2.settings_definitions());
382 EXPECT_TRUE(tmp2.location_data_needed());
383 EXPECT_EQ((vector<string>{"tmp abc", "tmp def"}), tmp2.child_scope_ids());
384- EXPECT_EQ((vector<string>{"music", "video"}), tmp2.keywords());
385+ EXPECT_EQ((set<string>{"music", "video"}), tmp2.keywords());
386 EXPECT_TRUE(tmp2.is_aggregator());
387 }
388
389@@ -360,8 +360,8 @@
390 EXPECT_EQ("com.foo.bar", var["child_scopes"].get_array()[0].get_string());
391 EXPECT_EQ("com.foo.baz", var["child_scopes"].get_array()[1].get_string());
392 EXPECT_EQ(2u, var["keywords"].get_array().size());
393- EXPECT_EQ("news", var["keywords"].get_array()[0].get_string());
394- EXPECT_EQ("games", var["keywords"].get_array()[1].get_string());
395+ EXPECT_EQ("games", var["keywords"].get_array()[0].get_string());
396+ EXPECT_EQ("news", var["keywords"].get_array()[1].get_string());
397 EXPECT_FALSE(var["is_aggregator"].get_bool());
398
399 // Make another instance from the VariantMap and check its fields
400@@ -388,8 +388,8 @@
401 EXPECT_EQ("com.foo.bar", c.child_scope_ids()[0]);
402 EXPECT_EQ("com.foo.baz", c.child_scope_ids()[1]);
403 EXPECT_EQ(2u, c.keywords().size());
404- EXPECT_EQ("news", c.keywords()[0]);
405- EXPECT_EQ("games", c.keywords()[1]);
406+ EXPECT_NE(c.keywords().end(), c.keywords().find("news"));
407+ EXPECT_NE(c.keywords().end(), c.keywords().find("games"));
408 EXPECT_FALSE(c.is_aggregator());
409 }
410
411
412=== modified file 'test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp'
413--- test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp 2015-01-20 08:25:39 +0000
414+++ test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp 2015-01-28 09:06:40 +0000
415@@ -138,10 +138,10 @@
416 "\"enabled\",\"parameters\":{\"defaultValue\":true},\"type\":\"boolean\"}]\n",
417 *scopes[2].settings);
418 ASSERT_EQ(4, scopes[2].keywords.size());
419- EXPECT_EQ("music", scopes[2].keywords[0]);
420- EXPECT_EQ("video", scopes[2].keywords[1]);
421- EXPECT_EQ("news", scopes[2].keywords[2]);
422- EXPECT_EQ("games", scopes[2].keywords[3]);
423+ EXPECT_NE(scopes[2].keywords.end(), scopes[2].keywords.find("music"));
424+ EXPECT_NE(scopes[2].keywords.end(), scopes[2].keywords.find("video"));
425+ EXPECT_NE(scopes[2].keywords.end(), scopes[2].keywords.find("news"));
426+ EXPECT_NE(scopes[2].keywords.end(), scopes[2].keywords.find("games"));
427
428 EXPECT_TRUE(grep_string("/remote-scopes : partner=Partner%20String"));
429 }
430
431=== modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp'
432--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2015-01-23 04:07:14 +0000
433+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2015-01-28 09:06:40 +0000
434@@ -146,10 +146,10 @@
435 EXPECT_EQ("Celsius", meta.settings_definitions()[1].get_dict()["displayValues"].get_array()[0].get_string());
436 EXPECT_EQ("Fahrenheit", meta.settings_definitions()[1].get_dict()["displayValues"].get_array()[1].get_string());
437 ASSERT_EQ(4, meta.keywords().size());
438- EXPECT_EQ("music", meta.keywords()[0]);
439- EXPECT_EQ("video", meta.keywords()[1]);
440- EXPECT_EQ("news", meta.keywords()[2]);
441- EXPECT_EQ("games", meta.keywords()[3]);
442+ EXPECT_NE(meta.keywords().end(), meta.keywords().find("music"));
443+ EXPECT_NE(meta.keywords().end(), meta.keywords().find("video"));
444+ EXPECT_NE(meta.keywords().end(), meta.keywords().find("news"));
445+ EXPECT_NE(meta.keywords().end(), meta.keywords().find("games"));
446 }
447
448 // non-existent scope (via mw)
449
450=== modified file 'test/gtest/scopes/testing/IsolatedScope/IsolatedScope_test.cpp'
451--- test/gtest/scopes/testing/IsolatedScope/IsolatedScope_test.cpp 2014-12-16 09:01:08 +0000
452+++ test/gtest/scopes/testing/IsolatedScope/IsolatedScope_test.cpp 2015-01-28 09:06:40 +0000
453@@ -94,7 +94,7 @@
454 settings_defs.push_back(unity::scopes::Variant(a_setting));
455
456 std::vector<std::string> child_scope_ids{ "joe", "mary" };
457- std::vector<std::string> keywords{ "people", "things" };
458+ std::set<std::string> keywords{ "people", "things" };
459
460 unity::scopes::testing::ScopeMetadataBuilder builder;
461 builder.scope_id(scope_id)

Subscribers

People subscribed via source and target branches

to all changes: