Merge lp:~stolowski/unity-scope-click/fix-1340195 into lp:unity-scope-click/devel

Proposed by Paweł Stołowski
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 330
Merged at revision: 330
Proposed branch: lp:~stolowski/unity-scope-click/fix-1340195
Merge into: lp:unity-scope-click/devel
Diff against target: 46 lines (+13/-2)
2 files modified
scope/clickapps/apps-query.cpp (+1/-1)
scope/tests/test_apps_query.cpp (+12/-1)
To merge this branch: bzr merge lp:~stolowski/unity-scope-click/fix-1340195
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
dobey (community) Approve
Review via email: mp+226667@code.launchpad.net

Commit message

Don't use static variable for canned query as it needs updating with every search.

Description of the change

Don't use static variable for canned query as it needs updating with every search.

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scope/clickapps/apps-query.cpp'
2--- scope/clickapps/apps-query.cpp 2014-07-10 14:44:19 +0000
3+++ scope/clickapps/apps-query.cpp 2014-07-14 13:18:17 +0000
4@@ -253,7 +253,7 @@
5 scopes::CategoryRenderer rdr(CATEGORY_STORE);
6 auto cat = searchReply->register_category("store", cat_title, "", rdr);
7
8- static const unity::scopes::CannedQuery store_scope("com.canonical.scopes.clickstore", querystr, "");
9+ const unity::scopes::CannedQuery store_scope("com.canonical.scopes.clickstore", querystr, "");
10
11 scopes::CategorisedResult res(cat);
12 res.set_title(title);
13
14=== modified file 'scope/tests/test_apps_query.cpp'
15--- scope/tests/test_apps_query.cpp 2014-07-11 16:49:05 +0000
16+++ scope/tests/test_apps_query.cpp 2014-07-14 13:18:17 +0000
17@@ -97,11 +97,13 @@
18 {
19 const scopes::SearchMetadata metadata("en_EN", "phone");
20 const unity::scopes::CannedQuery query("foo.scope", "FooBar", "");
21+ const unity::scopes::CannedQuery query2("foo.scope", "Metallica", "");
22+
23 click::apps::Query q(query, metadata);
24+ click::apps::Query q2(query2, metadata);
25
26 scopes::testing::MockSearchReply mock_reply;
27 scopes::SearchReplyProxy reply(&mock_reply, [](unity::scopes::SearchReply*){});
28-
29 scopes::CategoryRenderer renderer("{}");
30 auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
31
32@@ -110,6 +112,15 @@
33 EXPECT_CALL(mock_reply, register_category("store", CategoryTitleContains("FooBar"), _, _)).WillOnce(Return(ptrCat));
34 EXPECT_CALL(mock_reply, push(Matcher<const unity::scopes::CategorisedResult&>(ResultUriMatchesCannedQuery(target_query))));
35
36+ scopes::testing::MockSearchReply mock_reply2;
37+ scopes::SearchReplyProxy reply2(&mock_reply2, [](unity::scopes::SearchReply*){});
38+
39+ const unity::scopes::CannedQuery target_query2("com.canonical.scopes.clickstore", "Metallica", "");
40+
41+ EXPECT_CALL(mock_reply2, register_category("store", CategoryTitleContains("Metallica"), _, _)).WillOnce(Return(ptrCat));
42+ EXPECT_CALL(mock_reply2, push(Matcher<const unity::scopes::CategorisedResult&>(ResultUriMatchesCannedQuery(target_query2))));
43+
44 q.add_fake_store_app(reply);
45+ q2.add_fake_store_app(reply2);
46 }
47

Subscribers

People subscribed via source and target branches

to all changes: