Merge lp:~michihenning/unity-scopes-api/fix-chroot-tests into lp:unity-scopes-api

Proposed by Michi Henning
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 318
Merged at revision: 318
Proposed branch: lp:~michihenning/unity-scopes-api/fix-chroot-tests
Merge into: lp:unity-scopes-api
Diff against target: 85 lines (+22/-9)
4 files modified
debian/changelog (+7/-7)
src/scopes/internal/RuntimeImpl.cpp (+7/-2)
test/gtest/scopes/ResultCache/ResultCache_test.cpp (+7/-0)
test/gtest/scopes/stress/Runtime.ini.in (+1/-0)
To merge this branch: bzr merge lp:~michihenning/unity-scopes-api/fix-chroot-tests
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+249916@code.launchpad.net

Commit message

Fixed bogus test failure when running the tests in a chroot without apparmor. Fixed compiler warning about unused return value. Fixed too-long lines in changelog that caused noise from lintian.

Description of the change

Fixed bogus test failure when running the tests in a chroot without apparmor. Fixed compiler warning about unused return value. Fixed too-long lines in changelog that caused noise from lintian.

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
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks ok to me. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-02-13 10:36:27 +0000
3+++ debian/changelog 2015-02-23 05:06:41 +0000
4@@ -1,14 +1,14 @@
5 unity-scopes-api (0.6.14+15.04.20150213-0ubuntu1) vivid; urgency=medium
6
7 [ Michi Henning ]
8- * Added push_surfacing_results_from_cache() to Reply proxy. This allows a scope
9- to reply the results of the last succesful surfacing query from an on-disk cache.
10- This is useful to prevent the user being presented with an empty screen when
11- swiping to the scope while the device has no network access, or the scope's
12- data source is off-line.
13+ * Added push_surfacing_results_from_cache() to Reply proxy. This allows
14+ a scope to reply the results of the last succesful surfacing query
15+ from an on-disk cache. This is useful to prevent the user being
16+ presented with an empty screen when swiping to the scope while the
17+ device has no network access, or the scope's data source is off-line.
18
19- Note: This is change is ABI compatible with gcc and clang despite the addition
20- a new virtual function.
21+ Note: This is change is ABI compatible with gcc and clang despite
22+ the addition a new virtual function.
23 * Fixed sporadic failure in JsonAsyncReader test caused by slow DNS.
24 Improved tests to report exception details if an exception other
25 than the expected one is thrown.
26
27=== modified file 'src/scopes/internal/RuntimeImpl.cpp'
28--- src/scopes/internal/RuntimeImpl.cpp 2015-02-04 06:07:15 +0000
29+++ src/scopes/internal/RuntimeImpl.cpp 2015-02-23 05:06:41 +0000
30@@ -562,13 +562,18 @@
31 {
32 auto is_confined = []
33 {
34- // Find out whether we are confined. aa_getcon() returns -1 in that case.
35+ // Find out whether we are confined. aa_getcon() returns -1 with EACCESS in that case.
36 char* con = nullptr;
37 char* mode;
38 int rc = aa_getcon(&con, &mode);
39+ int error = errno;
40+ if (rc == -1)
41+ {
42+ cerr << "aa_getcon failed, errno = " << error << endl;
43+ }
44 // Only con (not mode) must be deallocated
45 free(con);
46- return rc == -1;
47+ return rc == -1 && error == EACCES;
48 };
49 static bool confined = is_confined();
50 return confined;
51
52=== modified file 'test/gtest/scopes/ResultCache/ResultCache_test.cpp'
53--- test/gtest/scopes/ResultCache/ResultCache_test.cpp 2015-02-05 09:35:42 +0000
54+++ test/gtest/scopes/ResultCache/ResultCache_test.cpp 2015-02-23 05:06:41 +0000
55@@ -167,6 +167,11 @@
56 EXPECT_FALSE(boost::filesystem::exists(TEST_RUNTIME_PATH "/unconfined/CacheScope/.surfacing_cache", ec));
57 }
58
59+// Stop warnings about unused return value from system()
60+
61+#pragma GCC diagnostic push
62+#pragma GCC diagnostic ignored "-Wunused-result"
63+
64 TEST_F(CacheScopeTest, surfacing_query)
65 {
66 ::unlink(TEST_RUNTIME_PATH "/unconfined/CacheScope/.surfacing_cache");
67@@ -187,6 +192,8 @@
68 system("cat " TEST_RUNTIME_PATH "/unconfined/CacheScope/.surfacing_cache");
69 }
70
71+#pragma GCC diagnostic pop
72+
73 // Run another non-surfacing query before checking that the cache contains the
74 // results of the last surfacing query.
75
76
77=== modified file 'test/gtest/scopes/stress/Runtime.ini.in'
78--- test/gtest/scopes/stress/Runtime.ini.in 2014-12-09 04:37:59 +0000
79+++ test/gtest/scopes/stress/Runtime.ini.in 2015-02-23 05:06:41 +0000
80@@ -4,4 +4,5 @@
81 Default.Middleware = Zmq
82 Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini
83 Smartscopes.Registry.Identity =
84+CacheDir=@CMAKE_CURRENT_BINARY_DIR@
85 LogDir=

Subscribers

People subscribed via source and target branches

to all changes: