Mir

Merge lp:~mir-team/mir/gmock-1.8-support-part-1 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 3849
Proposed branch: lp:~mir-team/mir/gmock-1.8-support-part-1
Merge into: lp:mir
Diff against target: 1121 lines (+139/-119)
36 files modified
tests/acceptance-tests/test_client_cookie.cpp (+3/-3)
tests/acceptance-tests/test_client_input.cpp (+8/-5)
tests/acceptance-tests/test_client_library.cpp (+8/-6)
tests/acceptance-tests/test_client_platform_operation.cpp (+1/-1)
tests/acceptance-tests/test_client_scaling.cpp (+1/-1)
tests/acceptance-tests/test_display_configuration.cpp (+1/-1)
tests/acceptance-tests/test_surface_raise.cpp (+1/-1)
tests/integration-tests/test_buffer_scheduling.cpp (+2/-2)
tests/integration-tests/test_stale_frames.cpp (+3/-3)
tests/mir_test/test_dispatchable.cpp (+4/-3)
tests/unit-tests/client/test_client_buffer_stream.cpp (+2/-2)
tests/unit-tests/client/test_client_display_conf.cpp (+1/-1)
tests/unit-tests/client/test_protobuf_rpc_channel.cpp (+3/-3)
tests/unit-tests/client/test_screencast_stream.cpp (+2/-2)
tests/unit-tests/client/test_stream_transport.cpp (+29/-22)
tests/unit-tests/compositor/test_screencast_display_buffer.cpp (+1/-1)
tests/unit-tests/frontend/test_protobuf_buffer_packer.cpp (+3/-3)
tests/unit-tests/frontend/test_session_mediator.cpp (+8/-6)
tests/unit-tests/input/test_x11_platform.cpp (+1/-1)
tests/unit-tests/platforms/android/client/test_buffer.cpp (+2/-2)
tests/unit-tests/platforms/android/server/test_device_detection.cpp (+1/-1)
tests/unit-tests/platforms/android/server/test_display.cpp (+6/-6)
tests/unit-tests/platforms/android/server/test_hwc_configuration.cpp (+5/-5)
tests/unit-tests/platforms/android/server/test_hwc_device.cpp (+11/-11)
tests/unit-tests/platforms/android/server/test_hwc_layerlist.cpp (+12/-10)
tests/unit-tests/platforms/android/server/test_hwc_wrapper.cpp (+2/-2)
tests/unit-tests/platforms/android/server/test_output_builder.cpp (+1/-1)
tests/unit-tests/platforms/mesa/client/test_client_buffer.cpp (+1/-1)
tests/unit-tests/platforms/mesa/client/test_client_platform.cpp (+3/-1)
tests/unit-tests/platforms/mesa/kms-utils/test_drm_mode_resources.cpp (+4/-3)
tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp (+2/-2)
tests/unit-tests/platforms/mesa/kms/test_ipc_operations.cpp (+1/-1)
tests/unit-tests/platforms/nested/test_buffer.cpp (+1/-1)
tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp (+2/-2)
tests/unit-tests/test_flags.cpp (+1/-1)
tests/unit-tests/test_shared_library_prober.cpp (+2/-2)
To merge this branch: bzr merge lp:~mir-team/mir/gmock-1.8-support-part-1
Reviewer Review Type Date Requested Status
Chris Halse Rogers Approve
Mir CI Bot continuous-integration Approve
Review via email: mp+311708@code.launchpad.net

Commit message

Start fixing signed/unsigned mismatches that break gcc-6 with
gmock 1.8 (now in zesty).

Apparently RAOF's fix for bug 1644062 no longer needs these fixes. I'm not sure how he achieved that, but this branch is still worth keeping.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3849
https://mir-jenkins.ubuntu.com/job/mir-ci/2269/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2939
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3004
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2996
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2996
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2996
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2968
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2968/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2968
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2968/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2968
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2968/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2968
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2968/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2968
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2968/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2968
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2968/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2269/rebuild

