Merge lp:~michihenning/storage-framework/fix-gtest-warnings into lp:storage-framework/devel
- fix-gtest-warnings
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Michi Henning |
Approved revision: | 96 |
Merged at revision: | 97 |
Proposed branch: | lp:~michihenning/storage-framework/fix-gtest-warnings |
Merge into: | lp:storage-framework/devel |
Diff against target: |
195 lines (+36/-22) 7 files modified
tests/CMakeLists.txt (+0/-6) tests/local-client/local-client_test.cpp (+4/-0) tests/provider-AccountData/AccountData_test.cpp (+4/-0) tests/provider-DBusPeerCache/DBusPeerCache_test.cpp (+4/-0) tests/provider-ProviderInterface/TestProvider.cpp (+5/-5) tests/remote-client/remote-client_test.cpp (+15/-11) tests/utils/ProviderFixture.h (+4/-0) |
To merge this branch: | bzr merge lp:~michihenning/storage-framework/fix-gtest-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
unity-api-1-bot | continuous-integration | Approve | |
James Henstridge | Approve | ||
Review via email:
|
Commit message
Fixed a bunch of warnings caused by new gtest.
Description of the change
Fixed a bunch of warnings caused by new gtest.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:96
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:96
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
unity-api-1-bot (unity-api-1-bot) wrote : | # |
PASSED: Continuous integration, rev:96
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'tests/CMakeLists.txt' | |||
2 | --- tests/CMakeLists.txt 2016-09-08 08:33:59 +0000 | |||
3 | +++ tests/CMakeLists.txt 2016-11-23 03:09:23 +0000 | |||
4 | @@ -1,10 +1,4 @@ | |||
5 | 1 | # We add -g so we get debug info for the gtest stack frames with gdb. | ||
6 | 2 | # The warnings are suppressed so we get a noise-free build for gtest and gmock. | ||
7 | 3 | |||
8 | 4 | set(old_cxx_flags ${CMAKE_CXX_FLAGS}) | ||
9 | 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wno-old-style-cast -Wno-missing-field-initializers") | ||
10 | 6 | find_package(GMock) | 1 | find_package(GMock) |
11 | 7 | set(CMAKE_CXX_FLAGS ${old_cxx_flags}) | ||
12 | 8 | 2 | ||
13 | 9 | configure_file(testsetup.h.in testsetup.h @ONLY) | 3 | configure_file(testsetup.h.in testsetup.h @ONLY) |
14 | 10 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | 4 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
15 | 11 | 5 | ||
16 | === modified file 'tests/local-client/local-client_test.cpp' | |||
17 | --- tests/local-client/local-client_test.cpp 2016-08-26 04:45:56 +0000 | |||
18 | +++ tests/local-client/local-client_test.cpp 2016-11-23 03:09:23 +0000 | |||
19 | @@ -21,7 +21,11 @@ | |||
20 | 21 | #include <unity/storage/qt/client/internal/local_client/boost_filesystem.h> | 21 | #include <unity/storage/qt/client/internal/local_client/boost_filesystem.h> |
21 | 22 | #include <unity/storage/qt/client/internal/local_client/tmpfile_prefix.h> | 22 | #include <unity/storage/qt/client/internal/local_client/tmpfile_prefix.h> |
22 | 23 | 23 | ||
23 | 24 | #pragma GCC diagnostic push | ||
24 | 25 | #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" | ||
25 | 24 | #include <gtest/gtest.h> | 26 | #include <gtest/gtest.h> |
26 | 27 | #pragma GCC diagnostic pop | ||
27 | 28 | |||
28 | 25 | #include <QCoreApplication> | 29 | #include <QCoreApplication> |
29 | 26 | #include <QFile> | 30 | #include <QFile> |
30 | 27 | #include <QFutureWatcher> | 31 | #include <QFutureWatcher> |
31 | 28 | 32 | ||
32 | === modified file 'tests/provider-AccountData/AccountData_test.cpp' | |||
33 | --- tests/provider-AccountData/AccountData_test.cpp 2016-09-28 11:58:35 +0000 | |||
34 | +++ tests/provider-AccountData/AccountData_test.cpp 2016-11-23 03:09:23 +0000 | |||
35 | @@ -22,7 +22,11 @@ | |||
36 | 22 | 22 | ||
37 | 23 | #include <utils/DBusEnvironment.h> | 23 | #include <utils/DBusEnvironment.h> |
38 | 24 | 24 | ||
39 | 25 | #pragma GCC diagnostic push | ||
40 | 26 | #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" | ||
41 | 25 | #include <gtest/gtest.h> | 27 | #include <gtest/gtest.h> |
42 | 28 | #pragma GCC diagnostic pop | ||
43 | 29 | |||
44 | 26 | #include <OnlineAccounts/Account> | 30 | #include <OnlineAccounts/Account> |
45 | 27 | #include <OnlineAccounts/Manager> | 31 | #include <OnlineAccounts/Manager> |
46 | 28 | #include <QCoreApplication> | 32 | #include <QCoreApplication> |
47 | 29 | 33 | ||
48 | === modified file 'tests/provider-DBusPeerCache/DBusPeerCache_test.cpp' | |||
49 | --- tests/provider-DBusPeerCache/DBusPeerCache_test.cpp 2016-07-28 03:10:57 +0000 | |||
50 | +++ tests/provider-DBusPeerCache/DBusPeerCache_test.cpp 2016-11-23 03:09:23 +0000 | |||
51 | @@ -20,7 +20,11 @@ | |||
52 | 20 | 20 | ||
53 | 21 | #include <utils/DBusEnvironment.h> | 21 | #include <utils/DBusEnvironment.h> |
54 | 22 | 22 | ||
55 | 23 | #pragma GCC diagnostic push | ||
56 | 24 | #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" | ||
57 | 23 | #include <gtest/gtest.h> | 25 | #include <gtest/gtest.h> |
58 | 26 | #pragma GCC diagnostic pop | ||
59 | 27 | |||
60 | 24 | #include <OnlineAccounts/Account> | 28 | #include <OnlineAccounts/Account> |
61 | 25 | #include <OnlineAccounts/Manager> | 29 | #include <OnlineAccounts/Manager> |
62 | 26 | #include <QCoreApplication> | 30 | #include <QCoreApplication> |
63 | 27 | 31 | ||
64 | === modified file 'tests/provider-ProviderInterface/TestProvider.cpp' | |||
65 | --- tests/provider-ProviderInterface/TestProvider.cpp 2016-11-03 02:43:43 +0000 | |||
66 | +++ tests/provider-ProviderInterface/TestProvider.cpp 2016-11-23 03:09:23 +0000 | |||
67 | @@ -87,7 +87,7 @@ | |||
68 | 87 | boost::future<Item> TestUploadJob::finish() | 87 | boost::future<Item> TestUploadJob::finish() |
69 | 88 | { | 88 | { |
70 | 89 | boost::promise<Item> p; | 89 | boost::promise<Item> p; |
72 | 90 | printf("TestUploadJob::finish(): %d read of expected %d\n", (int) bytes_read_, (int) size_); | 90 | printf("TestUploadJob::finish(): %d read of expected %d\n", int(bytes_read_), int(size_)); |
73 | 91 | notifier_.setEnabled(false); | 91 | notifier_.setEnabled(false); |
74 | 92 | drain(); | 92 | drain(); |
75 | 93 | if (bytes_read_ == size_) | 93 | if (bytes_read_ == size_) |
76 | @@ -139,7 +139,7 @@ | |||
77 | 139 | 139 | ||
78 | 140 | void TestUploadJob::read_some() | 140 | void TestUploadJob::read_some() |
79 | 141 | { | 141 | { |
81 | 142 | printf("TestUploadJob::read_some(): %d read of expected %d\n", (int) bytes_read_, (int) size_); | 142 | printf("TestUploadJob::read_some(): %d read of expected %d\n", int(bytes_read_), int(size_)); |
82 | 143 | 143 | ||
83 | 144 | char buf[5]; | 144 | char buf[5]; |
84 | 145 | ssize_t n_read = read(read_socket(), buf, sizeof(buf)); | 145 | ssize_t n_read = read(read_socket(), buf, sizeof(buf)); |
85 | @@ -248,7 +248,7 @@ | |||
86 | 248 | boost::future<void> TestDownloadJob::finish() | 248 | boost::future<void> TestDownloadJob::finish() |
87 | 249 | { | 249 | { |
88 | 250 | boost::promise<void> p; | 250 | boost::promise<void> p; |
90 | 251 | if (bytes_written_ < (ssize_t)data_.size()) | 251 | if (bytes_written_ < ssize_t(data_.size())) |
91 | 252 | { | 252 | { |
92 | 253 | p.set_exception(LogicException("Not all data read")); | 253 | p.set_exception(LogicException("Not all data read")); |
93 | 254 | } | 254 | } |
94 | @@ -261,14 +261,14 @@ | |||
95 | 261 | 261 | ||
96 | 262 | void TestDownloadJob::write_some() | 262 | void TestDownloadJob::write_some() |
97 | 263 | { | 263 | { |
99 | 264 | if (bytes_written_ >= (ssize_t)data_.size()) { | 264 | if (bytes_written_ >= ssize_t(data_.size())) { |
100 | 265 | report_complete(); | 265 | report_complete(); |
101 | 266 | timer_.stop(); | 266 | timer_.stop(); |
102 | 267 | return; | 267 | return; |
103 | 268 | } | 268 | } |
104 | 269 | 269 | ||
105 | 270 | ssize_t n_written = write(write_socket(), data_.data() + bytes_written_, | 270 | ssize_t n_written = write(write_socket(), data_.data() + bytes_written_, |
107 | 271 | min(data_.size() - bytes_written_, (size_t)2)); | 271 | min(data_.size() - bytes_written_, size_t(2))); |
108 | 272 | if (n_written < 0) | 272 | if (n_written < 0) |
109 | 273 | { | 273 | { |
110 | 274 | int error_code = errno; | 274 | int error_code = errno; |
111 | 275 | 275 | ||
112 | === modified file 'tests/remote-client/remote-client_test.cpp' | |||
113 | --- tests/remote-client/remote-client_test.cpp 2016-11-04 07:33:07 +0000 | |||
114 | +++ tests/remote-client/remote-client_test.cpp 2016-11-23 03:09:23 +0000 | |||
115 | @@ -22,7 +22,11 @@ | |||
116 | 22 | #include <utils/gtest_printer.h> | 22 | #include <utils/gtest_printer.h> |
117 | 23 | #include <utils/ProviderFixture.h> | 23 | #include <utils/ProviderFixture.h> |
118 | 24 | 24 | ||
119 | 25 | #pragma GCC diagnostic push | ||
120 | 26 | #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" | ||
121 | 25 | #include <gtest/gtest.h> | 27 | #include <gtest/gtest.h> |
122 | 28 | #pragma GCC diagnostic pop | ||
123 | 29 | |||
124 | 26 | #include <QSignalSpy> | 30 | #include <QSignalSpy> |
125 | 27 | 31 | ||
126 | 28 | #include <unordered_set> | 32 | #include <unordered_set> |
127 | @@ -319,14 +323,14 @@ | |||
128 | 319 | unordered_set<Account>(); // Just to show that this works. | 323 | unordered_set<Account>(); // Just to show that this works. |
129 | 320 | 324 | ||
130 | 321 | Account a1; | 325 | Account a1; |
134 | 322 | EXPECT_EQ(0, hash<Account>()(a1)); | 326 | EXPECT_EQ(0u, hash<Account>()(a1)); |
135 | 323 | EXPECT_EQ(0, a1.hash()); | 327 | EXPECT_EQ(0u, a1.hash()); |
136 | 324 | EXPECT_EQ(0, qHash(a1)); | 328 | EXPECT_EQ(0u, qHash(a1)); |
137 | 325 | 329 | ||
138 | 326 | auto a2 = runtime_->make_test_account(service_connection_->baseService(), object_path(), "a", "a", "a"); | 330 | auto a2 = runtime_->make_test_account(service_connection_->baseService(), object_path(), "a", "a", "a"); |
139 | 327 | // Due to different return types (size_t vs uint), hash() and qHash() do not return the same value. | 331 | // Due to different return types (size_t vs uint), hash() and qHash() do not return the same value. |
142 | 328 | EXPECT_NE(0, a2.hash()); | 332 | EXPECT_NE(0u, a2.hash()); |
143 | 329 | EXPECT_NE(0, qHash(a2)); | 333 | EXPECT_NE(0u, qHash(a2)); |
144 | 330 | } | 334 | } |
145 | 331 | 335 | ||
146 | 332 | TEST_F(AccountTest, accounts) | 336 | TEST_F(AccountTest, accounts) |
147 | @@ -1121,9 +1125,9 @@ | |||
148 | 1121 | 1125 | ||
149 | 1122 | unordered_set<Item>(); // Just to show that this works. | 1126 | unordered_set<Item>(); // Just to show that this works. |
150 | 1123 | 1127 | ||
154 | 1124 | EXPECT_EQ(0, hash<Item>()(i1)); | 1128 | EXPECT_EQ(0u, hash<Item>()(i1)); |
155 | 1125 | EXPECT_EQ(0, i1.hash()); | 1129 | EXPECT_EQ(0u, i1.hash()); |
156 | 1126 | EXPECT_EQ(0, qHash(i1)); | 1130 | EXPECT_EQ(0u, qHash(i1)); |
157 | 1127 | } | 1131 | } |
158 | 1128 | 1132 | ||
159 | 1129 | { | 1133 | { |
160 | @@ -1155,8 +1159,8 @@ | |||
161 | 1155 | EXPECT_FALSE(i2 > i1); | 1159 | EXPECT_FALSE(i2 > i1); |
162 | 1156 | EXPECT_FALSE(i2 >= i1); | 1160 | EXPECT_FALSE(i2 >= i1); |
163 | 1157 | 1161 | ||
166 | 1158 | EXPECT_NE(0, i1.hash()); | 1162 | EXPECT_NE(0u, i1.hash()); |
167 | 1159 | EXPECT_NE(0, qHash(i1)); | 1163 | EXPECT_NE(0u, qHash(i1)); |
168 | 1160 | } | 1164 | } |
169 | 1161 | 1165 | ||
170 | 1162 | { | 1166 | { |
171 | @@ -3026,7 +3030,7 @@ | |||
172 | 3026 | 3030 | ||
173 | 3027 | unique_ptr<Uploader> uploader(child.createUploader(Item::ConflictPolicy::IgnoreConflict, 20)); | 3031 | unique_ptr<Uploader> uploader(child.createUploader(Item::ConflictPolicy::IgnoreConflict, 20)); |
174 | 3028 | EXPECT_FALSE(uploader->isValid()); | 3032 | EXPECT_FALSE(uploader->isValid()); |
176 | 3029 | EXPECT_EQ(Downloader::Status::Error, uploader->status()); | 3033 | EXPECT_EQ(Uploader::Status::Error, uploader->status()); |
177 | 3030 | EXPECT_EQ(StorageError::RuntimeDestroyed, uploader->error().type()); | 3034 | EXPECT_EQ(StorageError::RuntimeDestroyed, uploader->error().type()); |
178 | 3031 | EXPECT_EQ("RuntimeDestroyed: Item::createUploader(): Runtime was destroyed previously", | 3035 | EXPECT_EQ("RuntimeDestroyed: Item::createUploader(): Runtime was destroyed previously", |
179 | 3032 | uploader->error().errorString()); | 3036 | uploader->error().errorString()); |
180 | 3033 | 3037 | ||
181 | === modified file 'tests/utils/ProviderFixture.h' | |||
182 | --- tests/utils/ProviderFixture.h 2016-09-26 02:37:03 +0000 | |||
183 | +++ tests/utils/ProviderFixture.h 2016-11-23 03:09:23 +0000 | |||
184 | @@ -23,7 +23,11 @@ | |||
185 | 23 | #include <utils/DBusEnvironment.h> | 23 | #include <utils/DBusEnvironment.h> |
186 | 24 | #include <utils/ProviderClient.h> | 24 | #include <utils/ProviderClient.h> |
187 | 25 | 25 | ||
188 | 26 | #pragma GCC diagnostic push | ||
189 | 27 | #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" | ||
190 | 26 | #include <gtest/gtest.h> | 28 | #include <gtest/gtest.h> |
191 | 29 | #pragma GCC diagnostic pop | ||
192 | 30 | |||
193 | 27 | #include <OnlineAccounts/Account> | 31 | #include <OnlineAccounts/Account> |
194 | 28 | #include <OnlineAccounts/Manager> | 32 | #include <OnlineAccounts/Manager> |
195 | 29 | #include <QDBusConnection> | 33 | #include <QDBusConnection> |
FAILED: Continuous integration, rev:96 /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/217/ /jenkins. canonical. com/unity- api-1/job/ build/1152/ console /jenkins. canonical. com/unity- api-1/job/ build-0- fetch/1159 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 946 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 946/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= zesty/946/ console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 946 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 946/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= zesty/946/ console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 946 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 946/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= zesty/946/ console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/217/ rebuild
https:/