review: Approve (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3851
https://mir-jenkins.ubuntu.com/job/mir-ci/2273/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2944
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3009
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3001
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3001
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/3001
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2973
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2973/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2973
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2973/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2973
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2973/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2973
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2973/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2973
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2973/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2973
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2973/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2273/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

+#define ssizeof(X) (static_cast<ssize_t>(sizeof(X)))

Not madly in love with the #define. It looks like this could be improved with a TransferredExactly() MATCHER_P, so that all the various calls go:
EXPECT_THAT(write(...), TransferredExactly(sizeof(dummy));
or
EXPECT_THAT(write(...), TransferredExactly(data.size());

For bonus points you could describe errors with strerror!

Looks reasonable.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

A custom matcher sounds like it would need more domain knowledge than macros and "ssizeof" would, so I would lean away from that.

strerror I would also stay away from in tests because its answers will vary between locales.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/acceptance-tests/test_client_cookie.cpp'
2--- tests/acceptance-tests/test_client_cookie.cpp 2016-11-10 17:13:31 +0000
3+++ tests/acceptance-tests/test_client_cookie.cpp 2016-11-25 03:23:22 +0000
4@@ -179,7 +179,7 @@
5 {
6 fake_pointer->emit_event(mis::a_pointer_event().with_movement(1, 1));
7
8- int events = 1;
9+ size_t events = 1;
10 if (wait_for_n_events(events, this))
11 {
12 std::lock_guard<std::mutex> lk(mutex);
13@@ -216,11 +216,11 @@
14 .at_position({1, 1})
15 );
16
17- int events = 1;
18+ size_t events = 1;
19 if (wait_for_n_events(events, this))
20 {
21 std::lock_guard<std::mutex> lk(mutex);
22 EXPECT_GE(event_count, events);
23- EXPECT_EQ(out_cookies.size(), 1);
24+ EXPECT_EQ(out_cookies.size(), 1u);
25 }
26 }
27
28=== modified file 'tests/acceptance-tests/test_client_input.cpp'
29--- tests/acceptance-tests/test_client_input.cpp 2016-11-23 15:19:12 +0000
30+++ tests/acceptance-tests/test_client_input.cpp 2016-11-25 03:23:22 +0000
31@@ -898,8 +898,8 @@
32 auto con = mir_connect_sync(new_connection().c_str(), first.c_str());
33 auto config = mir_connection_create_input_config(con);
34 int limit = 10;
35- int num_devices = 0;
36- int expected_devices = 3;
37+ unsigned num_devices = 0u;
38+ unsigned const expected_devices = 3u;
39
40 for(auto i = 0; i < limit; i++)
41 {
42@@ -949,7 +949,7 @@
43 EXPECT_THAT(callback_triggered.raised(), Eq(true));
44
45 auto config = mir_connection_create_input_config(a_client.connection);
46- EXPECT_THAT(mir_input_config_device_count(config), Eq(4));
47+ EXPECT_THAT(mir_input_config_device_count(config), Eq(4u));
48 EXPECT_THAT(config, ADeviceMatches(touchpad, touchpad_uid, uint32_t(mir_input_device_capability_touchpad |
49 mir_input_device_capability_pointer)));
50
51@@ -974,7 +974,7 @@
52 EXPECT_THAT(callback_triggered.raised(), Eq(true));
53
54 auto config = mir_connection_create_input_config(a_client.connection);
55- EXPECT_THAT(mir_input_config_device_count(config), Eq(2));
56+ EXPECT_THAT(mir_input_config_device_count(config), Eq(2u));
57 mir_input_config_destroy(config);
58 }
59
60@@ -1083,7 +1083,10 @@
61 mir_touchpad_configuration_set_disable_while_typing(touchpad_config, false);
62
63 EXPECT_THAT(mir_touchpad_configuration_get_click_modes(touchpad_config), Eq(mir_touchpad_click_mode_area_to_click));
64- EXPECT_THAT(mir_touchpad_configuration_get_scroll_modes(touchpad_config), Eq(mir_touchpad_scroll_mode_edge_scroll|mir_touchpad_scroll_mode_button_down_scroll));
65+ EXPECT_THAT(mir_touchpad_configuration_get_scroll_modes(touchpad_config),
66+ Eq(static_cast<MirTouchpadClickModes>(
67+ mir_touchpad_scroll_mode_edge_scroll
68+ | mir_touchpad_scroll_mode_button_down_scroll)));
69 EXPECT_THAT(mir_touchpad_configuration_get_button_down_scroll_button(touchpad_config), Eq(10));
70 EXPECT_THAT(mir_touchpad_configuration_get_tap_to_click(touchpad_config), Eq(true));
71 EXPECT_THAT(mir_touchpad_configuration_get_middle_mouse_button_emulation(touchpad_config), Eq(true));
72
73=== modified file 'tests/acceptance-tests/test_client_library.cpp'
74--- tests/acceptance-tests/test_client_library.cpp 2016-08-09 14:32:31 +0000
75+++ tests/acceptance-tests/test_client_library.cpp 2016-11-25 03:23:22 +0000
76@@ -695,7 +695,7 @@
77 mir_wait_for(mir_surface_release(surf_one, release_surface_callback, this));
78 mir_wait_for(mir_surface_release(surf_two, release_surface_callback, this));
79
80- ASSERT_THAT(current_surface_count(), testing::Eq(0));
81+ ASSERT_THAT(current_surface_count(), testing::Eq(0u));
82
83 mir_connection_release(connection);
84 }
85@@ -808,7 +808,7 @@
86
87 // We need to specify a valid output id, so we need to find which ones are valid...
88 auto configuration = mir_connection_create_display_config(connection);
89- ASSERT_THAT(configuration->num_outputs, Ge(1));
90+ ASSERT_THAT(configuration->num_outputs, Ge(1u));
91
92 auto const requested_output = configuration->outputs[0];
93
94@@ -823,10 +823,12 @@
95 mir_buffer_stream_get_current_buffer(
96 mir_surface_get_buffer_stream(surface), &native_buffer);
97
98- EXPECT_THAT(native_buffer->width,
99- Eq(requested_output.modes[requested_output.current_mode].horizontal_resolution));
100- EXPECT_THAT(native_buffer->height,
101- Eq(requested_output.modes[requested_output.current_mode].vertical_resolution));
102+ int const mode_width =
103+ requested_output.modes[requested_output.current_mode]. horizontal_resolution;
104+ EXPECT_THAT(native_buffer->width, Eq(mode_width));
105+ int const mode_height =
106+ requested_output.modes[requested_output.current_mode].vertical_resolution;
107+ EXPECT_THAT(native_buffer->height, Eq(mode_height));
108
109 // TODO: This is racy. Fix in subsequent "send all the things on construction" branch
110 // EXPECT_THAT(mir_surface_get_state(surface), Eq(mir_surface_state_fullscreen));
111
112=== modified file 'tests/acceptance-tests/test_client_platform_operation.cpp'
113--- tests/acceptance-tests/test_client_platform_operation.cpp 2015-06-25 03:00:08 +0000
114+++ tests/acceptance-tests/test_client_platform_operation.cpp 2016-11-25 03:23:22 +0000
115@@ -174,7 +174,7 @@
116 EXPECT_THAT(reply, MessageDataIsEmpty());
117
118 auto const reply_fds = mir_platform_message_get_fds(reply);
119- EXPECT_THAT(reply_fds.num_fds, Eq(1));
120+ EXPECT_THAT(reply_fds.num_fds, Eq(1u));
121
122 auto const reply_fd = reply_fds.fds[0];
123 EXPECT_THAT(reply_fd, Ne(pipe.read_fd()));
124
125=== modified file 'tests/acceptance-tests/test_client_scaling.cpp'
126--- tests/acceptance-tests/test_client_scaling.cpp 2016-11-09 02:30:14 +0000
127+++ tests/acceptance-tests/test_client_scaling.cpp 2016-11-25 03:23:22 +0000
128@@ -169,7 +169,7 @@
129
130 watch->wait_until_entries_number_at_least(2, 5s);
131 auto entries = watch->size_entries();
132- ASSERT_THAT(entries, SizeIs(Ge(1)));
133+ ASSERT_THAT(entries, SizeIs(Ge(1u)));
134
135 bool an_entry_with_differing_size {false};
136 for(auto &entry : entries)
137
138=== modified file 'tests/acceptance-tests/test_display_configuration.cpp'
139--- tests/acceptance-tests/test_display_configuration.cpp 2016-07-18 07:38:38 +0000
140+++ tests/acceptance-tests/test_display_configuration.cpp 2016-11-25 03:23:22 +0000
141@@ -479,7 +479,7 @@
142 display_client.connection, &display_config_change_handler, &callback_called);
143
144 auto requested_config = display_client.get_base_config();
145- EXPECT_THAT(requested_config->outputs[0].used, Eq(1));
146+ EXPECT_THAT(requested_config->outputs[0].used, Eq(1u));
147 requested_config->outputs[0].used = 0;
148
149 display_client.set_base_config(requested_config.get());
150
151=== modified file 'tests/acceptance-tests/test_surface_raise.cpp'
152--- tests/acceptance-tests/test_surface_raise.cpp 2016-07-18 07:38:38 +0000
153+++ tests/acceptance-tests/test_surface_raise.cpp 2016-11-25 03:23:22 +0000
154@@ -229,7 +229,7 @@
155 {
156 fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_M));
157 fake_keyboard->emit_event(mis::a_key_up_event().of_scancode(KEY_M));
158- int events = 2;
159+ size_t events = 2;
160 if (wait_for_n_events(events, this))
161 {
162 fake_pointer->emit_event(mis::a_pointer_event().with_movement(1, 1));
163
164=== modified file 'tests/integration-tests/test_buffer_scheduling.cpp'
165--- tests/integration-tests/test_buffer_scheduling.cpp 2016-11-16 13:08:55 +0000
166+++ tests/integration-tests/test_buffer_scheduling.cpp 2016-11-25 03:23:22 +0000
167@@ -446,7 +446,7 @@
168 }
169 }
170
171-size_t unique_ids_in(std::vector<BufferEntry> log)
172+int unique_ids_in(std::vector<BufferEntry> log)
173 {
174 std::sort(log.begin(), log.end(),
175 [](BufferEntry const& a, BufferEntry const& b) { return a.id < b.id; });
176@@ -1175,7 +1175,7 @@
177 // Test that dynamic queue scaling/throttling actually works
178 TEST_P(WithThreeOrMoreBuffers, queue_size_scales_with_client_performance)
179 {
180- int const discard = 3;
181+ auto const discard = 3u;
182
183 for (int frame = 0; frame < 20; frame++)
184 {
185
186=== modified file 'tests/integration-tests/test_stale_frames.cpp'
187--- tests/integration-tests/test_stale_frames.cpp 2016-08-01 14:43:19 +0000
188+++ tests/integration-tests/test_stale_frames.cpp 2016-11-25 03:23:22 +0000
189@@ -191,7 +191,7 @@
190 stale_buffers.emplace(mir_debug_surface_current_buffer_id(surface));
191 mir_buffer_stream_swap_buffers_sync(bs);
192
193- EXPECT_THAT(stale_buffers.size(), Eq(2));
194+ EXPECT_THAT(stale_buffers.size(), Eq(2u));
195
196 auto const fresh_buffer = mg::BufferID{mir_debug_surface_current_buffer_id(surface)};
197 mir_buffer_stream_swap_buffers_sync(bs);
198@@ -202,7 +202,7 @@
199 stale_buffers.erase(fresh_buffer);
200
201 auto const new_buffers = wait_for_new_rendered_buffers();
202- ASSERT_THAT(new_buffers.size(), Eq(1));
203+ ASSERT_THAT(new_buffers.size(), Eq(1u));
204 EXPECT_THAT(stale_buffers, Not(Contains(new_buffers[0])));
205 }
206
207@@ -222,6 +222,6 @@
208 start_compositor();
209
210 auto const new_buffers = wait_for_new_rendered_buffers();
211- ASSERT_THAT(new_buffers.size(), Eq(1));
212+ ASSERT_THAT(new_buffers.size(), Eq(1u));
213 EXPECT_THAT(new_buffers[0], Eq(fresh_buffer));
214 }
215
216=== modified file 'tests/mir_test/test_dispatchable.cpp'
217--- tests/mir_test/test_dispatchable.cpp 2015-06-25 03:00:08 +0000
218+++ tests/mir_test/test_dispatchable.cpp 2016-11-25 03:23:22 +0000
219@@ -74,21 +74,22 @@
220 {
221 using namespace testing;
222 char dummy{0};
223- EXPECT_THAT(::write(write_fd, &dummy, sizeof(dummy)), Eq(sizeof(dummy)));
224+ EXPECT_THAT(::write(write_fd, &dummy, sizeof(dummy)),
225+ Eq(static_cast<int>(sizeof dummy)));
226 }
227
228 void mt::TestDispatchable::untrigger()
229 {
230 using namespace testing;
231 char dummy{0};
232- auto val = ::read(read_fd, &dummy, sizeof(dummy));
233+ int val = ::read(read_fd, &dummy, sizeof(dummy));
234 if (val < 0)
235 {
236 EXPECT_THAT(errno, Eq(EAGAIN));
237 }
238 else
239 {
240- EXPECT_THAT(val, Eq(sizeof(dummy)));
241+ EXPECT_THAT(val, Eq(static_cast<int>(sizeof dummy)));
242 }
243 }
244
245
246=== modified file 'tests/unit-tests/client/test_client_buffer_stream.cpp'
247--- tests/unit-tests/client/test_client_buffer_stream.cpp 2016-11-11 07:56:09 +0000
248+++ tests/unit-tests/client/test_client_buffer_stream.cpp 2016-11-25 03:23:22 +0000
249@@ -553,7 +553,7 @@
250
251 TEST_F(ClientBufferStream, receives_unsolicited_buffer)
252 {
253- int id = 88;
254+ auto id = 88u;
255 NiceMock<mtd::MockClientBuffer> mock_client_buffer;
256 ON_CALL(mock_client_buffer, size())
257 .WillByDefault(Return(size));
258@@ -764,7 +764,7 @@
259 async_buffer_arrives(buffer);
260 }
261
262- EXPECT_THAT(stream.get_current_buffer_id(), Eq(10));
263+ EXPECT_THAT(stream.get_current_buffer_id(), Eq(10u));
264 }
265
266 //LP: #1584784
267
268=== modified file 'tests/unit-tests/client/test_client_display_conf.cpp'
269--- tests/unit-tests/client/test_client_display_conf.cpp 2016-01-29 08:18:22 +0000
270+++ tests/unit-tests/client/test_client_display_conf.cpp 2016-11-25 03:23:22 +0000
271@@ -82,7 +82,7 @@
272
273 info = internal_config.copy_to_client();
274 EXPECT_THAT(*info, mt::DisplayConfigMatches(new_result));
275- EXPECT_EQ(1u, called_count);
276+ EXPECT_EQ(1, called_count);
277
278 mcl::delete_config_storage(info);
279 }
280
281=== modified file 'tests/unit-tests/client/test_protobuf_rpc_channel.cpp'
282--- tests/unit-tests/client/test_protobuf_rpc_channel.cpp 2016-10-05 08:42:26 +0000
283+++ tests/unit-tests/client/test_protobuf_rpc_channel.cpp 2016-11-25 03:23:22 +0000
284@@ -311,7 +311,7 @@
285
286 channel_user.connect(&message, nullptr, nullptr);
287
288- EXPECT_EQ(transport->sent_messages.size(), 1);
289+ EXPECT_EQ(transport->sent_messages.size(), 1u);
290 }
291
292 TEST_F(MirProtobufRpcChannelTest, sets_correct_size_when_sending_message)
293@@ -339,7 +339,7 @@
294 mir::Fd{open("/dev/null", O_RDONLY)},
295 mir::Fd{open("/dev/null", O_RDONLY)}};
296
297- ASSERT_EQ(transport->sent_messages.size(), 1);
298+ ASSERT_EQ(transport->sent_messages.size(), 1u);
299 {
300 mir::protobuf::Buffer reply_message;
301
302@@ -375,7 +375,7 @@
303 }
304 }
305
306- ASSERT_EQ(reply.fd_size(), fds.size());
307+ ASSERT_EQ(static_cast<size_t>(reply.fd_size()), fds.size());
308 int i = 0;
309 for (auto fd : fds)
310 {
311
312=== modified file 'tests/unit-tests/client/test_screencast_stream.cpp'
313--- tests/unit-tests/client/test_screencast_stream.cpp 2016-10-21 07:53:23 +0000
314+++ tests/unit-tests/client/test_screencast_stream.cpp 2016-11-25 03:23:22 +0000
315@@ -124,8 +124,8 @@
316
317 TEST_F(ScreencastStream, advances_current_buffer)
318 {
319- int id0 = 33;
320- int id1 = 34;
321+ auto id0 = 33u;
322+ auto id1 = 34u;
323
324 EXPECT_CALL(mock_protobuf_server, screencast_buffer(_,_,_))
325 .Times(2)
326
327=== modified file 'tests/unit-tests/client/test_stream_transport.cpp'
328--- tests/unit-tests/client/test_stream_transport.cpp 2016-07-18 07:38:38 +0000
329+++ tests/unit-tests/client/test_stream_transport.cpp 2016-11-25 03:23:22 +0000
330@@ -100,10 +100,12 @@
331 EXPECT_FALSE(socket_readable.revents & POLLNVAL);
332 }
333
334+#define ssizeof(X) (static_cast<ssize_t>(sizeof(X)))
335+
336 TYPED_TEST(StreamTransportTest, watch_fd_notifies_readable_when_data_pending)
337 {
338 uint64_t dummy{0xdeadbeef};
339- EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
340+ EXPECT_EQ(ssizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
341
342 EXPECT_TRUE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
343 }
344@@ -113,7 +115,7 @@
345 EXPECT_FALSE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
346
347 uint64_t dummy{0xdeadbeef};
348- EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
349+ EXPECT_EQ(ssizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
350
351 EXPECT_TRUE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
352 }
353@@ -135,7 +137,7 @@
354
355 this->transport->register_observer(observer);
356
357- EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
358+ EXPECT_EQ(ssizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
359
360 ASSERT_TRUE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
361
362@@ -153,7 +155,7 @@
363 bool disconnected{false};
364
365 uint64_t dummy{0xdeadbeef};
366- EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
367+ EXPECT_EQ(ssizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
368 ::close(this->test_fd);
369
370 ON_CALL(*observer, on_data_available()).WillByDefault(Invoke([this, dummy, &data_available]()
371@@ -189,7 +191,7 @@
372 bool disconnected{false};
373
374 uint64_t dummy{0xdeadbeef};
375- EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
376+ EXPECT_EQ(ssizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
377 ::close(this->test_fd);
378
379 ON_CALL(*observer, on_data_available()).WillByDefault(Invoke([this, dummy, &data_available]()
380@@ -290,7 +292,7 @@
381 this->transport->register_observer(observer);
382
383 uint64_t dummy{0xdeadbeef};
384- EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
385+ EXPECT_EQ(ssizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
386
387 EXPECT_TRUE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
388
389@@ -319,14 +321,15 @@
390
391 this->transport->register_observer(observer);
392
393- EXPECT_EQ(data.size(), write(this->test_fd, data.data(), data.size()));
394+ EXPECT_EQ(static_cast<int>(data.size()),
395+ write(this->test_fd, data.data(), data.size()));
396
397 EXPECT_TRUE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
398 while (mt::fd_is_readable(this->transport->watch_fd()) &&
399 this->transport->dispatch(md::FdEvent::readable))
400 ;
401
402- EXPECT_EQ(0, bytes_left);
403+ EXPECT_EQ(0u, bytes_left);
404 }
405
406 TYPED_TEST(StreamTransportTest, stops_notifying_once_all_data_is_read)
407@@ -349,7 +352,8 @@
408
409 this->transport->register_observer(observer);
410
411- EXPECT_EQ(data.size(), write(this->test_fd, data.data(), data.size()));
412+ EXPECT_EQ(static_cast<int>(data.size()),
413+ write(this->test_fd, data.data(), data.size()));
414
415 EXPECT_TRUE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
416 while (bytes_left > 0)
417@@ -369,7 +373,7 @@
418 bool disconnected{false};
419
420 uint64_t dummy{0xdeedfaac};
421- EXPECT_EQ(sizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
422+ EXPECT_EQ(ssizeof(dummy), write(this->test_fd, &dummy, sizeof(dummy)));
423
424 ON_CALL(*observer, on_disconnected()).WillByDefault(Invoke([&disconnected]()
425 { disconnected = true; }));
426@@ -536,7 +540,8 @@
427
428 this->transport->register_observer(observer);
429
430- EXPECT_EQ(expected.size(), write(this->test_fd, expected.data(), expected.size()));
431+ EXPECT_EQ(static_cast<ssize_t>(expected.size()),
432+ write(this->test_fd, expected.data(), expected.size()));
433
434 EXPECT_TRUE(mt::fd_becomes_readable(this->transport->watch_fd(), std::chrono::seconds{1}));
435 while (mt::fd_is_readable(this->transport->watch_fd()) &&
436@@ -566,7 +571,7 @@
437
438 ASSERT_EQ(1, poll(&read_listener, 1, 1000)) << "Failed to poll(): " << strerror(errno);
439
440- EXPECT_EQ(expected.size(), read(this->test_fd, received.data(), received.size()));
441+ EXPECT_EQ(static_cast<ssize_t>(expected.size()), read(this->test_fd, received.data(), received.size()));
442 EXPECT_EQ(0, memcmp(expected.data(), received.data(), expected.size()));
443 }
444
445@@ -873,7 +878,9 @@
446 receive_done->raise();
447 }};
448
449- EXPECT_EQ(expected.size(), send_with_fds(this->test_fd, test_fds, expected.data(), expected.size(), MSG_DONTWAIT));
450+ EXPECT_EQ(static_cast<ssize_t>(expected.size()),
451+ send_with_fds(this->test_fd, test_fds, expected.data(),
452+ expected.size(), MSG_DONTWAIT));
453
454 EXPECT_TRUE(receive_done->wait_for(std::chrono::seconds{1}));
455 EXPECT_EQ(expected, received);
456@@ -927,9 +934,9 @@
457 receive_done->raise();
458 }};
459
460- EXPECT_EQ(expected.size(),
461+ EXPECT_EQ(static_cast<ssize_t>(expected.size()),
462 send_with_fds(this->test_fd, first_test_fds, expected.data(), expected.size(), MSG_DONTWAIT));
463- EXPECT_EQ(expected.size(),
464+ EXPECT_EQ(static_cast<ssize_t>(expected.size()),
465 send_with_fds(this->test_fd, second_test_fds, expected.data(), expected.size(), MSG_DONTWAIT));
466
467 EXPECT_TRUE(receive_done->wait_for(std::chrono::seconds{1}));
468@@ -1090,7 +1097,7 @@
469 }};
470
471 int32_t dummy{0};
472- EXPECT_EQ(sizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
473+ EXPECT_EQ(ssizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
474
475 EXPECT_TRUE(receive_done->wait_for(std::chrono::seconds{1}));
476 }
477@@ -1119,7 +1126,7 @@
478 }};
479
480 int32_t dummy{0};
481- EXPECT_EQ(sizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
482+ EXPECT_EQ(ssizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
483
484 EXPECT_TRUE(receive_done->wait_for(std::chrono::seconds{1}));
485 }
486@@ -1169,9 +1176,9 @@
487 receive_done->raise();
488 }};
489
490- EXPECT_EQ(expected.size(),
491+ EXPECT_EQ(static_cast<ssize_t>(expected.size()),
492 send_with_fds(this->test_fd, first_test_fds, expected.data(), expected.size(), MSG_DONTWAIT));
493- EXPECT_EQ(expected.size(),
494+ EXPECT_EQ(static_cast<ssize_t>(expected.size()),
495 send_with_fds(this->test_fd, second_test_fds, expected.data(), expected.size(), MSG_DONTWAIT));
496
497 EXPECT_TRUE(receive_done->wait_for(std::chrono::seconds{1}));
498@@ -1196,9 +1203,9 @@
499 }
500
501 int32_t dummy{0};
502- EXPECT_EQ(sizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
503+ EXPECT_EQ(ssizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
504
505- EXPECT_EQ(sizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
506+ EXPECT_EQ(ssizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
507
508 try
509 {
510@@ -1307,7 +1314,7 @@
511 }};
512
513 int32_t dummy{0};
514- EXPECT_EQ(sizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
515+ EXPECT_EQ(ssizeof(dummy), send_with_fds(this->test_fd, test_fds, &dummy, sizeof(dummy), MSG_DONTWAIT));
516
517 EXPECT_TRUE(receive_done->wait_for(std::chrono::seconds{1}));
518 }
519
520=== modified file 'tests/unit-tests/compositor/test_screencast_display_buffer.cpp'
521--- tests/unit-tests/compositor/test_screencast_display_buffer.cpp 2016-10-12 06:03:15 +0000
522+++ tests/unit-tests/compositor/test_screencast_display_buffer.cpp 2016-11-25 03:23:22 +0000
523@@ -191,7 +191,7 @@
524 db.bind();
525 db.swap_buffers();
526
527- ASSERT_THAT(ready_queue.num_scheduled(), Gt(0));
528+ ASSERT_THAT(ready_queue.num_scheduled(), Gt(0u));
529
530 auto ready_buffer = ready_queue.next_buffer();
531 auto const expected_buffer = mt::fake_shared(stub_buffer);
532
533=== modified file 'tests/unit-tests/frontend/test_protobuf_buffer_packer.cpp'
534--- tests/unit-tests/frontend/test_protobuf_buffer_packer.cpp 2015-06-25 03:00:08 +0000
535+++ tests/unit-tests/frontend/test_protobuf_buffer_packer.cpp 2016-11-25 03:23:22 +0000
536@@ -94,8 +94,8 @@
537 using namespace testing;
538
539 mp::Buffer response;
540- unsigned int const num_fds{3};
541- for(auto i = 0u; i < num_fds; i++)
542+ int const num_fds{3};
543+ for(auto i = 0; i < num_fds; i++)
544 response.add_fd(fileno(tmpfile()));
545
546 mir::Fd additional_fd{fileno(tmpfile())};
547@@ -106,7 +106,7 @@
548 }
549
550 EXPECT_THAT(response.fd().size(), Eq(num_fds+1));
551- auto i = 0u;
552+ auto i = 0;
553 for(; i < num_fds; i++)
554 EXPECT_THAT(response.fd().Get(i), Not(mtd::RawFdIsValid()));
555 EXPECT_THAT(response.fd().Get(i), mtd::RawFdIsValid());
556
557=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
558--- tests/unit-tests/frontend/test_session_mediator.cpp 2016-11-17 07:49:02 +0000
559+++ tests/unit-tests/frontend/test_session_mediator.cpp 2016-11-25 03:23:22 +0000
560@@ -537,7 +537,8 @@
561
562 mediator.create_screencast(&screencast_parameters,
563 &screencast, null_callback.get());
564- EXPECT_EQ(stub_buffer.id().as_value(), screencast.buffer_stream().buffer().buffer_id());
565+ EXPECT_EQ(static_cast<int>(stub_buffer.id().as_value()),
566+ screencast.buffer_stream().buffer().buffer_id());
567 }
568
569 TEST_F(SessionMediator, eventually_partially_packs_screencast_buffer)
570@@ -561,7 +562,8 @@
571
572 mediator.screencast_buffer(&screencast_id,
573 &protobuf_buffer, null_callback.get());
574- EXPECT_EQ(stub_buffer.id().as_value(), protobuf_buffer.buffer_id());
575+ EXPECT_EQ(static_cast<int>(stub_buffer.id().as_value()),
576+ protobuf_buffer.buffer_id());
577 }
578
579 TEST_F(SessionMediator, partially_packs_next_buffer_after_creating_screencast)
580@@ -667,14 +669,14 @@
581 TEST_F(SessionMediator, allocates_from_the_session)
582 {
583 using namespace testing;
584- auto num_requests = 3u;
585+ auto num_requests = 3;
586 mp::Void null;
587 mp::BufferStreamId id;
588 id.set_value(0);
589 mp::BufferAllocation request;
590 *request.mutable_id() = id;
591 mg::BufferProperties properties(geom::Size{34, 84}, mir_pixel_format_abgr_8888, mg::BufferUsage::hardware);
592- for(auto i = 0u; i < num_requests; i++)
593+ for(auto i = 0; i < num_requests; i++)
594 {
595 auto buffer_request = request.add_buffer_requests();
596 buffer_request->set_width(properties.size.width.as_int());
597@@ -693,14 +695,14 @@
598 TEST_F(SessionMediator, removes_buffer_from_the_session)
599 {
600 using namespace testing;
601- auto num_requests = 3u;
602+ auto num_requests = 3;
603 mp::Void null;
604 mp::BufferStreamId id;
605 id.set_value(0);
606 mp::BufferRelease request;
607 *request.mutable_id() = id;
608 auto buffer_id = 442u;
609- for(auto i = 0u; i < num_requests; i++)
610+ for(auto i = 0; i < num_requests; i++)
611 {
612 auto buffer_request = request.add_buffers();
613 buffer_request->set_buffer_id(buffer_id);
614
615=== modified file 'tests/unit-tests/input/test_x11_platform.cpp'
616--- tests/unit-tests/input/test_x11_platform.cpp 2016-07-18 07:38:38 +0000
617+++ tests/unit-tests/input/test_x11_platform.cpp 2016-11-25 03:23:22 +0000
618@@ -122,7 +122,7 @@
619
620 x11_platform.start();
621
622- ASSERT_THAT(devices.size(), Eq(2));
623+ ASSERT_THAT(devices.size(), Eq(2u));
624
625 auto const& first_info = devices[0]->get_device_info();
626 auto const& second_info = devices[1]->get_device_info();
627
628=== modified file 'tests/unit-tests/platforms/android/client/test_buffer.cpp'
629--- tests/unit-tests/platforms/android/client/test_buffer.cpp 2016-10-11 12:58:21 +0000
630+++ tests/unit-tests/platforms/android/client/test_buffer.cpp 2016-11-25 03:23:22 +0000
631@@ -123,14 +123,14 @@
632 buffer.fill_update_msg(msg);
633
634 EXPECT_THAT(msg.data_items, Eq(0));
635- EXPECT_THAT(msg.flags, Eq(mir_buffer_flag_fenced));
636+ EXPECT_THAT(msg.flags, Eq(static_cast<unsigned>(mir_buffer_flag_fenced)));
637 EXPECT_THAT(msg.fd_items, Eq(1));
638 EXPECT_THAT(msg.fd[0], Eq(stub_fence));
639
640 buffer.fill_update_msg(msg);
641
642 EXPECT_THAT(msg.data_items, Eq(0));
643- EXPECT_THAT(msg.flags, Eq(0));
644+ EXPECT_THAT(msg.flags, Eq(0u));
645 EXPECT_THAT(msg.fd_items, Eq(0));
646 }
647
648
649=== modified file 'tests/unit-tests/platforms/android/server/test_device_detection.cpp'
650--- tests/unit-tests/platforms/android/server/test_device_detection.cpp 2016-11-09 02:30:14 +0000
651+++ tests/unit-tests/platforms/android/server/test_device_detection.cpp 2016-11-25 03:23:22 +0000
652@@ -291,7 +291,7 @@
653
654 disable_num_framebuffers_quirk();
655 mga::DeviceQuirks quirks(mock_ops, options);
656- EXPECT_THAT(quirks.num_framebuffers(), Ne(3));
657+ EXPECT_THAT(quirks.num_framebuffers(), Ne(3u));
658 }
659
660 TEST_F(DeviceQuirks, gralloc_cannot_be_closed_safely_quirk_can_be_disabled)
661
662=== modified file 'tests/unit-tests/platforms/android/server/test_display.cpp'
663--- tests/unit-tests/platforms/android/server/test_display.cpp 2016-11-09 02:30:14 +0000
664+++ tests/unit-tests/platforms/android/server/test_display.cpp 2016-11-25 03:23:22 +0000
665@@ -459,7 +459,7 @@
666 EXPECT_TRUE(outputs[0].connected);
667 EXPECT_TRUE(outputs[0].used);
668 EXPECT_EQ(origin, outputs[0].top_left);
669- EXPECT_EQ(0, outputs[0].current_mode_index);
670+ EXPECT_EQ(0u, outputs[0].current_mode_index);
671 EXPECT_EQ(physical_size, outputs[0].physical_size_mm);
672
673 EXPECT_FALSE(outputs[1].connected);
674@@ -510,10 +510,10 @@
675 EXPECT_TRUE(outputs[0].connected);
676 EXPECT_TRUE(outputs[0].used);
677 EXPECT_EQ(origin, outputs[0].top_left);
678- EXPECT_EQ(0, outputs[0].current_mode_index);
679+ EXPECT_EQ(0u, outputs[0].current_mode_index);
680 EXPECT_EQ(primary_physical_size, outputs[0].physical_size_mm);
681 EXPECT_EQ(format, outputs[0].current_format);
682- ASSERT_EQ(1, outputs[0].pixel_formats.size());
683+ ASSERT_EQ(1u, outputs[0].pixel_formats.size());
684 EXPECT_EQ(format, outputs[0].pixel_formats[0]);
685
686 ASSERT_EQ(1u, outputs[1].modes.size());
687@@ -525,10 +525,10 @@
688 EXPECT_TRUE(outputs[1].connected);
689 EXPECT_TRUE(outputs[1].used);
690 EXPECT_EQ(origin, outputs[1].top_left);
691- EXPECT_EQ(0, outputs[1].current_mode_index);
692+ EXPECT_EQ(0u, outputs[1].current_mode_index);
693 EXPECT_EQ(external_physical_size, outputs[1].physical_size_mm);
694 EXPECT_EQ(format, outputs[1].current_format);
695- ASSERT_EQ(1, outputs[1].pixel_formats.size());
696+ ASSERT_EQ(1u, outputs[1].pixel_formats.size());
697 EXPECT_EQ(format, outputs[1].pixel_formats[0]);
698
699 EXPECT_FALSE(outputs[2].connected);
700@@ -928,7 +928,7 @@
701 display.configuration()->for_each_card(
702 [&](mg::DisplayConfigurationCard const& config)
703 {
704- EXPECT_THAT(config.max_simultaneous_outputs, Eq(3));
705+ EXPECT_THAT(config.max_simultaneous_outputs, Eq(3u));
706 num_cards++;
707 });
708 EXPECT_THAT(num_cards, Eq(1));
709
710=== modified file 'tests/unit-tests/platforms/android/server/test_hwc_configuration.cpp'
711--- tests/unit-tests/platforms/android/server/test_hwc_configuration.cpp 2016-11-09 02:30:14 +0000
712+++ tests/unit-tests/platforms/android/server/test_hwc_configuration.cpp 2016-11-25 03:23:22 +0000
713@@ -196,7 +196,7 @@
714
715 auto vrefresh_hz = 1000.0 / vrefresh_period.count();
716 auto attribs = config.active_config_for(display);
717- ASSERT_THAT(attribs.modes.size(), Eq(1));
718+ ASSERT_THAT(attribs.modes.size(), Eq(1u));
719 EXPECT_THAT(attribs.modes[0].size, Eq(px_size));
720 EXPECT_THAT(attribs.modes[0].vrefresh_hz, Eq(vrefresh_hz));
721 EXPECT_THAT(attribs.physical_size_mm, Eq(mm_size));
722@@ -215,7 +215,7 @@
723 config.active_config_for(mga::DisplayName::primary);
724 }, std::runtime_error);
725 auto external_attribs = config.active_config_for(mga::DisplayName::external);
726- EXPECT_THAT(external_attribs.modes.size(), Eq(0));
727+ EXPECT_THAT(external_attribs.modes.size(), Eq(0u));
728 EXPECT_FALSE(external_attribs.connected);
729 EXPECT_FALSE(external_attribs.used);
730 }
731@@ -231,7 +231,7 @@
732 config.active_config_for(mga::DisplayName::primary);
733 }, std::runtime_error);
734 auto external_attribs = config.active_config_for(mga::DisplayName::external);
735- EXPECT_THAT(external_attribs.modes.size(), Eq(0));
736+ EXPECT_THAT(external_attribs.modes.size(), Eq(0u));
737 EXPECT_FALSE(external_attribs.connected);
738 EXPECT_FALSE(external_attribs.used);
739 }
740@@ -286,8 +286,8 @@
741 hotplug_fn(mga::DisplayName::primary, true);
742 using namespace std::literals::chrono_literals;
743 vsync_fn(mga::DisplayName::primary, mg::Frame::Timestamp{CLOCK_MONOTONIC,123ns});
744- EXPECT_THAT(hotplug_call_count, Eq(2));
745- EXPECT_THAT(vsync_call_count, Eq(1));
746+ EXPECT_THAT(hotplug_call_count, Eq(2u));
747+ EXPECT_THAT(vsync_call_count, Eq(1u));
748 }
749
750 TEST_F(HwcConfiguration, sets_active_config_when_needed)
751
752=== modified file 'tests/unit-tests/platforms/android/server/test_hwc_device.cpp'
753--- tests/unit-tests/platforms/android/server/test_hwc_device.cpp 2016-11-16 13:24:41 +0000
754+++ tests/unit-tests/platforms/android/server/test_hwc_device.cpp 2016-11-25 03:23:22 +0000
755@@ -165,7 +165,7 @@
756 .InSequence(seq)
757 .WillOnce(Invoke([&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
758 {
759- ASSERT_EQ(contents[0]->numHwLayers, 3);
760+ ASSERT_EQ(contents[0]->numHwLayers, 3u);
761 contents[0]->hwLayers[0].compositionType = HWC_OVERLAY;
762 contents[0]->hwLayers[1].compositionType = HWC_FRAMEBUFFER;
763 contents[0]->hwLayers[2].compositionType = HWC_FRAMEBUFFER_TARGET;
764@@ -237,7 +237,7 @@
765 int* list_retire_fence = nullptr;
766 auto set_fences_fn = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
767 {
768- ASSERT_EQ(contents[0]->numHwLayers, 2);
769+ ASSERT_EQ(contents[0]->numHwLayers, 2u);
770 contents[0]->hwLayers[1].releaseFenceFd = fb_release_fence;
771 contents[0]->retireFenceFd = hwc_retire_fence;
772 list_retire_fence = &contents[0]->retireFenceFd;
773@@ -276,7 +276,7 @@
774
775 auto set_fences_fn = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
776 {
777- ASSERT_EQ(contents[0]->numHwLayers, 2);
778+ ASSERT_EQ(contents[0]->numHwLayers, 2u);
779 contents[0]->hwLayers[1].releaseFenceFd = fb_release_fence;
780 contents[0]->retireFenceFd = -1;
781 };
782@@ -324,7 +324,7 @@
783
784 auto set_fences_fn = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
785 {
786- ASSERT_EQ(contents[0]->numHwLayers, 3);
787+ ASSERT_EQ(contents[0]->numHwLayers, 3u);
788 contents[0]->hwLayers[0].releaseFenceFd = release_fence1;
789 contents[0]->hwLayers[1].releaseFenceFd = release_fence2;
790 contents[0]->retireFenceFd = -1;
791@@ -386,7 +386,7 @@
792 ON_CALL(*mock_device, prepare(_))
793 .WillByDefault(Invoke([&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
794 {
795- ASSERT_EQ(contents[0]->numHwLayers, 3);
796+ ASSERT_EQ(contents[0]->numHwLayers, 3u);
797 contents[0]->hwLayers[0].compositionType = HWC_OVERLAY;
798 contents[0]->hwLayers[1].compositionType = HWC_FRAMEBUFFER;
799 contents[0]->hwLayers[2].compositionType = HWC_FRAMEBUFFER_TARGET;
800@@ -500,7 +500,7 @@
801 auto updated_buffer = std::make_shared<mtd::StubBuffer>(native_buffer, size1);
802 auto set_fences_fn = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
803 {
804- ASSERT_EQ(contents[0]->numHwLayers, 3);
805+ ASSERT_EQ(contents[0]->numHwLayers, 3u);
806 contents[0]->hwLayers[0].releaseFenceFd = release_fence1;
807 contents[0]->hwLayers[1].releaseFenceFd = release_fence2;
808 contents[0]->retireFenceFd = -1;
809@@ -577,7 +577,7 @@
810 EXPECT_CALL(*mock_device, prepare(_))
811 .WillOnce(Invoke([&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
812 {
813- ASSERT_THAT(contents[0]->numHwLayers, Ge(2));
814+ ASSERT_THAT(contents[0]->numHwLayers, Ge(2u));
815 contents[0]->hwLayers[0].compositionType = HWC_FRAMEBUFFER;
816 contents[0]->hwLayers[1].compositionType = HWC_FRAMEBUFFER_TARGET;
817 }));
818@@ -676,14 +676,14 @@
819 auto set_fences = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
820 {
821 ASSERT_THAT(contents[0], testing::NotNull());
822- ASSERT_EQ(contents[0]->numHwLayers, 2);
823+ ASSERT_EQ(contents[0]->numHwLayers, 2u);
824 contents[0]->hwLayers[0].releaseFenceFd = release_fence1;
825 contents[0]->retireFenceFd = -1;
826 };
827 auto set_fences2 = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
828 {
829 ASSERT_THAT(contents[0], testing::NotNull());
830- ASSERT_EQ(contents[0]->numHwLayers, 3);
831+ ASSERT_EQ(contents[0]->numHwLayers, 3u);
832 contents[0]->hwLayers[0].releaseFenceFd = release_fence2;
833 contents[0]->hwLayers[1].releaseFenceFd = release_fence3;
834 contents[0]->retireFenceFd = -1;
835@@ -778,14 +778,14 @@
836 };
837 auto set_fences = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
838 {
839- ASSERT_EQ(contents[0]->numHwLayers, 3);
840+ ASSERT_EQ(contents[0]->numHwLayers, 3u);
841 contents[0]->hwLayers[0].releaseFenceFd = release_fence1;
842 contents[0]->hwLayers[1].releaseFenceFd = release_fence2;
843 contents[0]->retireFenceFd = -1;
844 };
845 auto set_fences2 = [&](std::array<hwc_display_contents_1_t*, HWC_NUM_DISPLAY_TYPES> const& contents)
846 {
847- ASSERT_EQ(contents[0]->numHwLayers, 3);
848+ ASSERT_EQ(contents[0]->numHwLayers, 3u);
849 contents[0]->hwLayers[0].releaseFenceFd = release_fence3;
850 contents[0]->hwLayers[1].releaseFenceFd = release_fence4;
851 contents[0]->retireFenceFd = -1;
852
853=== modified file 'tests/unit-tests/platforms/android/server/test_hwc_layerlist.cpp'
854--- tests/unit-tests/platforms/android/server/test_hwc_layerlist.cpp 2016-08-24 02:09:08 +0000
855+++ tests/unit-tests/platforms/android/server/test_hwc_layerlist.cpp 2016-11-25 03:23:22 +0000
856@@ -79,16 +79,18 @@
857
858 TEST_F(LayerListTest, list_iterators)
859 {
860- size_t additional_layers = 2;
861+ int additional_layers = 2;
862 mga::LayerList list(layer_adapter, {}, offset);
863 EXPECT_EQ(std::distance(list.begin(), list.end()), additional_layers);
864
865 additional_layers = 1;
866 mga::LayerList list2(layer_adapter, renderables, offset);
867- EXPECT_EQ(std::distance(list2.begin(), list2.end()), additional_layers + renderables.size());
868+ int const nrenderables = renderables.size();
869+ EXPECT_EQ(std::distance(list2.begin(), list2.end()),
870+ additional_layers + nrenderables);
871
872 mga::LayerList list3(std::make_shared<mga::Hwc10Adapter>(), renderables, offset);
873- EXPECT_EQ(std::distance(list3.begin(), list3.end()), renderables.size());
874+ EXPECT_EQ(std::distance(list3.begin(), list3.end()), nrenderables);
875 }
876
877 TEST_F(LayerListTest, keeps_track_of_needs_commit)
878@@ -145,7 +147,7 @@
879 list.setup_fb(stub_fb);
880
881 auto l = list.native_list();
882- ASSERT_THAT(l->numHwLayers, Eq(1));
883+ ASSERT_THAT(l->numHwLayers, Eq(1u));
884 EXPECT_THAT(l->hwLayers[l->numHwLayers-1], MatchesLegacyLayer(skip));
885 }
886
887@@ -156,7 +158,7 @@
888 list.setup_fb(stub_fb);
889
890 auto l = list.native_list();
891- ASSERT_THAT(l->numHwLayers, Eq(1 + renderables.size()));
892+ ASSERT_THAT(l->numHwLayers, Eq(1u + renderables.size()));
893 EXPECT_THAT(l->hwLayers[l->numHwLayers-1], MatchesLegacyLayer(fbtarget));
894 }
895
896@@ -166,7 +168,7 @@
897 mga::LayerList list(layer_adapter, {}, offset);
898 list.setup_fb(stub_fb);
899 auto l = list.native_list();
900- ASSERT_THAT(l->numHwLayers, Eq(2));
901+ ASSERT_THAT(l->numHwLayers, Eq(2u));
902 EXPECT_THAT(l->hwLayers[l->numHwLayers-2], MatchesLegacyLayer(skip));
903 EXPECT_THAT(l->hwLayers[l->numHwLayers-1], MatchesLegacyLayer(fbtarget));
904 }
905@@ -177,7 +179,7 @@
906 mga::LayerList list(layer_adapter, renderables, offset);
907
908 auto l = list.native_list();
909- ASSERT_THAT(l->numHwLayers, Eq(4));
910+ ASSERT_THAT(l->numHwLayers, Eq(4u));
911 l->hwLayers[1].compositionType = HWC_OVERLAY;
912
913 EXPECT_THAT(list.rejected_renderables(), ElementsAre(renderables.front(), renderables.back()));
914@@ -188,7 +190,7 @@
915 using namespace testing;
916 mga::LayerList list(layer_adapter, renderables, offset);
917 auto l = list.native_list();
918- ASSERT_THAT(l->numHwLayers, Eq(4));
919+ ASSERT_THAT(l->numHwLayers, Eq(4u));
920 for (auto i = 0u; i < 3; i++)
921 l->hwLayers[i].compositionType = HWC_OVERLAY;
922 l->hwLayers[3].compositionType = HWC_FRAMEBUFFER_TARGET;
923@@ -221,7 +223,7 @@
924 mga::LayerList list(layer_adapter, {}, offset);
925 list.setup_fb(stub_fb);
926 auto l = list.native_list();
927- ASSERT_THAT(l->numHwLayers, Eq(2));
928+ ASSERT_THAT(l->numHwLayers, Eq(2u));
929 EXPECT_THAT(l->hwLayers[l->numHwLayers-2], MatchesLegacyLayer(skip));
930 EXPECT_THAT(l->hwLayers[l->numHwLayers-1], MatchesLegacyLayer(fbtarget));
931 }
932@@ -243,7 +245,7 @@
933 mt::fill_hwc_layer(expected_layer, &visible_rect, expected_rectangle, *buffer1, HWC_FRAMEBUFFER, 0);
934
935 auto l = list.native_list();
936- ASSERT_THAT(l->numHwLayers, Eq(2));
937+ ASSERT_THAT(l->numHwLayers, Eq(2u));
938 EXPECT_THAT(l->hwLayers[l->numHwLayers-2], MatchesLegacyLayer(expected_layer));
939 EXPECT_THAT(l->hwLayers[l->numHwLayers-1], MatchesLegacyLayer(fbtarget));
940 }
941
942=== modified file 'tests/unit-tests/platforms/android/server/test_hwc_wrapper.cpp'
943--- tests/unit-tests/platforms/android/server/test_hwc_wrapper.cpp 2016-11-09 02:30:14 +0000
944+++ tests/unit-tests/platforms/android/server/test_hwc_wrapper.cpp 2016-11-25 03:23:22 +0000
945@@ -251,7 +251,7 @@
946 id = mga::ConfigId{*array_it++};
947
948 EXPECT_CALL(*mock_device, getDisplayConfigs_interface(
949- mock_device.get(), HWC_DISPLAY_PRIMARY, _, Pointee(Gt(0))))
950+ mock_device.get(), HWC_DISPLAY_PRIMARY, _, Pointee(Gt(0u))))
951 .WillOnce(DoAll(
952 SetArrayArgument<2>(id_array.begin(), id_array.end()),
953 SetArgPointee<3>(id_array.size()),
954@@ -364,5 +364,5 @@
955 //After that point, we don't care, so just make sure there's something to call
956 callbacks->hooks.vsync(&callbacks->hooks, 0, 0);
957
958- EXPECT_THAT(call_count, Eq(1));
959+ EXPECT_THAT(call_count, Eq(1u));
960 }
961
962=== modified file 'tests/unit-tests/platforms/android/server/test_output_builder.cpp'
963--- tests/unit-tests/platforms/android/server/test_output_builder.cpp 2016-11-09 02:30:14 +0000
964+++ tests/unit-tests/platforms/android/server/test_output_builder.cpp 2016-11-25 03:23:22 +0000
965@@ -215,7 +215,7 @@
966 buffer_list.push_back(fbs->buffer_for_render()->id());
967 std::sort(buffer_list.begin(), buffer_list.end());
968 buffer_list.erase(std::unique(buffer_list.begin(), buffer_list.end()), buffer_list.end());
969- EXPECT_THAT(buffer_list.size(), Eq(2));
970+ EXPECT_THAT(buffer_list.size(), Eq(2u));
971 }
972
973 TEST_F(HalComponentFactory, doesnt_complain_if_version_is_supported)
974
975=== modified file 'tests/unit-tests/platforms/mesa/client/test_client_buffer.cpp'
976--- tests/unit-tests/platforms/mesa/client/test_client_buffer.cpp 2016-10-31 02:37:31 +0000
977+++ tests/unit-tests/platforms/mesa/client/test_client_buffer.cpp 2016-11-25 03:23:22 +0000
978@@ -213,7 +213,7 @@
979 mclg::ClientBuffer buffer(buffer_file_ops, package, size, pf);
980 buffer.egl_image_creation_parameters(&type, &egl_buffer, &attrs);
981
982- EXPECT_THAT(type, Eq(EGL_LINUX_DMA_BUF_EXT));
983+ EXPECT_THAT(type, Eq(static_cast<EGLenum>(EGL_LINUX_DMA_BUF_EXT)));
984 EXPECT_THAT(egl_buffer, Eq(nullptr));
985 EXPECT_THAT(attrs, mir::test::doubles::AttrMatches(expected_image_attrs));
986 }
987
988=== modified file 'tests/unit-tests/platforms/mesa/client/test_client_platform.cpp'
989--- tests/unit-tests/platforms/mesa/client/test_client_platform.cpp 2016-09-01 23:08:33 +0000
990+++ tests/unit-tests/platforms/mesa/client/test_client_platform.cpp 2016-11-25 03:23:22 +0000
991@@ -124,7 +124,9 @@
992 &mir_platform_message_release);
993
994 platform->populate(pkg);
995- EXPECT_THAT(pkg.data_items, Eq(previous_data_count + (sizeof(gbm_dev_dummy) / sizeof(int))));
996+ EXPECT_THAT(pkg.data_items,
997+ Eq(static_cast<int>(previous_data_count +
998+ (sizeof(gbm_dev_dummy) / sizeof(int)))));
999
1000 gbm_device* device_in_package{nullptr};
1001 std::memcpy(&device_in_package, &pkg.data[previous_data_count],
1002
1003=== modified file 'tests/unit-tests/platforms/mesa/kms-utils/test_drm_mode_resources.cpp'
1004--- tests/unit-tests/platforms/mesa/kms-utils/test_drm_mode_resources.cpp 2016-05-23 04:39:40 +0000
1005+++ tests/unit-tests/platforms/mesa/kms-utils/test_drm_mode_resources.cpp 2016-11-25 03:23:22 +0000
1006@@ -201,6 +201,7 @@
1007
1008 mgk::ObjectProperties plane_props{0, plane_id, DRM_MODE_OBJECT_PLANE};
1009
1010- EXPECT_THAT(plane_props["type"], Eq(DRM_PLANE_TYPE_CURSOR));
1011- EXPECT_THAT(plane_props.id_for("CRTC_ID"), Eq(99));
1012-}
1013\ No newline at end of file
1014+ EXPECT_THAT(plane_props["type"],
1015+ Eq(static_cast<unsigned>(DRM_PLANE_TYPE_CURSOR)));
1016+ EXPECT_THAT(plane_props.id_for("CRTC_ID"), Eq(99u));
1017+}
1018
1019=== modified file 'tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp'
1020--- tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp 2016-10-31 02:37:31 +0000
1021+++ tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp 2016-11-25 03:23:22 +0000
1022@@ -360,7 +360,7 @@
1023 auto conf = display->configuration();
1024
1025
1026- size_t output_count{0};
1027+ int output_count{0};
1028
1029 conf->for_each_output([&](mg::DisplayConfigurationOutput const& output)
1030 {
1031@@ -446,7 +446,7 @@
1032 auto conf = display->configuration();
1033
1034
1035- size_t output_count{0};
1036+ int output_count{0};
1037
1038 conf->for_each_output([&](mg::DisplayConfigurationOutput const& output)
1039 {
1040
1041=== modified file 'tests/unit-tests/platforms/mesa/kms/test_ipc_operations.cpp'
1042--- tests/unit-tests/platforms/mesa/kms/test_ipc_operations.cpp 2016-11-11 07:56:09 +0000
1043+++ tests/unit-tests/platforms/mesa/kms/test_ipc_operations.cpp 2016-11-25 03:23:22 +0000
1044@@ -143,6 +143,6 @@
1045 EXPECT_CALL(mock_drm_ops, authenticated_fd())
1046 .WillOnce(Return(stub_fd));
1047 auto connection_package = ipc_ops.connection_ipc_package();
1048- ASSERT_THAT(connection_package->ipc_fds.size(), Eq(1));
1049+ ASSERT_THAT(connection_package->ipc_fds.size(), Eq(1u));
1050 EXPECT_THAT(connection_package->ipc_fds[0], mtd::RawFdMatcher(stub_fd));
1051 }
1052
1053=== modified file 'tests/unit-tests/platforms/nested/test_buffer.cpp'
1054--- tests/unit-tests/platforms/nested/test_buffer.cpp 2016-10-31 02:37:31 +0000
1055+++ tests/unit-tests/platforms/nested/test_buffer.cpp 2016-11-25 03:23:22 +0000
1056@@ -106,7 +106,7 @@
1057 TEST_F(NestedBuffer, generates_valid_id)
1058 {
1059 mgn::Buffer buffer(mt::fake_shared(mock_connection), sw_properties);
1060- EXPECT_THAT(buffer.id().as_value(), Gt(0));
1061+ EXPECT_THAT(buffer.id().as_value(), Gt(0u));
1062 }
1063
1064 TEST_F(NestedBuffer, has_correct_properties)
1065
1066=== modified file 'tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp'
1067--- tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2016-01-29 08:18:22 +0000
1068+++ tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2016-11-25 03:23:22 +0000
1069@@ -100,7 +100,7 @@
1070 ov.f(output);
1071 EXPECT_EQ(true, output.used);
1072 EXPECT_EQ(new_top_left, output.top_left);
1073- EXPECT_EQ(0, output.current_mode_index);
1074+ EXPECT_EQ(0u, output.current_mode_index);
1075 EXPECT_EQ(default_current_output_format, output.current_format);
1076 });
1077 }
1078@@ -156,7 +156,7 @@
1079 {
1080 EXPECT_EQ(true, output.used);
1081 EXPECT_EQ(top_left, output.top_left);
1082- EXPECT_EQ(1, output.current_mode_index);
1083+ EXPECT_EQ(1u, output.current_mode_index);
1084 EXPECT_EQ(mir_pixel_format_argb_8888, output.current_format);
1085 }
1086 });
1087
1088=== modified file 'tests/unit-tests/test_flags.cpp'
1089--- tests/unit-tests/test_flags.cpp 2015-02-26 07:53:11 +0000
1090+++ tests/unit-tests/test_flags.cpp 2016-11-25 03:23:22 +0000
1091@@ -68,7 +68,7 @@
1092 using namespace testing;
1093 arb::Profile empty = arb::Character::Curious & arb::Character::Reckless;
1094
1095- EXPECT_THAT(empty.value(),Eq(0));
1096+ EXPECT_THAT(empty.value(),Eq(0u));
1097 }
1098
1099 TEST(MirFlags,contains_check_works_for_masks)
1100
1101=== modified file 'tests/unit-tests/test_shared_library_prober.cpp'
1102--- tests/unit-tests/test_shared_library_prober.cpp 2016-07-18 07:38:38 +0000
1103+++ tests/unit-tests/test_shared_library_prober.cpp 2016-11-25 03:23:22 +0000
1104@@ -75,7 +75,7 @@
1105 TEST_F(SharedLibraryProber, returns_non_empty_list_for_path_containing_libraries)
1106 {
1107 auto libraries = mir::libraries_for_path(library_path, null_report);
1108- EXPECT_GE(libraries.size(), 1);
1109+ EXPECT_GE(libraries.size(), 1u);
1110 }
1111
1112 TEST_F(SharedLibraryProber, raises_exception_for_nonexistent_path)
1113@@ -116,7 +116,7 @@
1114 TEST_F(SharedLibraryProber, path_with_no_shared_libraries_returns_empty_list)
1115 {
1116 auto libraries = mir::libraries_for_path(temporary_directory.c_str(), null_report);
1117- EXPECT_EQ(0, libraries.size());
1118+ EXPECT_EQ(0u, libraries.size());
1119 }
1120
1121 TEST_F(SharedLibraryProber, logs_start_of_probe)

Subscribers

People subscribed via source and target branches